File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
gradle/plugins/common/src/main/kotlin Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change
1
+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2
+ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
1
3
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
4
3
5
plugins {
@@ -10,24 +12,24 @@ tasks.named("kotlinSourcesJar") {
10
12
}
11
13
12
14
tasks.withType<KotlinCompile >().configureEach {
13
- kotlinOptions {
14
- apiVersion = " 1.6"
15
- languageVersion = " 1.6 "
15
+ compilerOptions {
16
+ apiVersion = KotlinVersion .fromVersion( " 1.6" )
17
+ languageVersion = apiVersion
16
18
allWarningsAsErrors = false
17
19
// Compiler arg is required for Kotlin 1.6 and below
18
20
// see https://kotlinlang.org/docs/whatsnew17.html#stable-opt-in-requirements
19
- freeCompilerArgs + = " -opt-in=kotlin.RequiresOptIn"
21
+ freeCompilerArgs.add( " -opt-in=kotlin.RequiresOptIn" )
20
22
}
21
23
}
22
24
23
25
afterEvaluate {
24
26
val extension = project.the<JavaLibraryExtension >()
25
27
tasks {
26
28
withType<KotlinCompile >().configureEach {
27
- kotlinOptions .jvmTarget = extension.mainJavaVersion.toString()
29
+ compilerOptions .jvmTarget = JvmTarget .fromTarget( extension.mainJavaVersion.toString() )
28
30
}
29
31
named<KotlinCompile >(" compileTestKotlin" ) {
30
- kotlinOptions .jvmTarget = extension.testJavaVersion.toString()
32
+ compilerOptions .jvmTarget = JvmTarget .fromTarget( extension.testJavaVersion.toString() )
31
33
}
32
34
}
33
35
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package junitbuild.java
2
2
3
3
import org.gradle.api.Action
4
4
import org.gradle.api.Task
5
- import org.gradle.api.internal.file.archive.ZipCopyAction
5
+ import org.gradle.api.internal.file.archive.ZipEntryConstants
6
6
import org.gradle.api.provider.ListProperty
7
7
import org.gradle.api.provider.Property
8
8
import org.gradle.jvm.toolchain.JavaLauncher
@@ -19,7 +19,7 @@ abstract class UpdateJarAction @Inject constructor(private val operations: ExecO
19
19
// Since ZipCopyAction.CONSTANT_TIME_FOR_ZIP_ENTRIES is in the default time zone (see its Javadoc),
20
20
// we're converting it to the same time in UTC here to make the jar reproducible regardless of the
21
21
// build's time zone.
22
- private val CONSTANT_TIME_FOR_ZIP_ENTRIES = LocalDateTime .ofInstant(Instant .ofEpochMilli(ZipCopyAction .CONSTANT_TIME_FOR_ZIP_ENTRIES ), ZoneId .systemDefault())
22
+ private val CONSTANT_TIME_FOR_ZIP_ENTRIES = LocalDateTime .ofInstant(Instant .ofEpochMilli(ZipEntryConstants .CONSTANT_TIME_FOR_ZIP_ENTRIES ), ZoneId .systemDefault())
23
23
.toInstant(ZoneOffset .UTC )
24
24
.toString()
25
25
}
You can’t perform that action at this time.
0 commit comments