feat(build): raise target bytecode to Java 17

This commit is contained in:
Harsh Shandilya 2023-05-16 15:54:35 +05:30
parent 76efe73e28
commit 72696ae557
No known key found for this signature in database
3 changed files with 8 additions and 8 deletions

View File

@ -10,13 +10,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { `kotlin-dsl` }
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
freeCompilerArgs =
freeCompilerArgs +
listOf(

View File

@ -33,8 +33,8 @@ object AndroidCommon {
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
testOptions {

View File

@ -23,12 +23,12 @@ class KotlinCommonPlugin : Plugin<Project> {
val isAppModule = project.pluginManager.hasPlugin("com.android.application")
project.tasks.run {
withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
withType<KotlinCompile>().configureEach task@{
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
jvmTarget.set(JvmTarget.JVM_17)
allWarningsAsErrors.set(true)
languageVersion.set(KotlinVersion.KOTLIN_1_8)
freeCompilerArgs.addAll(ADDITIONAL_COMPILER_ARGS)