Skip to content

Commit

Permalink
chore: add fixing code with jdk 17
Browse files Browse the repository at this point in the history
  • Loading branch information
sboh1214 committed Dec 28, 2023
1 parent 559d0df commit de6d9c5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import groovy.xml.XmlParser
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
ext.kotlin_version = '1.9.0'
ext.kotlin_version = '1.9.22'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.2.0'
classpath 'com.android.tools.build:gradle:8.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -19,11 +19,6 @@ allprojects {
google()
mavenCentral()
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "17"
}
}
}

rootProject.layout.buildDirectory = '../build'
Expand All @@ -37,6 +32,15 @@ subprojects {
def manifest = new XmlParser().parse(file(it.android.sourceSets.main.manifest.srcFile))
android.namespace= manifest.@package
}
tasks.withType(KotlinCompile).tap {
configureEach {
if (project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) {
kotlinOptions.jvmTarget = android.compileOptions.sourceCompatibility
} else {
kotlinOptions.jvmTarget = sourceCompatibility
}
}
}
}
project.evaluationDependsOn(':app')
}
Expand Down

0 comments on commit de6d9c5

Please sign in to comment.