From dd29d4cba5359f3f3094b73448386467d8a30379 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 29 Apr 2022 08:30:23 +0100 Subject: [PATCH 1/7] Excavator: Render CircleCI file using template specified in .circleci/template.sh (#4) --- .circleci/config.yml | 107 +++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 66 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f63a269e..047f6157 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,8 @@ version: 2.1 jobs: - compile: + + check: docker: [{ image: 'cimg/openjdk:11.0.10-node' }] resource_class: large environment: @@ -38,58 +39,17 @@ jobs: echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]" echo "$TAGS_TO_DELETE" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done - - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - - restore_cache: { key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - - run: ./gradlew --parallel --stacktrace classes testClasses -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME - - save_cache: - key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' - paths: [ ~/.gradle/wrapper ] - - save_cache: - key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' - paths: [ ~/.gradle/caches ] - - store_test_results: { path: ~/junit } - - store_artifacts: { path: ~/artifacts } + - restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } + - restore_cache: { key: 'check-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } + - run: ./gradlew --parallel --stacktrace --continue --max-workers=2 check idea -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME - persist_to_workspace: root: /home/circleci - paths: [ project, .gradle/init.gradle ] - - check: - docker: [{ image: 'cimg/openjdk:11.0.10-node' }] - resource_class: medium - environment: - CIRCLE_TEST_REPORTS: /home/circleci/junit - CIRCLE_ARTIFACTS: /home/circleci/artifacts - GRADLE_OPTS: -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' - _JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts - steps: - - attach_workspace: { at: /home/circleci } - - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - - restore_cache: { key: 'check-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - - run: ./gradlew --parallel --stacktrace --continue check idea -x test -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME + paths: [ project ] - save_cache: - key: 'check-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' - paths: [ ~/.gradle/caches ] - - run: - command: mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \; - when: always - - store_test_results: { path: ~/junit } - - store_artifacts: { path: ~/artifacts } - - unit-test: - docker: [{ image: 'cimg/openjdk:11.0.10-node' }] - resource_class: large - environment: - CIRCLE_TEST_REPORTS: /home/circleci/junit - CIRCLE_ARTIFACTS: /home/circleci/artifacts - GRADLE_OPTS: -Dorg.gradle.workers.max=2 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' - _JAVA_OPTIONS: -XX:ActiveProcessorCount=4 -XX:MaxRAM=8g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts - steps: - - attach_workspace: { at: /home/circleci } - - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - - restore_cache: { key: 'unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - - run: ./gradlew --parallel --stacktrace --continue --max-workers=2 test -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME + key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' + paths: [ ~/.gradle/wrapper ] - save_cache: - key: 'unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' + key: 'check-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' paths: [ ~/.gradle/caches ] - run: command: mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \; @@ -106,15 +66,39 @@ jobs: GRADLE_OPTS: -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' _JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts steps: - - attach_workspace: { at: /home/circleci } - - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - - restore_cache: { key: 'trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } + - checkout + - run: + name: delete_unrelated_tags + command: | + ALL_TAGS=$(git tag --points-at HEAD) + + if [ -z "$ALL_TAGS" ]; then + echo "No-op as there are no tags on the current commit ($(git rev-parse HEAD))" + exit 0 + fi + + if [ -z "${CIRCLE_TAG:+x}" ]; then + echo "Non-tag build, deleting all tags which point to HEAD: [${ALL_TAGS/$'\n'/,}]" + echo "$ALL_TAGS" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done + exit 0 + fi + + TAGS_TO_DELETE=$(echo "$ALL_TAGS" | grep -v "^$CIRCLE_TAG$" || :) + if [ -z "$TAGS_TO_DELETE" ]; then + echo "No-op as exactly one tag ($CIRCLE_TAG) points to HEAD" + exit 0 + fi + + echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]" + echo "$TAGS_TO_DELETE" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done + - restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } + - restore_cache: { key: 'trial-publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - run: ./gradlew --stacktrace publishToMavenLocal -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME - run: command: git status --porcelain when: always - save_cache: - key: 'trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' + key: 'trial-publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' paths: [ ~/.gradle/caches ] - store_test_results: { path: ~/junit } - store_artifacts: { path: ~/artifacts } @@ -129,15 +113,15 @@ jobs: _JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts steps: - attach_workspace: { at: /home/circleci } - - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - - restore_cache: { key: 'publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } + - restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } + - restore_cache: { key: 'publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - deploy: command: ./gradlew --parallel --stacktrace --continue publish -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME - run: command: git status --porcelain when: always - save_cache: - key: 'publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' + key: 'publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' paths: [ ~/.gradle/caches ] - store_test_results: { path: ~/junit } - store_artifacts: { path: ~/artifacts } @@ -147,21 +131,12 @@ workflows: version: 2 build: jobs: - - compile: - filters: { tags: { only: /.*/ } } - - - unit-test: - requires: [ compile ] - filters: { tags: { only: /.*/ } } - - check: - requires: [ compile ] filters: { tags: { only: /.*/ } } - trial-publish: - requires: [ compile ] filters: { branches: { ignore: develop } } - publish: - requires: [ unit-test, check, trial-publish ] + requires: [ check, trial-publish ] filters: { tags: { only: /.*/ }, branches: { only: develop } } From 5ab08a39753d56c8beac7d8cdba9620212603091 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 29 Apr 2022 08:57:58 +0100 Subject: [PATCH 2/7] Excavator: Upgrade buildscript dependencies (#5) --- build.gradle | 4 ++-- versions.lock | 30 +++++++----------------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index 8b4512ab..d79f4e5a 100644 --- a/build.gradle +++ b/build.gradle @@ -7,9 +7,9 @@ buildscript { dependencies { classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.11.0' classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.22.0' - classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.7.0' + classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.10.0' classpath 'com.palantir.baseline:gradle-baseline-java:4.111.0' - classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.13.0' + classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.15.0' classpath 'gradle.plugin.org.inferred:gradle-processors:3.6.0' classpath 'com.gradle.publish:plugin-publish-plugin:0.21.0' } diff --git a/versions.lock b/versions.lock index bdafb92c..6f377451 100644 --- a/versions.lock +++ b/versions.lock @@ -12,26 +12,16 @@ com.diffplug.spotless:spotless-lib-extra:2.25.1 (1 constraints: 4a132141) com.diffplug.spotless:spotless-plugin-gradle:6.5.1 (1 constraints: c5111ef5) com.fasterxml.jackson:jackson-bom:2.13.2 (1 constraints: ff13bf65) com.fasterxml.jackson.core:jackson-annotations:2.13.2 (2 constraints: f1138182) -com.github.ben-manes.caffeine:caffeine:3.0.5 (2 constraints: a324e8d3) -com.github.kevinstern:software-and-algorithms:1.0 (1 constraints: 7e12fcf5) -com.google.auto:auto-common:1.2.1 (1 constraints: f1101fb8) -com.google.auto.service:auto-service-annotations:1.0.1 (1 constraints: ef1019b8) -com.google.auto.value:auto-value-annotations:1.9 (2 constraints: 1f2344ce) -com.google.code.findbugs:jsr305:3.0.2 (4 constraints: ed328c19) -com.google.errorprone:error_prone_annotation:2.13.1 (2 constraints: 35246d8b) -com.google.errorprone:error_prone_annotations:2.13.1 (5 constraints: d74327d0) -com.google.errorprone:error_prone_check_api:2.13.1 (1 constraints: 24114cc9) -com.google.errorprone:error_prone_core:2.13.1 (2 constraints: 1220651d) -com.google.errorprone:error_prone_type_annotations:2.13.1 (1 constraints: 24114cc9) +com.github.ben-manes.caffeine:caffeine:3.0.5 (1 constraints: c11104f5) +com.google.code.findbugs:jsr305:3.0.2 (2 constraints: 1d0fb186) +com.google.errorprone:error_prone_annotations:2.11.0 (3 constraints: a31fc64f) com.google.guava:failureaccess:1.0.1 (1 constraints: 140ae1b4) -com.google.guava:guava:31.1-jre (7 constraints: bc880425) +com.google.guava:guava:31.1-jre (4 constraints: 5853cf0d) com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (1 constraints: bd17c918) com.google.j2objc:j2objc-annotations:1.3 (1 constraints: b809eda0) -com.google.protobuf:protobuf-java:3.19.2 (1 constraints: 2c1165c9) com.googlecode.concurrent-trees:concurrent-trees:2.6.1 (1 constraints: 761166da) com.googlecode.java-diff-utils:diffutils:1.3.0 (1 constraints: bd11fef4) com.googlecode.javaewah:JavaEWAH:1.1.12 (1 constraints: 750eee5e) -com.palantir.baseline:baseline-error-prone:4.119.0 (1 constraints: 6905ab40) com.palantir.baseline:gradle-baseline-java:4.119.0 (1 constraints: 7105c340) com.palantir.baseline:gradle-junit-reports:4.119.0 (1 constraints: 28124519) com.palantir.javaformat:gradle-palantir-java-format:1.1.0 (1 constraints: bb11f8f4) @@ -40,10 +30,7 @@ com.squareup.okhttp3:okhttp:4.3.1 (1 constraints: bf0b0dea) com.squareup.okio:okio:2.4.3 (2 constraints: 10183f8e) commons-io:commons-io:2.11.0 (2 constraints: 1e20060b) commons-lang:commons-lang:2.6 (1 constraints: 6311bad1) -io.github.java-diff-utils:java-diff-utils:4.0 (1 constraints: 811205f6) junit:junit:4.13 (2 constraints: cc20d042) -net.bytebuddy:byte-buddy:1.12.9 (2 constraints: db1849db) -net.bytebuddy:byte-buddy-agent:1.12.9 (1 constraints: 470b41de) net.ltgt.gradle:gradle-errorprone-plugin:2.0.2 (1 constraints: bd11fcf4) org.apache.commons:commons-lang3:3.12.0 (1 constraints: ef110607) org.apache.maven:maven-artifact:2.0.5 (3 constraints: 5032579f) @@ -56,13 +43,12 @@ org.apache.maven:maven-settings:2.0.5 (1 constraints: 310dcb20) org.apache.maven.shared:maven-dependency-analyzer:1.12.0 (1 constraints: ed11fa06) org.apache.maven.wagon:wagon-provider-api:1.0-beta-2 (1 constraints: 54120e10) org.checkerframework:checker-qual:3.21.4 (3 constraints: b51f1e53) -org.checkerframework:dataflow-errorprone:3.21.4 (3 constraints: 6436b1f1) org.codehaus.groovy:groovy:3.0.9 (3 constraints: b52813bc) org.codehaus.groovy:groovy-xml:3.0.9 (1 constraints: 791161da) org.codehaus.plexus:plexus-component-annotations:2.1.1 (1 constraints: 8e142c84) org.codehaus.plexus:plexus-container-default:1.0-alpha-9 (4 constraints: 6841d5d5) org.codehaus.plexus:plexus-utils:1.5.1 (10 constraints: a99af4e0) -org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r (3 constraints: a43f6e15) +org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r (2 constraints: 562b9625) org.eclipse.platform:org.eclipse.osgi:3.15.0 (2 constraints: c724e4f0) org.eclipse.platform:org.eclipse.osgi.compatibility.state:1.1.600 (1 constraints: 1f0c1a02) org.hamcrest:hamcrest-core:1.3 (1 constraints: cc05fe3f) @@ -70,9 +56,6 @@ org.immutables:value:2.8.8 (1 constraints: 14051536) org.jetbrains:annotations:19.0.0 (2 constraints: 441cf8cc) org.jetbrains.kotlin:kotlin-stdlib:1.3.61 (2 constraints: 0617a55e) org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61 (2 constraints: c5196a0d) -org.mockito:mockito-core:4.5.1 (1 constraints: b90d452d) -org.mockito:mockito-errorprone:4.5.1 (1 constraints: 00120ff9) -org.objenesis:objenesis:3.2 (3 constraints: 6b2483ae) org.osgi:org.osgi.dto:1.0.0 (1 constraints: b40ca816) org.osgi:org.osgi.framework:1.8.0 (1 constraints: bc0cc016) org.osgi:org.osgi.resource:1.0.0 (1 constraints: b40ca816) @@ -83,12 +66,12 @@ org.osgi:org.osgi.util.promise:1.2.0 (1 constraints: b60cae16) org.osgi:org.osgi.util.tracker:1.5.4 (1 constraints: bd0cbb16) org.osgi:osgi.annotation:8.0.1 (3 constraints: 1e2894a6) org.ow2.asm:asm:9.3 (3 constraints: 7332e84a) -org.pcollections:pcollections:3.1.4 (1 constraints: f51029b8) org.slf4j:slf4j-api:1.7.30 (2 constraints: 6c1b52af) [Test dependencies] cglib:cglib-nodep:3.3.0 (2 constraints: 7a1acf3c) com.netflix.nebula:nebula-test:10.1.0 (1 constraints: 34052a3b) +net.bytebuddy:byte-buddy:1.10.16 (1 constraints: 950dfa39) org.assertj:assertj-core:3.22.0 (2 constraints: 65174647) org.hamcrest:hamcrest:2.2 (1 constraints: d20cdc04) org.junit:junit-bom:5.8.2 (10 constraints: c7a1fdc6) @@ -100,6 +83,7 @@ org.junit.platform:junit-platform-commons:1.8.2 (3 constraints: ee29ed2b) org.junit.platform:junit-platform-engine:1.8.2 (3 constraints: 062cdf16) org.junit.platform:junit-platform-launcher:1.8.2 (2 constraints: 121b944a) org.junit.platform:junit-platform-testkit:1.8.2 (1 constraints: 12097995) +org.objenesis:objenesis:3.1 (2 constraints: bb193de0) org.opentest4j:opentest4j:1.2.0 (3 constraints: c53224a1) org.spockframework:spock-core:2.0-M4-groovy-3.0 (2 constraints: e822d65a) org.spockframework:spock-junit4:2.0-M4-groovy-3.0 (1 constraints: 25115ddf) From 31cfdcd9a99914e0dc30feec2262d27bf5190f7b Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 29 Apr 2022 09:29:28 +0100 Subject: [PATCH 3/7] Excavator: Format Java files (#6) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d79f4e5a..d9bcfd8f 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { dependencies { classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.11.0' - classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.22.0' + classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.24.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.10.0' classpath 'com.palantir.baseline:gradle-baseline-java:4.111.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.15.0' From 880068941299921a875fe7cfebf46f397eb94655 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 29 Apr 2022 10:42:32 +0100 Subject: [PATCH 4/7] Excavator: Upgrades Baseline to the latest version (#7) --- .baseline/copyright/999_palantir.txt | 1 - build.gradle | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 .baseline/copyright/999_palantir.txt diff --git a/.baseline/copyright/999_palantir.txt b/.baseline/copyright/999_palantir.txt deleted file mode 100644 index 2f090b19..00000000 --- a/.baseline/copyright/999_palantir.txt +++ /dev/null @@ -1 +0,0 @@ -(c) Copyright ${today.year} Palantir Technologies Inc. All rights reserved. diff --git a/build.gradle b/build.gradle index d9bcfd8f..f255eaf9 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.11.0' classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.24.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.10.0' - classpath 'com.palantir.baseline:gradle-baseline-java:4.111.0' + classpath 'com.palantir.baseline:gradle-baseline-java:4.121.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.15.0' classpath 'gradle.plugin.org.inferred:gradle-processors:3.6.0' classpath 'com.gradle.publish:plugin-publish-plugin:0.21.0' From 73056a9facc55353a711cbdf0446cadf1c8a6fe3 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 29 Apr 2022 11:18:38 +0100 Subject: [PATCH 5/7] Excavator: Upgrade gradle wrapper to the latest version (#8) --- gradlew.bat | 178 ++++++++++++++++++++++++++-------------------------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/gradlew.bat b/gradlew.bat index 107acd32..ac1b06f9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From f57156a801d2d885ad0d89a6b99d25548d07f6ef Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Fri, 29 Apr 2022 17:44:59 +0100 Subject: [PATCH 6/7] Fix formatting --- .../palantir/gradle/jdks/JdkDistributionName.java | 12 ++++++++++++ .../com/palantir/gradle/jdks/ZuluVersionUtils.java | 12 ++++++++++++ .../gradle/jdks/JdkDistributionNameTest.java | 12 ++++++++++++ .../gradle/jdks/AmazonCorrettoJdkDistribution.java | 12 ++++++++++++ .../gradle/jdks/AzulZuluJdkDistribution.java | 12 ++++++++++++ .../java/com/palantir/gradle/jdks/ConfigureUtil.java | 12 ++++++++++++ .../jdks/GradleJdksJavaInstallationMetadata.java | 12 ++++++++++++ .../com/palantir/gradle/jdks/JdkDistribution.java | 12 ++++++++++++ .../gradle/jdks/JdkDistributionExtension.java | 12 ++++++++++++ .../com/palantir/gradle/jdks/JdkDistributions.java | 12 ++++++++++++ .../java/com/palantir/gradle/jdks/JdkDownloader.java | 12 ++++++++++++ .../com/palantir/gradle/jdks/JdkDownloaders.java | 12 ++++++++++++ .../java/com/palantir/gradle/jdks/JdkExtension.java | 12 ++++++++++++ .../java/com/palantir/gradle/jdks/JdkManager.java | 12 ++++++++++++ .../main/java/com/palantir/gradle/jdks/JdkPath.java | 12 ++++++++++++ .../java/com/palantir/gradle/jdks/JdkRelease.java | 12 ++++++++++++ .../main/java/com/palantir/gradle/jdks/JdkSpec.java | 12 ++++++++++++ .../java/com/palantir/gradle/jdks/JdksExtension.java | 12 ++++++++++++ .../java/com/palantir/gradle/jdks/JdksPlugin.java | 12 ++++++++++++ .../gradle/jdks/internal/InternalJdksPlugin.java | 12 ++++++++++++ .../gradle/jdks/latest/LatestJdksPlugin.java | 12 ++++++++++++ .../gradle/jdks/JdksPluginIntegrationSpec.groovy | 12 ++++++++++++ 22 files changed, 264 insertions(+) diff --git a/gradle-jdks-distributions/src/main/java/com/palantir/gradle/jdks/JdkDistributionName.java b/gradle-jdks-distributions/src/main/java/com/palantir/gradle/jdks/JdkDistributionName.java index 84780863..31001d3c 100644 --- a/gradle-jdks-distributions/src/main/java/com/palantir/gradle/jdks/JdkDistributionName.java +++ b/gradle-jdks-distributions/src/main/java/com/palantir/gradle/jdks/JdkDistributionName.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks-distributions/src/main/java/com/palantir/gradle/jdks/ZuluVersionUtils.java b/gradle-jdks-distributions/src/main/java/com/palantir/gradle/jdks/ZuluVersionUtils.java index 2c046eb9..84f322a0 100644 --- a/gradle-jdks-distributions/src/main/java/com/palantir/gradle/jdks/ZuluVersionUtils.java +++ b/gradle-jdks-distributions/src/main/java/com/palantir/gradle/jdks/ZuluVersionUtils.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks-distributions/src/test/java/com/palantir/gradle/jdks/JdkDistributionNameTest.java b/gradle-jdks-distributions/src/test/java/com/palantir/gradle/jdks/JdkDistributionNameTest.java index e9d5dc6f..18d64d58 100644 --- a/gradle-jdks-distributions/src/test/java/com/palantir/gradle/jdks/JdkDistributionNameTest.java +++ b/gradle-jdks-distributions/src/test/java/com/palantir/gradle/jdks/JdkDistributionNameTest.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/AmazonCorrettoJdkDistribution.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/AmazonCorrettoJdkDistribution.java index c9052156..eccb856d 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/AmazonCorrettoJdkDistribution.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/AmazonCorrettoJdkDistribution.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/AzulZuluJdkDistribution.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/AzulZuluJdkDistribution.java index 1f077c20..484ccc0f 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/AzulZuluJdkDistribution.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/AzulZuluJdkDistribution.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/ConfigureUtil.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/ConfigureUtil.java index ceaf236a..8cecbf46 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/ConfigureUtil.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/ConfigureUtil.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/GradleJdksJavaInstallationMetadata.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/GradleJdksJavaInstallationMetadata.java index 51123b58..21fee864 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/GradleJdksJavaInstallationMetadata.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/GradleJdksJavaInstallationMetadata.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistribution.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistribution.java index 01efaa93..2b0c502c 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistribution.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistribution.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistributionExtension.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistributionExtension.java index 9f8e9325..19ff012a 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistributionExtension.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistributionExtension.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistributions.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistributions.java index e846d9fa..dceacd1b 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistributions.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDistributions.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloader.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloader.java index 59a2b044..5675a77e 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloader.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloader.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloaders.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloaders.java index beb677f2..61e1bcca 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloaders.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloaders.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkExtension.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkExtension.java index b1ab140b..2f3b1177 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkExtension.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkExtension.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java index d99bbca5..3b5eb579 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkPath.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkPath.java index 2f8100b0..3c30e000 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkPath.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkPath.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkRelease.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkRelease.java index cdd58518..7726f37d 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkRelease.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkRelease.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkSpec.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkSpec.java index 9b725f3f..e7f9a6b6 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkSpec.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkSpec.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java index 94856e34..39e36928 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java index 3202fc2e..238c1496 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/internal/InternalJdksPlugin.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/internal/InternalJdksPlugin.java index 945a482d..7a431aef 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/internal/InternalJdksPlugin.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/internal/InternalJdksPlugin.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks.internal; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/latest/LatestJdksPlugin.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/latest/LatestJdksPlugin.java index ee1066ef..4d50c832 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/latest/LatestJdksPlugin.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/latest/LatestJdksPlugin.java @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks.latest; diff --git a/gradle-jdks/src/test/groovy/com/palantir/gradle/jdks/JdksPluginIntegrationSpec.groovy b/gradle-jdks/src/test/groovy/com/palantir/gradle/jdks/JdksPluginIntegrationSpec.groovy index 4ae95104..69c6fe56 100644 --- a/gradle-jdks/src/test/groovy/com/palantir/gradle/jdks/JdksPluginIntegrationSpec.groovy +++ b/gradle-jdks/src/test/groovy/com/palantir/gradle/jdks/JdksPluginIntegrationSpec.groovy @@ -1,5 +1,17 @@ /* * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.jdks From e0a9c37298aa1f765c709fe0ea3ec24ea117340b Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Fri, 29 Apr 2022 18:06:55 +0100 Subject: [PATCH 7/7] Default storage location to `~/.gradle/caches/gradle-jdks` (#10) --- .../com/palantir/gradle/jdks/JdkManager.java | 18 +++++++++++---- .../palantir/gradle/jdks/JdksExtension.java | 3 +++ .../com/palantir/gradle/jdks/JdksPlugin.java | 16 ++++++++------ .../jdks/JdksPluginIntegrationSpec.groovy | 22 +++++++++---------- 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java index 3b5eb579..44b8cb06 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java @@ -26,16 +26,21 @@ import java.util.UUID; import java.util.stream.Stream; import org.gradle.api.Project; +import org.gradle.api.file.Directory; import org.gradle.api.file.FileTree; +import org.gradle.api.provider.Provider; public final class JdkManager { private final Project project; - private final Path storageLocation; + private final Provider storageLocation; private final JdkDistributions jdkDistributions; private final JdkDownloaders jdkDownloaders; JdkManager( - Project project, Path storageLocation, JdkDistributions jdkDistributions, JdkDownloaders jdkDownloaders) { + Project project, + Provider storageLocation, + JdkDistributions jdkDistributions, + JdkDownloaders jdkDownloaders) { this.project = project; this.storageLocation = storageLocation; this.jdkDistributions = jdkDistributions; @@ -43,8 +48,13 @@ public final class JdkManager { } public Path jdk(JdkSpec jdkSpec) { - Path diskPath = storageLocation.resolve(String.format( - "%s-%s-%s", jdkSpec.distributionName(), jdkSpec.release().version(), jdkSpec.consistentShortHash())); + Path diskPath = storageLocation + .get() + .getAsFile() + .toPath() + .resolve(String.format( + "%s-%s-%s", + jdkSpec.distributionName(), jdkSpec.release().version(), jdkSpec.consistentShortHash())); if (Files.exists(diskPath)) { return diskPath; diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java index 39e36928..5c45387f 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java @@ -20,6 +20,7 @@ import groovy.lang.DelegatesTo; import javax.inject.Inject; import org.gradle.api.Action; +import org.gradle.api.file.DirectoryProperty; import org.gradle.api.model.ObjectFactory; import org.gradle.api.provider.MapProperty; import org.gradle.api.provider.ProviderFactory; @@ -30,6 +31,8 @@ public abstract class JdksExtension { protected abstract MapProperty getJdks(); + public abstract DirectoryProperty getJdkStorageLocation(); + @Inject protected abstract ProviderFactory getProviderFactory(); diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java index 238c1496..1bb8cd6f 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java @@ -18,6 +18,7 @@ import com.palantir.baseline.extensions.BaselineJavaVersionsExtension; import com.palantir.baseline.plugins.BaselineJavaVersions; +import java.io.File; import java.nio.file.Path; import java.util.Arrays; import java.util.HashMap; @@ -40,13 +41,7 @@ public void apply(Project rootProject) { JdkManager jdkManager = new JdkManager( rootProject.getProject(), - rootProject - .getLayout() - .getBuildDirectory() - .dir("jdks") - .get() - .getAsFile() - .toPath(), + jdksExtension.getJdkStorageLocation(), jdkDistributions, new JdkDownloaders(rootProject, jdksExtension)); @@ -72,6 +67,13 @@ public void apply(Project rootProject) { private JdksExtension extension(Project rootProject, JdkDistributions jdkDistributions) { JdksExtension jdksExtension = rootProject.getExtensions().create("jdks", JdksExtension.class); + jdksExtension + .getJdkStorageLocation() + .set(rootProject + .getLayout() + .dir(rootProject.provider( + () -> new File(System.getProperty("user.home"), ".gradle/caches/gradle-jdks")))); + Arrays.stream(JdkDistributionName.values()).forEach(jdkDistributionName -> { JdkDistributionExtension jdkDistributionExtension = rootProject.getObjects().newInstance(JdkDistributionExtension.class); diff --git a/gradle-jdks/src/test/groovy/com/palantir/gradle/jdks/JdksPluginIntegrationSpec.groovy b/gradle-jdks/src/test/groovy/com/palantir/gradle/jdks/JdksPluginIntegrationSpec.groovy index 69c6fe56..67a2bb6d 100644 --- a/gradle-jdks/src/test/groovy/com/palantir/gradle/jdks/JdksPluginIntegrationSpec.groovy +++ b/gradle-jdks/src/test/groovy/com/palantir/gradle/jdks/JdksPluginIntegrationSpec.groovy @@ -31,12 +31,17 @@ class JdksPluginIntegrationSpec extends IntegrationSpec { distribution = 'azul-zulu' jdkVersion = '11.54.25-11.0.14.1' } + + jdkStorageLocation = layout.buildDirectory.dir('jdks') } javaVersions { libraryTarget = 11 } - + '''.stripIndent(true) + + // language=gradle + def subprojectDir = addSubproject 'subproject', ''' apply plugin: 'java-library' task printJavaVersion(type: JavaExec) { @@ -53,21 +58,16 @@ class JdksPluginIntegrationSpec extends IntegrationSpec { public final class PrintJavaVersion { public static void main(String... args) { - System.out.println(String.format( - "version: %s, vendor: %s", + System.out.printf( + "version: %s, vendor: %s%n", System.getProperty("java.version"), - System.getProperty("java.vendor"))); + System.getProperty("java.vendor")); } } - '''.stripIndent(true) + '''.stripIndent(true), subprojectDir when: - - def stdout = runTasksSuccessfully( - 'printJavaVersion', - // TODO: avoid resolving from root configuration somehow, removed in Gradle 8 - '--warning-mode=none') - .standardOutput + def stdout = runTasksSuccessfully('printJavaVersion').standardOutput then: stdout.contains 'version: 11.0.14.1, vendor: Azul Systems, Inc.'