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")
|
pluginManager.apply("org.jetbrains.kotlinx.kover")
|
||||||
|
|
||||||
extensions.configure<KotlinAndroidProjectExtension> {
|
extensions.configure<KotlinAndroidProjectExtension> {
|
||||||
jvmToolchain(17)
|
jvmToolchain(BuildConstants.JVM_TOOLCHAIN_VERSION)
|
||||||
compilerOptions {
|
compilerOptions {
|
||||||
freeCompilerArgs.addAll("-opt-in=kotlin.time.ExperimentalTime")
|
freeCompilerArgs.addAll("-opt-in=kotlin.time.ExperimentalTime")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extensions.configure<ApplicationExtension> {
|
extensions.configure<ApplicationExtension> {
|
||||||
compileSdk = 36
|
compileSdk = BuildConstants.COMPILE_SDK
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk = 26
|
minSdk = BuildConstants.MIN_SDK
|
||||||
targetSdk = 35
|
targetSdk = BuildConstants.TARGET_SDK
|
||||||
versionCode = 1
|
versionCode = 1
|
||||||
versionName = "0.1.0"
|
versionName = "0.1.0"
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,16 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
|
||||||
pluginManager.apply("org.jetbrains.kotlinx.kover")
|
pluginManager.apply("org.jetbrains.kotlinx.kover")
|
||||||
|
|
||||||
extensions.configure<KotlinAndroidProjectExtension> {
|
extensions.configure<KotlinAndroidProjectExtension> {
|
||||||
jvmToolchain(17)
|
jvmToolchain(BuildConstants.JVM_TOOLCHAIN_VERSION)
|
||||||
compilerOptions {
|
compilerOptions {
|
||||||
freeCompilerArgs.addAll("-opt-in=kotlin.time.ExperimentalTime")
|
freeCompilerArgs.addAll("-opt-in=kotlin.time.ExperimentalTime")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extensions.configure<LibraryExtension> {
|
extensions.configure<LibraryExtension> {
|
||||||
compileSdk = 36
|
compileSdk = BuildConstants.COMPILE_SDK
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk = 26
|
minSdk = BuildConstants.MIN_SDK
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
compileOptions {
|
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")
|
pluginManager.apply("org.jetbrains.kotlinx.kover")
|
||||||
|
|
||||||
extensions.configure<KotlinMultiplatformExtension> {
|
extensions.configure<KotlinMultiplatformExtension> {
|
||||||
jvmToolchain(17)
|
jvmToolchain(BuildConstants.JVM_TOOLCHAIN_VERSION)
|
||||||
compilerOptions {
|
compilerOptions {
|
||||||
freeCompilerArgs.addAll(
|
freeCompilerArgs.addAll(
|
||||||
"-opt-in=kotlin.time.ExperimentalTime",
|
"-opt-in=kotlin.time.ExperimentalTime",
|
||||||
|
|
@ -34,9 +34,9 @@ class KmpLibraryConventionPlugin : Plugin<Project> {
|
||||||
}
|
}
|
||||||
|
|
||||||
extensions.configure<LibraryExtension> {
|
extensions.configure<LibraryExtension> {
|
||||||
compileSdk = 36
|
compileSdk = BuildConstants.COMPILE_SDK
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk = 26
|
minSdk = BuildConstants.MIN_SDK
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue