Skip to content

Commit

Permalink
chore(build): enable cross compilation plugin for Java 17 (#1040)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mattgogerly and mergify[bot] authored Jun 13, 2024
1 parent bf94a08 commit 29d1bf1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- uses: actions/setup-java@v4
with:
java-version: |
17
11
17
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: Build local slim container image for testing
uses: docker/build-push-action@v5
with:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
java-version: |
11
17
distribution: 'zulu'
cache: 'gradle'

Expand All @@ -53,8 +55,8 @@ jobs:
uses: actions/setup-java@v4
with:
java-version: |
17
11
17
distribution: 'zulu'
cache: 'gradle'

Expand All @@ -75,8 +77,8 @@ jobs:
- uses: actions/setup-java@v4
with:
java-version: |
17
11
17
distribution: 'zulu'
cache: 'gradle'
- name: Prepare build variables
Expand All @@ -87,7 +89,7 @@ jobs:
- name: Build
env:
ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }}
run: ./gradlew build ${{ steps.build_variables.outputs.REPO }}-web:installDist $GRADLE_ARGS
run: ./gradlew -PenableCrossCompilerPlugin=true build ${{ steps.build_variables.outputs.REPO }}-web:installDist $GRADLE_ARGS

- name: Build slim container image
uses: docker/build-push-action@v5
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
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 -PenableCrossCompilerPlugin=true --info 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 -PenableCrossCompilerPlugin=true --info 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
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN apk add --update \
LABEL maintainer="[email protected]"
ENV GRADLE_USER_HOME /workspace/.gradle
ENV GRADLE_OPTS -Xmx4g
CMD ./gradlew --no-daemon kayenta-web:installDist -x test
CMD ./gradlew -PenableCrossCompilerPlugin=true --no-daemon kayenta-web:installDist -x test
11 changes: 0 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,6 @@ subprojects { project ->
}
}

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

configurations.all {
exclude group: 'org.mortbay.jetty', module: 'servlet-api'
exclude group: 'javax.servlet', module: 'servlet-api'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
orcaVersion=8.53.0
org.gradle.parallel=true
spinnakerGradleVersion=8.32.1
targetJava11=true
targetJava17=false
org.gradle.jvmargs=-Xmx2g

0 comments on commit 29d1bf1

Please sign in to comment.