File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,23 @@ allprojects {
12
12
}
13
13
}
14
14
15
- tasks.withType<JavaCompile >().configureEach {
16
- sourceCompatibility = " 11"
17
- targetCompatibility = " 11"
15
+ val jvmVersion: Provider <String > = providers.gradleProperty(" kotlin.jvm.target" )
16
+
17
+ subprojects {
18
+ plugins.withType< com.android.build.gradle.BasePlugin > ().configureEach {
19
+ extensions.findByType< com.android.build.gradle.BaseExtension > ()?.apply {
20
+ jvmVersion.map { JavaVersion .toVersion(it) }.orNull?.let {
21
+ compileOptions {
22
+ sourceCompatibility = it
23
+ targetCompatibility = it
24
+ }
25
+ }
26
+ }
27
+ }
28
+ // Apply kotlinOptions.jvmTarget to subprojects
29
+ tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().configureEach {
30
+ kotlinOptions {
31
+ if (jvmVersion.isPresent) jvmTarget = jvmVersion.get()
32
+ }
33
+ }
18
34
}
Original file line number Diff line number Diff line change 1
1
kotlin.code.style =official
2
+ kotlin.jvm.target =11
2
3
3
4
GROUP =io.github.kevincianfarini.monarch
4
5
VERSION_NAME =0.1.0-SNAPSHOT
You can’t perform that action at this time.
0 commit comments