Skip to content

Commit 0fbfec4

Browse files
Merge remote-tracking branch 'origin/master' into d/20260406-164203
# Conflicts: # .github/workflows/prepare-release.yml # .github/workflows/publish-snapshot.yml # gradle/java.gradle
2 parents 88910d6 + b6f4283 commit 0fbfec4

13 files changed

Lines changed: 65 additions & 119 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 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
@@ -75,8 +75,8 @@ jobs:
7575
uses: actions/setup-java@v5
7676
with:
7777
java-version: |
78-
23
7978
11
79+
23
8080
distribution: "temurin"
8181

8282
- name: Set up Gradle
@@ -113,25 +113,29 @@ jobs:
113113
--dynamic-config-value 'component.callbacks.allowedAddresses=[{"Pattern":"localhost:7243","AllowInsecure":true}]' &
114114
sleep 10s
115115
116-
- name: Run unit tests
116+
# Can't actually run tests against Java 8 because Mockito 5 requires Java 11+.
117+
# We therefore have to rely on the fact that the code has been compiled with
118+
# `-release 8` which guarantees that the code is technically (bytecode + API
119+
# usage) compatible with Java 8.
120+
- name: Run unit tests (Java 11)
117121
env:
118122
USER: unittest
119123
TEMPORAL_SERVICE_ADDRESS: localhost:7233
120124
USE_DOCKER_SERVICE: true
121-
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava
125+
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=11
122126

123-
- name: Run Jackson 3 converter tests
127+
- name: Run Jackson 3 converter tests (Java 17)
124128
env:
125129
USER: unittest
126130
USE_DOCKER_SERVICE: false
127-
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava
131+
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=17
128132

129-
- name: Run virtual thread tests
133+
- name: Run virtual thread tests (Java 21)
130134
env:
131135
USER: unittest
132136
TEMPORAL_SERVICE_ADDRESS: localhost:7233
133137
USE_DOCKER_SERVICE: true
134-
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava
138+
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=21
135139

136140
- name: Publish Test Report
137141
uses: mikepenz/action-junit-report@v6
@@ -154,7 +158,7 @@ jobs:
154158
- name: Set up Java
155159
uses: actions/setup-java@v5
156160
with:
157-
java-version: "11"
161+
java-version: "23"
158162
distribution: "temurin"
159163

160164
- 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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ jobs:
9494
- name: Set up Java
9595
uses: actions/setup-java@v5
9696
with:
97-
# JDK 17 is required for temporal-spring-ai's Gradle toolchain (Spring AI requires Java 17+).
98-
# The primary publish JVM remains JDK 11 (listed last so it's the default JAVA_HOME).
99-
java-version: |
100-
17
101-
11
97+
java-version: "23"
10298
distribution: "temurin"
10399

104100
- name: Set up Gradle

.github/workflows/publish-snapshot.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ jobs:
3838
- name: Set up Java
3939
uses: actions/setup-java@v5
4040
with:
41-
# JDK 17 is required for temporal-spring-ai's Gradle toolchain (Spring AI requires Java 17+).
42-
# The primary publish JVM remains JDK 11 (listed last so it's the default JAVA_HOME).
43-
java-version: |
44-
17
45-
11
41+
java-version: '23'
4642
distribution: 'temurin'
4743

4844
- 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 & 16 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,26 +34,19 @@ subprojects {
3434
options.encoding = 'UTF-8'
3535
options.addStringOption('Xdoclint:reference', '-quiet')
3636
options.addBooleanOption('Werror', true)
37-
// Base flag decisions on the javadoc tool that will actually run, not the Gradle JVM.
38-
// Modules that override javadocTool via toolchains (e.g. temporal-spring-ai on JDK 11)
39-
// would otherwise get flags that don't apply to the tool being invoked.
40-
doFirst {
41-
int toolVersion = javadocTool.get().metadata.languageVersion.asInt()
42-
if (toolVersion >= 9) {
43-
options.addBooleanOption('html5', true)
44-
}
45-
if (toolVersion >= 9 && toolVersion < 13) {
46-
//https://stackoverflow.com/questions/53732632/gradle-javadoc-search-redirects-to-undefined-url
47-
//the flag is removed in java13: https://bugs.openjdk.java.net/browse/JDK-8215582
48-
options.addBooleanOption('-no-module-directories', true)
49-
}
50-
}
37+
options.addBooleanOption('html5', true)
5138
}
5239

5340
// add a collection to track failedTests
5441
ext.failedTests = []
5542

5643
test {
44+
if (project.hasProperty("testJavaVersion")) {
45+
javaLauncher = javaToolchains.launcherFor {
46+
languageVersion = JavaLanguageVersion.of(project.property("testJavaVersion") as int)
47+
}
48+
}
49+
5750
testLogging {
5851
events 'passed', 'skipped', 'failed'
5952
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)