Skip to content

Commit b546d08

Browse files
committed
Always run CI on the latest Java
- Java level has been pinned by 301e82e, we don't need to test on various JDKs. - Syncs GradleUp/shadow@7dec251.
1 parent d0e50fe commit b546d08

File tree

6 files changed

+26
-30
lines changed

6 files changed

+26
-30
lines changed

renovate.json renamed to .github/renovate.json5

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,31 @@
2929
"allowedVersions": "!/(-alpha|-Alpha|-ALPHA|-beta|-Beta|-BETA|-milestone|-m|-SNAPSHOT)/"
3030
}
3131
],
32+
ignorePresets: [
33+
// Ensure we get the latest version and are not pinned to old versions.
34+
'workarounds:javaLTSVersions',
35+
],
3236
"customManagers": [
3337
{
3438
"customType": "regex",
3539
"fileMatch": ["\\.versions.toml$"],
3640
"matchStrings": ["(^|\n)(?<depName>gradle) *= *\"(?<currentValue>.*)\""],
3741
"depNameTemplate": "gradle",
3842
"datasourceTemplate": "gradle-version"
39-
}
43+
},
44+
// Update .java-version file with the latest JDK version.
45+
{
46+
customType: 'regex',
47+
fileMatch: [
48+
'\\.java-version$',
49+
],
50+
matchStrings: [
51+
'(?<currentValue>.*)\\n',
52+
],
53+
datasourceTemplate: 'java-version',
54+
depNameTemplate: 'java',
55+
// Only write the major version.
56+
extractVersionTemplate: '^(?<version>\\d+)',
57+
},
4058
]
4159
}

.github/workflows/.java-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

.github/workflows/build.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,21 @@ concurrency:
1212

1313
jobs:
1414
build:
15-
name: JDK ${{ matrix.java_version }}, Config ${{ matrix.test_config_method }}
15+
name: Config ${{ matrix.test_config_method }}
1616
runs-on: ubuntu-latest
1717

1818
strategy:
1919
matrix:
20-
java_version: [11, 17, 24]
2120
test_config_method: ["DSL", "PROPERTIES", "BASE"]
2221

2322
steps:
2423
- name: Checkout
2524
uses: actions/checkout@v5
2625

27-
- name: Install JDK ${{ matrix.java_version }}
28-
uses: actions/setup-java@v5
26+
- uses: actions/setup-java@v5
2927
with:
3028
distribution: zulu
31-
java-version: ${{ matrix.java_version }}
32-
33-
- name: Install JDK 24
34-
uses: actions/setup-java@v5
35-
with:
36-
distribution: zulu
37-
java-version: 24
29+
java-version-file: .github/workflows/.java-version
3830

3931
- name: Accept Android SDK license
4032
run: echo -e "24333f8a63b6825ea9c5514f83c2829b004d1fee\n" > "$ANDROID_HOME/licenses/android-sdk-license"
@@ -43,10 +35,9 @@ jobs:
4335

4436
- name: Run ktlint
4537
run: ./kotlinw ktlint.main.kts --fail-on-changes
46-
if: ${{ matrix.java_version != '11' }}
4738

4839
- name: Build with Gradle
49-
run: ./gradlew build --stacktrace -DtestJavaVersion=${{ matrix.java_version }} -DtestConfigMethod=${{ matrix.test_config_method }}
40+
run: ./gradlew build --stacktrace -DtestConfigMethod=${{ matrix.test_config_method }}
5041

5142
# Status check that is required in branch protection rules.
5243
build-status:

.github/workflows/publish-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/setup-java@v5
2222
with:
2323
distribution: zulu
24-
java-version: 11
24+
java-version-file: .github/workflows/.java-version
2525

2626
- name: Set version for tag
2727
run: |

.github/workflows/publish-snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-java@v5
2828
with:
2929
distribution: zulu
30-
java-version: 11
30+
java-version-file: .github/workflows/.java-version
3131

3232
- name: Set version
3333
run: |

plugin/build.gradle.kts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@ tasks.validatePlugins {
141141
enableStricterValidation = true
142142
}
143143

144-
tasks.whenTaskAdded {
145-
if (name.contains("lint") && this::class.java.name.contains("com.android.build")) {
146-
// TODO: lints can be run on Java 17 or above, remove this once we bump the min Java version to 17.
147-
enabled = JavaVersion.current() >= JavaVersion.VERSION_17
148-
}
149-
}
150-
151144
val integrationTest by tasks.registering(Test::class) {
152145
dependsOn(
153146
tasks.publishToMavenLocal,
@@ -161,13 +154,6 @@ val integrationTest by tasks.registering(Test::class) {
161154
testClassesDirs = integrationTestSourceSet.output.classesDirs
162155
classpath = integrationTestSourceSet.runtimeClasspath
163156

164-
val testJavaVersion = System.getProperty("testJavaVersion")
165-
if (testJavaVersion != null) {
166-
javaLauncher = javaToolchains.launcherFor {
167-
languageVersion = JavaLanguageVersion.of(testJavaVersion.toInt())
168-
}
169-
}
170-
171157
useJUnitPlatform()
172158
testLogging.showStandardStreams = true
173159
maxHeapSize = "2g"

0 commit comments

Comments
 (0)