Skip to content

Commit fb39980

Browse files
committed
Upgrade build system to Gradle 9.2.1
This means using Java 17 for the build. The artifacts produced are still Java 8.
1 parent 625d3d2 commit fb39980

7 files changed

Lines changed: 45 additions & 27 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,45 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
container:
13-
image: gradle:8.14.3-jdk8
13+
image: gradle:9.2.1-jdk17
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616
with:
1717
fetch-depth: 0
18+
fetch-tags: true
19+
20+
- name: 'save-env'
21+
run: |
22+
echo "SAVE_JAVA_HOME=${JAVA_HOME}" >> "$GITHUB_ENV"
23+
echo "SAVE_PATH=${PATH}" >> "$GITHUB_ENV"
24+
25+
- name: 'add-jdk8'
26+
uses: actions/setup-java@v5
27+
with:
28+
distribution: temurin
29+
java-version: 8
1830

1931
- name: versions
2032
run: |
33+
export JAVA_HOME=$SAVE_JAVA_HOME
34+
echo JAVA_HOME=${JAVA_HOME}
35+
export PATH=$SAVE_PATH
2136
echo PATH=${PATH}
2237
git --version
23-
echo JAVA_HOME=${JAVA_HOME}
38+
echo '---'
2439
java -version
25-
gradle --version
26-
gradle javaToolchains
40+
echo '---'
41+
${JAVA_HOME_8_X64}/bin/java -version
42+
echo '---'
43+
export EXTRA_JDKS="-Porg.gradle.java.installations.paths=${JAVA_HOME_8_X64}"
44+
echo "EXTRA_JDKS=${EXTRA_JDKS}" >> "$GITHUB_ENV"
45+
gradle ${EXTRA_JDKS} javaToolchains
2746
2847
- name: build
2948
run: |
30-
gradle --warning-mode all clean build
49+
export JAVA_HOME=$SAVE_JAVA_HOME
50+
export PATH=$SAVE_PATH
51+
gradle ${EXTRA_JDKS} --warning-mode all clean build
3152
3253
- name: codecov
3354
uses: codecov/codecov-action@v5

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ The output format will always be the current version of the format.
7777

7878
In order to build this library on your local PC, and/or contribute to this library, mind the following prerequisites:
7979

80-
1. **Java** - make sure [JDK 8](https://adoptium.net/temurin/releases/?version=8) is available on your system, and
81-
the `JAVA_HOME` environment variable points to it.
80+
1. **Java** - make sure both [JDK 8](https://adoptium.net/temurin/releases/?version=8) and
81+
[JDK 17](https://adoptium.net/temurin/releases/?version=17) are available on your system. The `JAVA_HOME`
82+
environment variable should point to the JDK17, because it is used by Gradle. JDK8 is needed for compilation.
8283

8384
2. **Gradle** - We use the Gradle Wrapper, so there is nothing to install.
8485

build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ plugins {
1212
id 'signing'
1313
id 'maven-publish'
1414
id 'org.ajoberstar.grgit' version '4.1.1'
15-
id 'org.barfuin.gradle.jacocolog' version '3.1.0'
16-
id 'org.barfuin.gradle.taskinfo' version '2.2.1'
15+
id 'org.barfuin.gradle.jacocolog' version '4.0.0'
16+
id 'org.barfuin.gradle.taskinfo' version '3.0.1'
1717
}
1818

1919
repositories {
@@ -67,14 +67,14 @@ project.gradle.taskGraph.whenReady { taskGraph ->
6767
* - - - - DEPENDENCIES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6868
*/
6969
dependencies {
70-
compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
71-
api group: 'org.cyclonedx', name: 'cyclonedx-core-java', version: '11.0.1'
72-
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.17'
73-
74-
testCompileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
75-
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
76-
testImplementation group: 'commons-io', name: 'commons-io'
77-
testRuntimeOnly group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: '2.25.3'
70+
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
71+
api 'org.cyclonedx:cyclonedx-core-java:11.0.1'
72+
implementation 'org.slf4j:slf4j-api:2.0.17'
73+
74+
testCompileOnly 'com.google.code.findbugs:jsr305:3.0.2'
75+
testImplementation 'junit:junit:4.13.2'
76+
testImplementation 'commons-io:commons-io'
77+
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl:2.25.3'
7878
}
7979

8080

@@ -242,7 +242,7 @@ tasks.named('javadoc').configure {
242242
// workaround for JDK 9+: https://github.com/gradle/gradle/issues/11182
243243
def currentJavaVersion = JavaVersion.current()
244244
if (currentJavaVersion >= JavaVersion.VERSION_1_9) {
245-
options.addStringOption("-release", "8")
245+
options.addStringOption("source", "8")
246246
}
247247
}
248248

@@ -263,7 +263,7 @@ project.extensions.findByName('checkstyle').sourceSets.each { SourceSet s ->
263263

264264
dependencies {
265265
checkstyle "com.puppycrawl.tools:checkstyle:${project.extensions.checkstyle.toolVersion}"
266-
checkstyle group: 'com.github.sevntu-checkstyle', name: 'sevntu-checks', version: '1.37.0'
266+
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.37.0'
267267
}
268268

269269

gradle/wrapper/gradle-wrapper.jar

1.83 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)