Skip to content

Commit 562236b

Browse files
committed
Bump JDK version requirement in Gradle and CI
1 parent dce350c commit 562236b

12 files changed

Lines changed: 60 additions & 73 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,29 @@ jobs:
2929
- name: Set up Gradle
3030
uses: gradle/actions/setup-gradle@v5
3131

32-
- name: Run unit tests
32+
- name: Run unit tests (Java 23)
3333
env:
3434
USER: unittest
3535
USE_DOCKER_SERVICE: false
36-
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
36+
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -PtestJavaVersion=23
3737

3838
- name: Run independent resource tuner test
3939
env:
4040
USER: unittest
4141
USE_DOCKER_SERVICE: false
42-
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
42+
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -PtestJavaVersion=23
4343

4444
- name: Run Spring Boot 3 compatibility tests
4545
env:
4646
USER: unittest
4747
USE_DOCKER_SERVICE: false
48-
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot3Test
48+
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot3Test -PtestJavaVersion=23
4949

5050
- name: Run Spring Boot 4 compatibility tests
5151
env:
5252
USER: unittest
5353
USE_DOCKER_SERVICE: false
54-
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot4Test
54+
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot4Test -PtestJavaVersion=23
5555

5656
- name: Publish Test Report
5757
uses: mikepenz/action-junit-report@v6
@@ -76,7 +76,7 @@ jobs:
7676
with:
7777
java-version: |
7878
23
79-
11
79+
8
8080
distribution: "temurin"
8181

8282
- name: Set up Gradle
@@ -113,25 +113,25 @@ jobs:
113113
--dynamic-config-value 'component.callbacks.allowedAddresses=[{"Pattern":"localhost:7243","AllowInsecure":true}]' &
114114
sleep 10s
115115
116-
- name: Run unit tests
116+
- name: Run unit tests (Java 8)
117117
env:
118118
USER: unittest
119119
TEMPORAL_SERVICE_ADDRESS: localhost:7233
120120
USE_DOCKER_SERVICE: true
121-
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava
121+
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=8
122122

123-
- name: Run Jackson 3 converter tests
123+
- name: Run Jackson 3 converter tests (Java 17)
124124
env:
125125
USER: unittest
126126
USE_DOCKER_SERVICE: false
127-
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava
127+
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=17
128128

129-
- name: Run virtual thread tests
129+
- name: Run virtual thread tests (Java 21)
130130
env:
131131
USER: unittest
132132
TEMPORAL_SERVICE_ADDRESS: localhost:7233
133133
USE_DOCKER_SERVICE: true
134-
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava
134+
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=21
135135

136136
- name: Publish Test Report
137137
uses: mikepenz/action-junit-report@v6
@@ -154,7 +154,7 @@ jobs:
154154
- name: Set up Java
155155
uses: actions/setup-java@v5
156156
with:
157-
java-version: "11"
157+
java-version: "23"
158158
distribution: "temurin"
159159

160160
- name: Set up Gradle

.github/workflows/coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ jobs:
1919
- name: Set up Java
2020
uses: actions/setup-java@v5
2121
with:
22-
java-version: '11'
23-
distribution: 'temurin'
22+
java-version: "23"
23+
distribution: "temurin"
2424

2525
- name: Set up Gradle
2626
uses: gradle/actions/setup-gradle@v5
2727

2828
- name: Run Tests
29-
run: ./gradlew test -x spotlessCheck -x spotlessApply -Pjacoco
29+
run: ./gradlew test -x spotlessCheck -x spotlessApply -Pjacoco -PtestJavaVersion=23
3030
continue-on-error: true
3131

3232
- name: Run Test Coverage

.github/workflows/nightly-throughput-stress.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ jobs:
8989
- name: Set up Java
9090
uses: actions/setup-java@v5
9191
with:
92-
java-version: "11"
92+
java-version: "23"
9393
distribution: "temurin"
9494

9595
- name: Set up Gradle
9696
uses: gradle/actions/setup-gradle@v4
9797

9898
- name: Build SDK
99-
run: ./gradlew build -x test -x virtualThreadTests
99+
run: ./gradlew build -x test -x virtualThreadTests -PtestJavaVersion=23
100100

101101
- name: Install Temporal CLI
102102
uses: temporalio/setup-temporal@v0

.github/workflows/prepare-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
- name: Set up Java
9595
uses: actions/setup-java@v5
9696
with:
97-
java-version: "11"
97+
java-version: "23"
9898
distribution: "temurin"
9999

100100
- name: Set up Gradle

.github/workflows/publish-snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Set up Java
3939
uses: actions/setup-java@v5
4040
with:
41-
java-version: '11'
41+
java-version: '23'
4242
distribution: 'temurin'
4343

4444
- name: Set up Gradle

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
This doc is intended for contributors to `sdk-java` (hopefully that's you!)
44

5-
**Note:** All contributors also need to fill out the
6-
[Temporal Contributor License Agreement](https://gist.github.com/samarabbas/7dcd41eb1d847e12263cc961ccfdb197)
5+
**Note:** All contributors also need to fill out the
6+
[Temporal Contributor License Agreement](https://gist.github.com/samarabbas/7dcd41eb1d847e12263cc961ccfdb197)
77
before we can merge in any of your changes
88

99
## Development Environment
1010

11-
* Java 21+
12-
* Docker to run Temporal Server
11+
- Java 23+
12+
- Docker to run Temporal Server
1313

1414
## Build
1515

@@ -31,13 +31,15 @@ commit messages. Read it, follow it, learn it, love it.
3131
## Running features tests in CI
3232

3333
For each PR we run the java tests from the [features repo](https://github.com/temporalio/features/). This requires
34-
your branch to have tags. Without tags, the features tests in CI will fail with a message like
34+
your branch to have tags. Without tags, the features tests in CI will fail with a message like
35+
3536
```
3637
> Configure project :sdk-java
3738
fatal: No names found, cannot describe anything.
3839
```
40+
3941
This can be done resolved by running `git fetch --tags` on your branch. Note, make sure your fork has tags copied from
40-
the main repo.
42+
the main repo.
4143

4244
## Test and Build
4345

@@ -62,6 +64,7 @@ Build with:
6264
```
6365

6466
## Note on Rosetta
67+
6568
Newer Apple Silicon macs do not ship with Rosetta by default, and the version of `protoc-gen-rpc-java` we use (1.34.1) does not ship Apple Silicon binaries.
6669

6770
So Gradle is set to hardcode the download of the x86_64 binaries on MacOS, but this depends on Rosetta to function. Make sure Rosetta is installed with

build.gradle

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
buildscript {
2-
ext {
3-
palantirGitVersionVersion = "${JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11) ? '0.15.0' : '0.13.0'}"
4-
}
5-
}
6-
71
plugins {
82
id 'net.ltgt.errorprone' version '4.1.0' apply false
9-
id 'com.palantir.git-version' version "${palantirGitVersionVersion}" apply false
103
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
114
id 'com.diffplug.spotless' version '7.0.2' apply false
125
id 'com.github.nbaztec.coveralls-jacoco' version "1.2.20" apply false
@@ -79,9 +72,7 @@ ext {
7972

8073
apply from: "$rootDir/gradle/versioning.gradle"
8174
apply from: "$rootDir/gradle/java.gradle"
82-
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
83-
apply from: "$rootDir/gradle/linting.gradle"
84-
}
75+
apply from: "$rootDir/gradle/linting.gradle"
8576
apply from: "$rootDir/gradle/errorprone.gradle"
8677
apply from: "$rootDir/gradle/publishing.gradle"
8778
apply from: "$rootDir/gradle/dependencyManagement.gradle"

gradle/java.gradle

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ subprojects {
1515
compileJava {
1616
options.encoding = 'UTF-8'
1717
options.compilerArgs << '-Xlint:none' << '-Xlint:deprecation' << '-Werror' << '-parameters'
18-
if (JavaVersion.current().isJava9Compatible() && !project.hasProperty("edgeDepsTest") && !project.hasProperty("nativeBuild")) {
18+
if (!project.hasProperty("edgeDepsTest") && !project.hasProperty("nativeBuild")) {
1919
// https://stackoverflow.com/a/43103115/525203
2020
options.compilerArgs.addAll(['--release', '8'])
2121
}
@@ -24,7 +24,7 @@ subprojects {
2424
compileTestJava {
2525
options.encoding = 'UTF-8'
2626
options.compilerArgs << '-Xlint:none' << '-Xlint:deprecation' << '-Werror' << '-parameters'
27-
if (JavaVersion.current().isJava9Compatible() && !project.hasProperty("edgeDepsTest") && !project.hasProperty("nativeBuild")) {
27+
if (!project.hasProperty("edgeDepsTest") && !project.hasProperty("nativeBuild")) {
2828
// https://stackoverflow.com/a/43103115/525203
2929
options.compilerArgs.addAll(['--release', '8'])
3030
}
@@ -34,21 +34,19 @@ subprojects {
3434
options.encoding = 'UTF-8'
3535
options.addStringOption('Xdoclint:reference', '-quiet')
3636
options.addBooleanOption('Werror', true)
37-
if (JavaVersion.current().isJava9Compatible()) {
38-
options.addBooleanOption('html5', true)
39-
}
40-
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_1_9) &&
41-
!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
42-
//https://stackoverflow.com/questions/53732632/gradle-javadoc-search-redirects-to-undefined-url
43-
//the flag is removed in java13: https://bugs.openjdk.java.net/browse/JDK-8215582
44-
options.addBooleanOption('-no-module-directories', true)
45-
}
37+
options.addBooleanOption('html5', true)
4638
}
4739

4840
// add a collection to track failedTests
4941
ext.failedTests = []
5042

5143
test {
44+
if (project.hasProperty("testJavaVersion")) {
45+
javaLauncher = javaToolchains.launcherFor {
46+
languageVersion = JavaLanguageVersion.of(project.property("testJavaVersion") as int)
47+
}
48+
}
49+
5250
testLogging {
5351
events 'passed', 'skipped', 'failed'
5452
exceptionFormat 'full'

mise.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# TIP
2+
#
3+
# For the best SDK development experience, make to hava all of the following
4+
# JDKs installed on your machine (`mise install java@[version]`):
5+
# - `java@temurin-11`
6+
# - `java@temurin-17`
7+
# - `java@temurin-23`
8+
#
9+
# Java 21+ is required for anything that requires gradle.
10+
#
11+
# If you find out that gradle isn't automatically picking it up older JDKs as
12+
# toolchains, see https://mise.jdx.dev/lang/java.html#gradle-toolchains-detection.
13+
14+
[tools]
15+
java = "temurin-23"

temporal-kotlin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tasks.withType(KotlinCompile).all {
1212
kotlinOptions {
1313
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
1414
jvmTarget = project.hasProperty("edgeDepsTest") ? JavaVersion.VERSION_21 : JavaVersion.VERSION_1_8
15-
languageVersion = "${project.hasProperty("edgeDepsTest") ? '1.8' : (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16) ? '1.5' : '1.4')}"
15+
languageVersion = "${project.hasProperty("edgeDepsTest") ? '1.8' : '1.5'}"
1616
}
1717
}
1818

0 commit comments

Comments
 (0)