From 232624409cd31c5b8a1888145599b39dc72bcdb9 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Fri, 3 Jan 2020 15:17:32 -0500 Subject: [PATCH 1/2] Require Gradle 5.0 or higher --- .../gradle/wrapper/gradle-wrapper.jar | Bin 56177 -> 56177 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/helloworld/settings.gradle | 0 .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/java-agent/settings.gradle | 0 .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../gradle/wrapper/gradle-wrapper.jar | Bin 56177 -> 56177 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/spring-boot/settings.gradle | 0 .../gradle/wrapper/gradle-wrapper.properties | 3 +-- jib-gradle-plugin/CHANGELOG.md | 1 + .../jib/gradle/GradleProjectProperties.java | 2 ++ .../cloud/tools/jib/gradle/JibPlugin.java | 2 +- 13 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 examples/helloworld/settings.gradle create mode 100644 examples/java-agent/settings.gradle create mode 100644 examples/spring-boot/settings.gradle diff --git a/examples/helloworld/gradle/wrapper/gradle-wrapper.jar b/examples/helloworld/gradle/wrapper/gradle-wrapper.jar index 29953ea141f55e3b8fc691d31b5ca8816d89fa87..94336fcae912db8a11d55634156fa011f4686124 100644 GIT binary patch delta 75 zcmeykjrrp?<_YF3{B|p=CR)d^elGf0#5nPQ^v3PRCxzG;0=(Hd{+{0VNQ{AjK?H~= bKR6{bS>lv7Sp8=AQ}+Z|K+=;nZ+id$gFGJ; delta 75 zcmeykjrrp?<_YF3`^8VXPqdC<{aEy|h;iZp>5bcsPYN+H1bDM^WdGhdRg8gwK?H~= bKR6{bS>lv7Sp8=AQ}+Z|K+=;nZ+id$ib5We diff --git a/examples/helloworld/gradle/wrapper/gradle-wrapper.properties b/examples/helloworld/gradle/wrapper/gradle-wrapper.properties index e0b3fb8d70..75b8c7c8c6 100644 --- a/examples/helloworld/gradle/wrapper/gradle-wrapper.properties +++ b/examples/helloworld/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/helloworld/settings.gradle b/examples/helloworld/settings.gradle new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/java-agent/gradle/wrapper/gradle-wrapper.properties b/examples/java-agent/gradle/wrapper/gradle-wrapper.properties index e0b3fb8d70..75b8c7c8c6 100644 --- a/examples/java-agent/gradle/wrapper/gradle-wrapper.properties +++ b/examples/java-agent/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/java-agent/settings.gradle b/examples/java-agent/settings.gradle new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/multi-module/gradle/wrapper/gradle-wrapper.properties b/examples/multi-module/gradle/wrapper/gradle-wrapper.properties index e0b3fb8d70..75b8c7c8c6 100644 --- a/examples/multi-module/gradle/wrapper/gradle-wrapper.properties +++ b/examples/multi-module/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/spring-boot/gradle/wrapper/gradle-wrapper.jar b/examples/spring-boot/gradle/wrapper/gradle-wrapper.jar index 29953ea141f55e3b8fc691d31b5ca8816d89fa87..94336fcae912db8a11d55634156fa011f4686124 100644 GIT binary patch delta 75 zcmeykjrrp?<_YF3{B|p=CR)d^elGf0#5nPQ^v3PRCxzG;0=(Hd{+{0VNQ{AjK?H~= bKR6{bS>lv7Sp8=AQ}+Z|K+=;nZ+id$gFGJ; delta 75 zcmeykjrrp?<_YF3`^8VXPqdC<{aEy|h;iZp>5bcsPYN+H1bDM^WdGhdRg8gwK?H~= bKR6{bS>lv7Sp8=AQ}+Z|K+=;nZ+id$ib5We diff --git a/examples/spring-boot/gradle/wrapper/gradle-wrapper.properties b/examples/spring-boot/gradle/wrapper/gradle-wrapper.properties index e0b3fb8d70..75b8c7c8c6 100644 --- a/examples/spring-boot/gradle/wrapper/gradle-wrapper.properties +++ b/examples/spring-boot/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/spring-boot/settings.gradle b/examples/spring-boot/settings.gradle new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/vertx/gradle/wrapper/gradle-wrapper.properties b/examples/vertx/gradle/wrapper/gradle-wrapper.properties index a28d081c5d..75b8c7c8c6 100644 --- a/examples/vertx/gradle/wrapper/gradle-wrapper.properties +++ b/examples/vertx/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Nov 12 11:28:35 CET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/jib-gradle-plugin/CHANGELOG.md b/jib-gradle-plugin/CHANGELOG.md index 16f86d7b71..7a6a995ed6 100644 --- a/jib-gradle-plugin/CHANGELOG.md +++ b/jib-gradle-plugin/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. - Removed deprecated `jib.extraDirectory` configuration in favor of `jib.extraDirectories`. ([#1691](https://github.com/GoogleContainerTools/jib/issues/1691)) - Removed deprecated `jib.container.useCurrentTimestamp` configuration in favor of `jib.container.creationTime` with `USE_CURRENT_TIMESTAMP`. ([#1897](https://github.com/GoogleContainerTools/jib/issues/1897)) - HTTP redirection URLs are no longer sanitized in order to work around an issue with certain registries that do not conform to HTTP standards. This resolves an issue with using Red Hat OpenShift and Quay registries. ([#2106](https://github.com/GoogleContainerTools/jib/issues/2106), [#1986](https://github.com/GoogleContainerTools/jib/issues/1986#issuecomment-547610104)) +- Requires Gradle 5.0 or newer (up from 4.9). ### Fixed - `jibBuildTar` with `jib.container.format='OCI'` now builds a correctly formatted OCI archive. ([#2124](https://github.com/GoogleContainerTools/jib/issues/2124)) diff --git a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java index c96f528424..ba9227e9e6 100644 --- a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java +++ b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java @@ -234,6 +234,8 @@ public JibContainerBuilder createJibContainerBuilder( case PACKAGED: // Add a JAR Jar jarTask = (Jar) project.getTasks().findByName("jar"); + // TODO: in newer Gradle API (6.0?), maybe + // "Path jarPath = jarTask.getArchiveFile().get().getAsFile().toPath()" (untested). Path jarPath = jarTask.getDestinationDir().toPath().resolve(jarTask.getArchiveName()); log(LogEvent.debug("Using JAR: " + jarPath)); javaContainerBuilder.addToClasspath(jarPath); diff --git a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/JibPlugin.java b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/JibPlugin.java index 22cf639978..4074eaf88a 100644 --- a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/JibPlugin.java +++ b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/JibPlugin.java @@ -42,7 +42,7 @@ public class JibPlugin implements Plugin { - @VisibleForTesting static final GradleVersion GRADLE_MIN_VERSION = GradleVersion.version("4.9"); + @VisibleForTesting static final GradleVersion GRADLE_MIN_VERSION = GradleVersion.version("5.0"); public static final String JIB_EXTENSION_NAME = "jib"; public static final String BUILD_IMAGE_TASK_NAME = "jib"; From 96ee779fa7db9511db9d25f69a71abc22fa638a2 Mon Sep 17 00:00:00 2001 From: Chanseok Oh Date: Fri, 3 Jan 2020 16:29:45 -0500 Subject: [PATCH 2/2] Remove TODO --- .../google/cloud/tools/jib/gradle/GradleProjectProperties.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java index ba9227e9e6..c96f528424 100644 --- a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java +++ b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java @@ -234,8 +234,6 @@ public JibContainerBuilder createJibContainerBuilder( case PACKAGED: // Add a JAR Jar jarTask = (Jar) project.getTasks().findByName("jar"); - // TODO: in newer Gradle API (6.0?), maybe - // "Path jarPath = jarTask.getArchiveFile().get().getAsFile().toPath()" (untested). Path jarPath = jarTask.getDestinationDir().toPath().resolve(jarTask.getArchiveName()); log(LogEvent.debug("Using JAR: " + jarPath)); javaContainerBuilder.addToClasspath(jarPath);