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
13import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
24
35plugins {
@@ -10,24 +12,24 @@ tasks.named("kotlinSourcesJar") {
1012}
1113
1214tasks.withType<KotlinCompile >().configureEach {
13- kotlinOptions {
14- apiVersion = " 1.6"
15- languageVersion = " 1.6 "
15+ compilerOptions {
16+ apiVersion = KotlinVersion .fromVersion( " 1.6" )
17+ languageVersion = apiVersion
1618 allWarningsAsErrors = false
1719 // Compiler arg is required for Kotlin 1.6 and below
1820 // see https://kotlinlang.org/docs/whatsnew17.html#stable-opt-in-requirements
19- freeCompilerArgs + = " -opt-in=kotlin.RequiresOptIn"
21+ freeCompilerArgs.add( " -opt-in=kotlin.RequiresOptIn" )
2022 }
2123}
2224
2325afterEvaluate {
2426 val extension = project.the<JavaLibraryExtension >()
2527 tasks {
2628 withType<KotlinCompile >().configureEach {
27- kotlinOptions .jvmTarget = extension.mainJavaVersion.toString()
29+ compilerOptions .jvmTarget = JvmTarget .fromTarget( extension.mainJavaVersion.toString() )
2830 }
2931 named<KotlinCompile >(" compileTestKotlin" ) {
30- kotlinOptions .jvmTarget = extension.testJavaVersion.toString()
32+ compilerOptions .jvmTarget = JvmTarget .fromTarget( extension.testJavaVersion.toString() )
3133 }
3234 }
3335}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package junitbuild.java
22
33import org.gradle.api.Action
44import org.gradle.api.Task
5- import org.gradle.api.internal.file.archive.ZipCopyAction
5+ import org.gradle.api.internal.file.archive.ZipEntryConstants
66import org.gradle.api.provider.ListProperty
77import org.gradle.api.provider.Property
88import org.gradle.jvm.toolchain.JavaLauncher
@@ -19,7 +19,7 @@ abstract class UpdateJarAction @Inject constructor(private val operations: ExecO
1919 // Since ZipCopyAction.CONSTANT_TIME_FOR_ZIP_ENTRIES is in the default time zone (see its Javadoc),
2020 // we're converting it to the same time in UTC here to make the jar reproducible regardless of the
2121 // 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())
2323 .toInstant(ZoneOffset .UTC )
2424 .toString()
2525 }
You can’t perform that action at this time.
0 commit comments