Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(java17): compile with JDK17 targeting Java 11 bytecode #1198

Merged
merged 3 commits into from Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -26,8 +26,8 @@ jobs:
- uses: actions/setup-java@v4
with:
java-version: |
17
11
17
mattgogerly marked this conversation as resolved.
Show resolved Hide resolved
distribution: 'zulu'
cache: 'gradle'
- name: Prepare build variables
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Build
env:
ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }}
run: ./gradlew build --stacktrace ${{ steps.build_variables.outputs.REPO }}-web:installDist
run: ./gradlew -PenableCrossCompilerPlugin=true build --stacktrace ${{ steps.build_variables.outputs.REPO }}-web:installDist
- name: Login to GAR
# Only run this on repositories in the 'spinnaker' org, not on forks.
if: startsWith(github.repository, 'spinnaker/')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Expand Up @@ -20,8 +20,8 @@ jobs:
- uses: actions/setup-java@v4
with:
java-version: |
17
11
17
distribution: 'zulu'
cache: 'gradle'
- name: Prepare build variables
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Build
env:
ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }}
run: ./gradlew build ${{ steps.build_variables.outputs.REPO }}-web:installDist
run: ./gradlew -PenableCrossCompilerPlugin=true build ${{ steps.build_variables.outputs.REPO }}-web:installDist
- name: Build slim container image
uses: docker/build-push-action@v5
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Expand Up @@ -24,8 +24,8 @@ jobs:
- uses: actions/setup-java@v4
with:
java-version: |
17
11
17
distribution: 'zulu'
cache: 'gradle'
- name: Assemble release info
Expand All @@ -52,14 +52,14 @@ jobs:
ORG_GRADLE_PROJECT_nexusPgpSigningKey: ${{ secrets.NEXUS_PGP_SIGNING_KEY }}
ORG_GRADLE_PROJECT_nexusPgpSigningPassword: ${{ secrets.NEXUS_PGP_SIGNING_PASSWORD }}
run: |
./gradlew --info build ${{ steps.build_variables.outputs.REPO }}-web:installDist publishToNexus closeAndReleaseNexusStagingRepository
./gradlew --info -PenableCrossCompilerPlugin=true build ${{ steps.build_variables.outputs.REPO }}-web:installDist publishToNexus closeAndReleaseNexusStagingRepository
- name: Publish apt packages to Google Artifact Registry
env:
ORG_GRADLE_PROJECT_version: ${{ steps.release_info.outputs.RELEASE_VERSION }}
ORG_GRADLE_PROJECT_artifactRegistryPublishEnabled: true
GAR_JSON_KEY: ${{ secrets.GAR_JSON_KEY }}
run: |
./gradlew --info publish
./gradlew --info -PenableCrossCompilerPlugin=true publish
- name: Login to Google Cloud
# Only run this on repositories in the 'spinnaker' org, not on forks.
if: startsWith(github.repository, 'spinnaker/')
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.compile
Expand Up @@ -5,4 +5,4 @@ RUN apt-get update && apt-get install -y \
LABEL maintainer="sig-platform@spinnaker.io"
ENV GRADLE_USER_HOME /workspace/.gradle
ENV GRADLE_OPTS -Xmx4g
CMD ./gradlew --no-daemon igor-web:installDist -x test
CMD ./gradlew --no-daemon -PenableCrossCompilerPlugin=true igor-web:installDist -x test
11 changes: 0 additions & 11 deletions build.gradle
Expand Up @@ -73,17 +73,6 @@ subprojects {
useJUnitPlatform()
}

tasks.withType(JavaCompile).configureEach {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(11)
}
}
tasks.withType(Test).configureEach {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
}

tasks.withType(JavaExec) {
if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8188'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -2,7 +2,7 @@ fiatVersion=1.44.0
korkVersion=7.221.0
org.gradle.parallel=true
spinnakerGradleVersion=8.32.1
targetJava11=true
targetJava17=false

# To enable a composite reference to a project, set the
# project property `'<projectName>Composite=true'`.
Expand Down