Skip to content

Commit

Permalink
build(gradle)!: Build with Java 21
Browse files Browse the repository at this point in the history
As fcfab20 decoupled the Java version to use for analysis of Gradle
projects from the Java version running ORT, finally update the Java
version from 11 / 17 to 21. See [1] for context.

Also stop using the deprecated `Thread.id` in favor of `Thread.threadId()`
and ensure to run with Java 21 when generating completion scripts.

[1]: #8249

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Oct 3, 2024
1 parent e34734a commit ab39b4d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Java
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
- name: Generate completions
Expand Down
2 changes: 1 addition & 1 deletion docker/versions.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ARG DART_VERSION=2.18.4
ARG DOTNET_VERSION=6.0
ARG GO_VERSION=1.23.0
ARG HASKELL_STACK_VERSION=2.13.1
ARG JAVA_VERSION=17
ARG JAVA_VERSION=21
ARG LICENSEE_VERSION=9.15.3
ARG NODEJS_VERSION=20.14.0
ARG NPM_VERSION=10.8.3
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ksp.useKSP2 = true

# The version of the JDK to use for building ORT.
# Keep this aligned with `toolchainVersion` in `gradle/gradle-daemon-jvm.properties`.
javaLanguageVersion = 11
javaLanguageVersion = 21

# The version of the SPDX license list which is used to import license texts and generate SPDX enums. Must be a valid
# tag, see https://github.com/spdx/license-list-data/tags.
Expand Down
2 changes: 1 addition & 1 deletion gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The version of the JDK to use for building ORT.
# Keep this aligned with `javaLanguageVersion` in `gradle.properties`.
toolchainVersion = 11
toolchainVersion = 21
toolchainVendor = Adoptium
2 changes: 1 addition & 1 deletion plugins/scanners/scanoss/src/main/kotlin/ScanOss.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ScanOss internal constructor(
val result = service.scan(
wfpString,
context.labels["scanOssContext"],
context.labels["scanOssId"]?.toIntOrNull() ?: Thread.currentThread().id.toInt()
context.labels["scanOssId"]?.toIntOrNull() ?: Thread.currentThread().threadId().toInt()
)

// Replace the anonymized UUIDs by their file paths.
Expand Down

0 comments on commit ab39b4d

Please sign in to comment.