Skip to content

Commit 942c8c9

Browse files
committed
chore: use Java -release 8, Kotlin apiVersion=1.4 (support Gradle 7+)
1 parent f75f49f commit 942c8c9

File tree

4 files changed

+48
-32
lines changed

4 files changed

+48
-32
lines changed

build.gradle.kts

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
import org.gradle.plugins.ide.idea.model.IdeaProject
1818
import org.jetbrains.gradle.ext.CopyrightConfiguration
1919
import org.jetbrains.gradle.ext.ProjectSettings
20-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
20+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
21+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
22+
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
2123

2224
plugins {
2325
id("com.gradle.plugin-publish") apply false
@@ -67,13 +69,17 @@ allprojects {
6769
plugins.withId("java") {
6870
configure<JavaPluginExtension> {
6971
withSourcesJar()
70-
sourceCompatibility = JavaVersion.VERSION_1_8
71-
targetCompatibility = JavaVersion.VERSION_1_8
72+
}
73+
tasks.withType<JavaCompile>().configureEach {
74+
options.release.set(8)
7275
}
7376
}
74-
tasks.withType<KotlinCompile> {
75-
kotlinOptions {
76-
jvmTarget = "1.8"
77+
tasks.withType<KotlinJvmCompile>().configureEach {
78+
compilerOptions {
79+
freeCompilerArgs.add("-Xjdk-release=8")
80+
@Suppress("DEPRECATION")
81+
apiVersion.set(KotlinVersion.KOTLIN_1_4)
82+
jvmTarget = JvmTarget.JVM_1_8
7783
}
7884
}
7985
}
@@ -113,8 +119,35 @@ allprojects {
113119
// Ensure builds are reproducible
114120
isPreserveFileTimestamps = false
115121
isReproducibleFileOrder = true
116-
dirMode = "775".toInt(8)
117-
fileMode = "664".toInt(8)
122+
dirPermissions {
123+
user {
124+
read = true
125+
write = true
126+
execute = true
127+
}
128+
group {
129+
read = true
130+
write = true
131+
execute = true
132+
}
133+
other {
134+
read = true
135+
execute = true
136+
}
137+
}
138+
filePermissions {
139+
user {
140+
read = true
141+
write = true
142+
}
143+
group {
144+
read = true
145+
write = true
146+
}
147+
other {
148+
read = true
149+
}
150+
}
118151
}
119152
}
120153

plugins/gradle-extensions-plugin/src/test/kotlin/com/github/vlsi/gradle/ErrorReportingTest.kt

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package com.github.vlsi.gradle
1818

19-
import org.gradle.api.JavaVersion
2019
import org.junit.jupiter.api.Assertions
2120
import org.junit.jupiter.params.ParameterizedTest
2221
import org.junit.jupiter.params.provider.Arguments
@@ -27,23 +26,10 @@ class ErrorReportingTest : BaseGradleTest() {
2726
@JvmStatic
2827
private fun gradleVersionAndSettings(): Iterable<Arguments> {
2928
return mutableListOf<Arguments>().apply {
30-
if (JavaVersion.current() <= JavaVersion.VERSION_1_8) {
31-
add(Arguments.of("4.9"))
32-
}
33-
if (JavaVersion.current() <= JavaVersion.VERSION_12) {
34-
addAll(
35-
listOf(
36-
Arguments.of("5.6.2"),
37-
Arguments.of("4.10.2")
38-
)
39-
)
40-
}
41-
if (JavaVersion.current() < JavaVersion.VERSION_17) {
42-
add(Arguments.of("6.0"))
43-
add(Arguments.of("6.8"))
44-
add(Arguments.of("7.6.1"))
45-
}
46-
add(Arguments.of("8.0.2"))
29+
add(Arguments.of("7.0"))
30+
add(Arguments.of("7.5"))
31+
add(Arguments.of("8.0"))
32+
add(Arguments.of("8.14.1"))
4733
}
4834
}
4935
}

plugins/jandex-plugin/src/test/kotlin/com/github/vlsi/jandex/JandexPluginTest.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ class JandexPluginTest : BaseGradleTest() {
3636
private fun gradleVersionAndSettings(): Iterable<Arguments> {
3737
if (!isCI) {
3838
// Use only the minimum supported Gradle version to make the test faster
39-
return listOf(arguments("6.0", ConfigurationCache.OFF))
39+
return listOf(arguments("7.0", ConfigurationCache.ON))
4040
}
4141
return mutableListOf<Arguments>().apply {
42-
add(arguments("6.0", ConfigurationCache.OFF))
43-
add(arguments("6.5", ConfigurationCache.OFF))
4442
add(arguments("7.0", ConfigurationCache.ON))
4543
add(arguments("7.4.2", ConfigurationCache.ON))
4644
// Configuration cache supports custom caches since 7.5 only: https://github.com/gradle/gradle/issues/14874

plugins/stage-vote-release-plugin/src/test/kotlin/release/ChecksumFileTest.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ class ChecksumFileTest : BaseGradleTest() {
3838
return listOf(Arguments.arguments("8.1.1", ConfigurationCache.OFF))
3939
}
4040
return mutableListOf<Arguments>().apply {
41-
add(Arguments.arguments("6.0", ConfigurationCache.OFF))
42-
add(Arguments.arguments("6.5", ConfigurationCache.OFF))
4341
add(Arguments.arguments("7.0", ConfigurationCache.OFF))
44-
add(Arguments.arguments("7.4.2", ConfigurationCache.OFF))
42+
add(Arguments.arguments("7.5", ConfigurationCache.OFF))
4543
add(Arguments.arguments("8.1.1", ConfigurationCache.OFF))
44+
add(Arguments.arguments("8.14.1", ConfigurationCache.OFF))
4645
}
4746
}
4847
}

0 commit comments

Comments
 (0)