Skip to content

Commit ccbcedb

Browse files
committed
Refactor Gradle config and move jvmTarget to properties
1 parent 504c24d commit ccbcedb

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

build.gradle.kts

+10-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ plugins {
1313
id("com.github.johnrengelman.shadow")
1414
}
1515

16-
val compileKotlin: KotlinCompile by tasks
17-
compileKotlin.kotlinOptions {
18-
languageVersion = "1.4"
19-
}
20-
2116
class TaskOptions: AllOptions {
2217
override val versionFileName = "VERSION"
2318
override val rootPath: Path = rootDir.toPath()
@@ -148,6 +143,16 @@ class TaskOptions: AllOptions {
148143
}
149144

150145
allprojects {
146+
val kotlinLanguageLevel: String by rootProject
147+
val jvmTarget: String by rootProject
148+
149+
tasks.withType(KotlinCompile::class.java).all {
150+
kotlinOptions {
151+
languageVersion = kotlinLanguageLevel
152+
this.jvmTarget = jvmTarget
153+
}
154+
}
155+
151156
repositories {
152157
jcenter()
153158
mavenLocal()

buildSrc/build.gradle.kts

-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,3 @@ plugins {
77
repositories {
88
jcenter()
99
}
10-
11-
val compileKotlin: KotlinCompile by tasks
12-
compileKotlin.kotlinOptions {
13-
languageVersion = "1.4"
14-
}

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# kotlinVersion=1.4-SNAPSHOT
22
kotlinVersion=1.4.0-dev-7446
3+
kotlinLanguageLevel=1.4
4+
jvmTarget=1.8
35

46
shadowJarVersion=5.2.0
57
baseVersion=0.7.41

jupyter-lib/build.gradle.kts

-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,3 @@ dependencies {
99
testImplementation("junit:junit:4.12")
1010
testImplementation(kotlinDep("kotlin-test"))
1111
}
12-
13-
val compileKotlin: org.jetbrains.kotlin.gradle.tasks.KotlinCompile by tasks
14-
compileKotlin.kotlinOptions {
15-
languageVersion = "1.4"
16-
}

0 commit comments

Comments
 (0)