fix: bump JVM toolchain to 21 and centralize build constants
Extract JVM_TOOLCHAIN_VERSION, COMPILE_SDK, MIN_SDK, and TARGET_SDK into a shared BuildConstants object so all convention plugins reference a single source of truth.
This commit is contained in:
parent
11ecdb590e
commit
08f8445ea8
4 changed files with 16 additions and 10 deletions
|
|
@ -13,17 +13,17 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
|
|||
pluginManager.apply("org.jetbrains.kotlinx.kover")
|
||||
|
||||
extensions.configure<KotlinAndroidProjectExtension> {
|
||||
jvmToolchain(17)
|
||||
jvmToolchain(BuildConstants.JVM_TOOLCHAIN_VERSION)
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll("-opt-in=kotlin.time.ExperimentalTime")
|
||||
}
|
||||
}
|
||||
|
||||
extensions.configure<ApplicationExtension> {
|
||||
compileSdk = 36
|
||||
compileSdk = BuildConstants.COMPILE_SDK
|
||||
defaultConfig {
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
minSdk = BuildConstants.MIN_SDK
|
||||
targetSdk = BuildConstants.TARGET_SDK
|
||||
versionCode = 1
|
||||
versionName = "0.1.0"
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
|
|
|||
|
|
@ -13,16 +13,16 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
|
|||
pluginManager.apply("org.jetbrains.kotlinx.kover")
|
||||
|
||||
extensions.configure<KotlinAndroidProjectExtension> {
|
||||
jvmToolchain(17)
|
||||
jvmToolchain(BuildConstants.JVM_TOOLCHAIN_VERSION)
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll("-opt-in=kotlin.time.ExperimentalTime")
|
||||
}
|
||||
}
|
||||
|
||||
extensions.configure<LibraryExtension> {
|
||||
compileSdk = 36
|
||||
compileSdk = BuildConstants.COMPILE_SDK
|
||||
defaultConfig {
|
||||
minSdk = 26
|
||||
minSdk = BuildConstants.MIN_SDK
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
compileOptions {
|
||||
|
|
|
|||
6
build-logic/convention/src/main/kotlin/BuildConstants.kt
Normal file
6
build-logic/convention/src/main/kotlin/BuildConstants.kt
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
object BuildConstants {
|
||||
const val JVM_TOOLCHAIN_VERSION = 21
|
||||
const val COMPILE_SDK = 36
|
||||
const val MIN_SDK = 26
|
||||
const val TARGET_SDK = 35
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ class KmpLibraryConventionPlugin : Plugin<Project> {
|
|||
pluginManager.apply("org.jetbrains.kotlinx.kover")
|
||||
|
||||
extensions.configure<KotlinMultiplatformExtension> {
|
||||
jvmToolchain(17)
|
||||
jvmToolchain(BuildConstants.JVM_TOOLCHAIN_VERSION)
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll(
|
||||
"-opt-in=kotlin.time.ExperimentalTime",
|
||||
|
|
@ -34,9 +34,9 @@ class KmpLibraryConventionPlugin : Plugin<Project> {
|
|||
}
|
||||
|
||||
extensions.configure<LibraryExtension> {
|
||||
compileSdk = 36
|
||||
compileSdk = BuildConstants.COMPILE_SDK
|
||||
defaultConfig {
|
||||
minSdk = 26
|
||||
minSdk = BuildConstants.MIN_SDK
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
compileOptions {
|
||||
|
|
|
|||
Loading…
Reference in a new issue