This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getCurrentGitBranch() { | |
def gitBranch = "Unknown branch" | |
try { | |
def workingDir = new File("${project.projectDir}") | |
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir) | |
result.waitFor() | |
if (result.exitValue() == 0) { | |
gitBranch = result.text.trim() | |
} | |
} catch (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Generate list of arguments to pass to Sourcery | |
function sourceryArguments { | |
# Environment variables from BuildConfig to map into AppSecrets | |
local arguments=( | |
"CHAT_API_CLIENT_SECRET" "ANALYTICS_WRITE_KEY" | |
) | |
local combinedArgs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def void explainMe(it) { | |
println "Examining $it.name:" | |
println "Meta:" | |
println it.metaClass.metaMethods*.name.sort().unique() | |
println "Methods:" | |
println it.metaClass.methods*.name.sort().unique() | |
println "Properties:" | |
println it.properties.entrySet()*.toString() | |
.sort().toString().replaceAll(", ","\n") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TokenRefreshAuthenticator( | |
private val authorizationRepository: AuthorizationRepository | |
) : Authenticator { | |
override fun authenticate(route: Route?, response: Response): Request? = when { | |
response.retryCount > 2 -> null | |
else -> response.createSignedRequest() | |
} | |
private fun Response.createSignedRequest(): Request? = try { | |
val accessToken = authenticationRepository.fetchFreshAccessToken() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun uploadAttachment( | |
filename: String, file: File, mimeType: String | |
): Observable<AttachmentUploadRemoteResult> { | |
val progressEmitter = PublishSubject.create<Double>() | |
val uploadRequest = createUploadRequest( | |
filename, file, mimeType, progressEmitter | |
) | |
val uploadResult = uploadRequest | |
.map<AttachmentUploadRemoteResult> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
implementation(enforcedPlatform(project(":dependency-constraints"))) | |
implementation("org.jetbrains.kotlin:kotlin-stdlib") | |
implementation("androidx.lifecycle:lifecycle-livedata-ktx") | |
implementation("io.coil-kt:coil") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Accept licenses | |
${ANDROID_HOME}/tools/bin/sdkmanager --licenses | |
# Install dependencies | |
./gradlew androidDependencies || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CreateAccountRemoteApi { | |
@POST("user/identity") | |
fun createAccount( | |
@Body request: CreateAccountRemoteDto, | |
@Tag authorization: AuthorizationType = AuthorizationType.CLIENT_CREDENTIALS | |
): Single<AccountCreatedRemoteDto> | |
} |
NewerOlder