Kwabena Berko
tasks.register("copySomething", Copy::class) { println("How Do I Run This Task After Build Completes?") }
Lukasz Kalnik
synchronized(lock)
val okHttpClient = OkHttpClient.Builder() .addInterceptor(AccessTokenInterceptor(oAuthRepository)) .authenticator(RefreshTokenAuthenticator(oAuthRepository)) .build() val lock = Any() private class AccessTokenInterceptor( private val oAuthRepository: OAuthRepository ) : Interceptor { override fun intercept(chain: Chain): Response { synchronized(lock) { val token = oAuthRepository.accessToken val request = chain.request().newBuilder().apply { if (token != null) header("Authorization", "Bearer $token") }.build() return chain.proceed(request) } } } private class RefreshTokenAuthenticator( private val oAuthRepository: OAuthRepository ) : Authenticator { override fun authenticate(route: Route?, response: Response): Request? { if (response.responseCount >= 2) return null synchronized(lock) { return runBlocking { oAuthRepository.refreshTokens().map { oAuthRepository.accessToken } }.fold( ifLeft = { null }, ifRight = { it?.let { token -> response.request.newBuilder() .header("Authorization", "Bearer $token") .build() } } ) } } }
Humphrey
CLOVIS
Could not create an instance of type org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget. > Could not generate a decorated class for type KotlinAndroidTarget. > com/android/build/gradle/api/BaseVariant
Piotr Krzemiński
value class
inline class
@JvmInline
Praveen Kumar
jQrgen
Lance Gao
rember { mutableStateOf(mutableListOf<Int>())}
Jonathan Ellis
'capitalize(): String' is deprecated. Use replaceFirstChar instead
replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }
nuhkoca
plugins
plugins { id("com.android.application") version "7.2" apply false id("com.android.library") version "7.2" apply false }
Gradle
buildSrc
implementation("com.android.tools.build:gradle:7.2.0")
Error resolving plugin [id: ‘com.android.application’, version: ‘7.2.0’, apply: false]
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
A modern programming language that makes developers happier.