1+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+ import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
3+
14plugins {
25 id ' com.android.library'
36 id ' kotlin-android'
@@ -36,17 +39,13 @@ android {
3639 }
3740
3841 defaultConfig {
39- compileSdk libs. versions. compileSdk. get(). toInteger()
42+ compileSdkVersion = libs. versions. compileSdk. get(). toInteger()
4043 minSdkVersion libs. versions. minSdk. get(). toInteger()
4144 targetSdkVersion libs. versions. targetSdk. get(). toInteger()
4245 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
43- multiDexEnabled = true
44- kotlinOptions {
45- allWarningsAsErrors = true
46- }
4746 }
4847
49- libraryVariants. all { variant ->
48+ libraryVariants. configureEach { variant ->
5049 variant. outputs. all {
5150 outputFileName = " ${ archivesBaseName} -${ version} .aar"
5251 }
@@ -63,9 +62,6 @@ android {
6362 }
6463 }
6564
66- kotlinOptions {
67- jvmTarget = ' 21'
68- }
6965 compileOptions {
7066 sourceCompatibility JavaVersion . VERSION_21
7167 targetCompatibility JavaVersion . VERSION_21
@@ -78,22 +74,11 @@ android {
7874 implementation libs. core. ktx
7975 implementation libs. androidx. test. storage
8076
81- // TODO: trim this list down
82- testImplementation libs. kotlinx. coroutines. test
8377 testImplementation libs. mockk
84- testImplementation libs. slf4j. jdk14
85- testImplementation libs. truth
8678
87- // TODO: trim this list down
88- androidTestImplementation libs. androidx. appcompat
89- androidTestImplementation libs. androidx. espresso. contrib
90- androidTestImplementation libs. androidx. espresso. core
9179 androidTestImplementation libs. androidx. junit
92- androidTestImplementation libs. androidx. multidex
93- androidTestImplementation libs. androidx. rules
9480 androidTestImplementation libs. androidx. runner
9581 androidTestImplementation libs. material
96- androidTestImplementation libs. mockk. android
9782 }
9883 packagingOptions {
9984 resources {
@@ -116,3 +101,10 @@ android {
116101afterEvaluate {
117102 apply from : " ../../publish.build.gradle"
118103}
104+
105+ tasks. withType(KotlinJvmCompile ). configureEach {
106+ compilerOptions {
107+ allWarningsAsErrors. set(true )
108+ jvmTarget. set(JvmTarget . JVM_21 )
109+ }
110+ }
0 commit comments