Skip to content

Comments

chore: use Gradle Java toolchains for the build and test execution#923

Merged
vlsi merged 2 commits intosigstore:mainfrom
vlsi:gr
Mar 11, 2025
Merged

chore: use Gradle Java toolchains for the build and test execution#923
vlsi merged 2 commits intosigstore:mainfrom
vlsi:gr

Conversation

@vlsi
Copy link
Collaborator

@vlsi vlsi commented Mar 6, 2025

Summary

It decouples the build JVM from the test JVM.
By default we use Java 17 for the build and target with --release 11.
Then we vary Java version when running tests.

You could control JDK versions with the following Gradle properties:

  • targetJavaVersion. Java version for source and target compatibility
  • jdkBuildVersion. Defaults to 17. JDK version to use for building $projectName. If the value is 0, then the current Java is used.
  • jdkBuildVendor. JDK vendor to use building
  • jdkBuildImplementation. Vendor-specific virtual machine implementation to use building
  • jdkTestVersion. Defaults to jdkBuildVersion. JDK version to use for testing.
  • jdkTestVendor. Defaults to jdkBuildVendor. JDK vendor to use testing
  • jdkTestImplementation. Defaults to jdkBuildImplementation. Vendor-specific virtual machine implementation to use testing

Release Note

NONE

Documentation

NONE

Signed-off-by: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
@vlsi vlsi force-pushed the gr branch 5 times, most recently from d570201 to 3ab75f6 Compare March 6, 2025 12:18
@vlsi vlsi requested a review from loosebazooka March 6, 2025 12:30
loosebazooka
loosebazooka previously approved these changes Mar 7, 2025
It enables decoupling of the build JVM vs test JVM.
By default we use Java 17 for the build and target with --release 11.
Then we vary Java version when running tests

Signed-off-by: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
# if you need to skip staging due to flakiness use "-PskipStaging"
- name: Test sigstore-java
run: ./gradlew build
run: ./gradlew build -Porg.gradle.java.installations.auto-download=false -PjdkTestVersion=${{ matrix.java-version }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loosebazooka , here's how we execute tests with a given Java version even though we always build with Java 17

@vlsi vlsi requested a review from loosebazooka March 7, 2025 18:08
@loosebazooka
Copy link
Member

I think you cam merge when ready without examples. I'm working on fixing examples for external contributors using the conformance token.

@vlsi vlsi merged commit 729565b into sigstore:main Mar 11, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants