chore(java11): Compile with Java 11 (but targeting Java 8)
MODIFY
.github/workflows/build.yml
.github/workflows/build.yml
@@ -11,12 +11,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
+ # Install Java 8 for cross-compilation support. Setting it up before
+ # Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
- name: Build
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: ./gradlew -PenablePublishing=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" build snapshot --stacktrace
+ run: ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" build snapshot --stacktrace

MODIFY
.github/workflows/pr.yml
.github/workflows/pr.yml
@@ -7,9 +7,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
+ # Install Java 8 for cross-compilation support. Setting it up before
+ # Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
- uses: actions/cache@v1
with:
path: ~/.gradle

MODIFY
.github/workflows/release.yml
.github/workflows/release.yml
@@ -12,9 +12,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
+ # Install Java 8 for cross-compilation support. Setting it up before
+ # Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
- name: Assemble release info
id: release_info
env:
@@ -31,7 +36,7 @@ jobs:
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
run: |
- ./gradlew -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" candidate
+ ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" candidate
- name: Release build
if: steps.release_info.outputs.IS_CANDIDATE == 'false'
env:
@@ -39,7 +44,7 @@ jobs:
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
run: |
- ./gradlew -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" final
+ ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" final
- name: Create release
if: steps.release_info.outputs.SKIP_RELEASE == 'false'
uses: actions/create-release@v1

MODIFY
Dockerfile.compile
Dockerfile.compile
-FROM openjdk:8
+FROM alpine:3.11
+RUN apk add --update \
+ openjdk11 \
+ openjdk8 \
+ && rm -rf /var/cache/apk
MAINTAINER sig-platform@spinnaker.io
+ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
+ENV JDK_18 /usr/lib/jvm/java-1.8-openjdk
ENV GRADLE_USER_HOME /workspace/.gradle
-ENV GRADLE_OPTS -Xmx2048m
+ENV GRADLE_OPTS -Xmx4g
CMD ./gradlew gate-web:installDist -x test

MODIFY
gradle.properties
gradle.properties
fiatVersion=1.17.7
enablePublishing=false
korkVersion=7.29.0
-spinnakerGradleVersion=7.0.1
+spinnakerGradleVersion=7.8.0
org.gradle.parallel=true
includeProviders=basic,iap,ldap,oauth2,saml,x509

chore(java11): Compile with Java 11 (but targeting Java 8) (#1118)