From 5ee3c70588dc851340f096698811a19a62806874 Mon Sep 17 00:00:00 2001 From: David Byron Date: Wed, 12 Jun 2024 19:27:06 -0700 Subject: [PATCH] Revert "chore(build): enable cross compilation plugin for Java 17 (#4738)" This reverts commit f936de542bd1a347b5eb39929d4c84bd8ec21ff6. since $ ./gradlew -PenableCrossCompilerPlugin=true clean orca-api:dokkaJavadoc fails --- .github/workflows/build.yml | 4 ++-- .github/workflows/pr.yml | 4 ++-- .github/workflows/release.yml | 6 +++--- Dockerfile.compile | 16 ++++++++-------- build.gradle | 11 +++++++++++ gradle.properties | 2 +- orca-api/orca-api.gradle | 4 ++-- 7 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f9b8f5a0c..f77598c899 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,8 @@ jobs: - uses: actions/setup-java@v4 with: java-version: | - 11 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Prepare build variables @@ -38,7 +38,7 @@ jobs: - name: Build env: ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} - run: ./gradlew -PenableCrossCompilerPlugin=true build --stacktrace ${{ steps.build_variables.outputs.REPO }}-web:installDist + run: ./gradlew build --stacktrace ${{ steps.build_variables.outputs.REPO }}-web:installDist - name: Build local slim container image for testing uses: docker/build-push-action@v5 with: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 82ac8011c9..6574b215e8 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,8 +20,8 @@ jobs: - uses: actions/setup-java@v4 with: java-version: | - 11 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Prepare build variables @@ -32,7 +32,7 @@ jobs: - name: Build env: ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} - run: ./gradlew -PenableCrossCompilerPlugin=true build ${{ steps.build_variables.outputs.REPO }}-web:installDist + run: ./gradlew build ${{ steps.build_variables.outputs.REPO }}-web:installDist - name: Build slim container image uses: docker/build-push-action@v5 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25552fab4d..6da9c14730 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,8 +44,8 @@ jobs: - uses: actions/setup-java@v4 with: java-version: | - 11 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Assemble release info @@ -72,14 +72,14 @@ jobs: ORG_GRADLE_PROJECT_nexusPgpSigningKey: ${{ secrets.NEXUS_PGP_SIGNING_KEY }} ORG_GRADLE_PROJECT_nexusPgpSigningPassword: ${{ secrets.NEXUS_PGP_SIGNING_PASSWORD }} run: | - ./gradlew -PenableCrossCompilerPlugin=true --info build ${{ steps.build_variables.outputs.REPO }}-web:installDist publishToNexus closeAndReleaseNexusStagingRepository + ./gradlew --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 -PenableCrossCompilerPlugin=true --info publish + ./gradlew --info publish - name: Login to Google Cloud # Only run this on repositories in the 'spinnaker' org, not on forks. if: startsWith(github.repository, 'spinnaker/') diff --git a/Dockerfile.compile b/Dockerfile.compile index 80913ca3a0..261aacc931 100644 --- a/Dockerfile.compile +++ b/Dockerfile.compile @@ -1,8 +1,8 @@ -FROM ubuntu:bionic -RUN apt-get update && apt-get install -y \ - openjdk-11-jdk \ - && rm -rf /var/lib/apt/lists/* -LABEL maintainer="sig-platform@spinnaker.io" -ENV GRADLE_USER_HOME /workspace/.gradle -ENV GRADLE_OPTS -Xmx6g -CMD ./gradlew -PenableCrossCompilerPlugin=true --no-daemon orca-web:installDist -x test +FROM ubuntu:bionic +RUN apt-get update && apt-get install -y \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* +LABEL maintainer="sig-platform@spinnaker.io" +ENV GRADLE_USER_HOME /workspace/.gradle +ENV GRADLE_OPTS -Xmx6g +CMD ./gradlew --no-daemon orca-web:installDist -x test diff --git a/build.gradle b/build.gradle index d7f711e90a..05b12f1d16 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,17 @@ allprojects { group = "io.spinnaker.orca" + 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=8183' diff --git a/gradle.properties b/gradle.properties index c861df97d1..8bb87f07ed 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlinVersion=1.6.21 org.gradle.parallel=true org.gradle.jvmargs=-Xmx6g spinnakerGradleVersion=8.32.1 -targetJava17=false +targetJava11=true # To enable a composite reference to a project, set the # project property `'Composite=true'`. diff --git a/orca-api/orca-api.gradle b/orca-api/orca-api.gradle index 9a13bba21a..a644afa4be 100644 --- a/orca-api/orca-api.gradle +++ b/orca-api/orca-api.gradle @@ -15,7 +15,7 @@ */ plugins { - id("net.ltgt.errorprone") version "4.0.0" + id("net.ltgt.errorprone") version "1.2.1" } apply from: "$rootDir/gradle/kotlin.gradle" @@ -28,7 +28,7 @@ sourceSets { } dependencies { - errorprone("com.google.errorprone:error_prone_core:2.28.0") + errorprone("com.google.errorprone:error_prone_core:2.4.0") implementation platform("io.spinnaker.kork:kork-bom:$korkVersion") annotationProcessor platform("io.spinnaker.kork:kork-bom:$korkVersion")