From f319fe5d095d844a5b86c11ceaf9fce180dd5fa6 Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Fri, 31 Jan 2025 12:31:06 +0100 Subject: [PATCH 1/2] Revert "Gradle wrapper scripts packed as resources (#4957)" This reverts commit d33ff3f5a96e754aeefc7f7135544c3b7b46576f. --- .../java/org/openrewrite/remote/Remote.java | 31 +- .../org/openrewrite/remote/RemoteArchive.java | 7 +- .../org/openrewrite/remote/RemoteFile.java | 1 - .../openrewrite/remote/RemoteResource.java | 74 ----- .../openrewrite/remote/RemoteArchiveTest.java | 28 +- .../openrewrite/remote/RemoteFileTest.java | 21 +- rewrite-gradle/build.gradle.kts | 6 - .../openrewrite/gradle/ChangeDependency.java | 6 +- .../gradle/ChangeDependencyArtifactId.java | 6 +- .../gradle/ChangeDependencyClassifier.java | 6 +- .../gradle/ChangeDependencyConfiguration.java | 4 +- .../gradle/ChangeDependencyExtension.java | 6 +- .../gradle/ChangeDependencyGroupId.java | 6 +- .../gradle/DependencyUseMapNotation.java | 4 +- .../RemoveRedundantDependencyVersions.java | 6 +- .../gradle/UpdateGradleWrapper.java | 15 +- .../gradle/UpdateJavaCompatibility.java | 2 +- .../gradle/UpgradeDependencyVersion.java | 6 +- .../GradleWrapperScriptDownloader.java | 129 -------- .../internal/GradleWrapperScriptLoader.java | 101 ------ .../internal/InsertDependencyComparator.java | 2 + .../gradle/internal/package-info.java | 19 -- .../gradle/plugins/ChangePlugin.java | 2 +- .../gradle/plugins/UpgradePluginVersion.java | 2 +- .../security/UseHttpsForRepositories.java | 2 +- .../gradle/table/package-info.java | 19 -- .../gradle/trait/GradleDependency.java | 10 +- .../ChangeStringLiteral.java | 2 +- .../gradle/{internal => util}/Dependency.java | 2 +- .../DependencyStringNotationConverter.java | 2 +- .../gradle/util/DistributionInfos.java | 12 +- .../gradle/util/GradleWrapper.java | 74 +++-- .../rewrite/gradle-wrapper/unix/12dcd60b.txt | 164 ---------- .../rewrite/gradle-wrapper/unix/27be095c.txt | 171 ---------- .../rewrite/gradle-wrapper/unix/2aa59cb0.txt | 292 ------------------ .../rewrite/gradle-wrapper/unix/2c2f80d5.txt | 290 ----------------- .../rewrite/gradle-wrapper/unix/318f9d0c.txt | 292 ------------------ .../rewrite/gradle-wrapper/unix/3a7e8b97.txt | 290 ----------------- .../rewrite/gradle-wrapper/unix/4d0d6bb.txt | 164 ---------- .../rewrite/gradle-wrapper/unix/547edccc.txt | 164 ---------- .../rewrite/gradle-wrapper/unix/5760ee9b.txt | 282 ----------------- .../rewrite/gradle-wrapper/unix/5aac1e11.txt | 172 ----------- .../rewrite/gradle-wrapper/unix/63c55010.txt | 289 ----------------- .../rewrite/gradle-wrapper/unix/6e691335.txt | 169 ---------- .../rewrite/gradle-wrapper/unix/7129bfb3.txt | 160 ---------- .../rewrite/gradle-wrapper/unix/7545ee5b.txt | 282 ----------------- .../rewrite/gradle-wrapper/unix/7bdb49ed.txt | 286 ----------------- .../rewrite/gradle-wrapper/unix/8dae574.txt | 188 ----------- .../rewrite/gradle-wrapper/unix/8e0d96aa.txt | 278 ----------------- .../rewrite/gradle-wrapper/unix/8fdcd9ad.txt | 164 ---------- .../rewrite/gradle-wrapper/unix/91001e71.txt | 172 ----------- .../rewrite/gradle-wrapper/unix/97200f5d.txt | 185 ----------- .../rewrite/gradle-wrapper/unix/a4d9e5e7.txt | 188 ----------- .../rewrite/gradle-wrapper/unix/ad2cdb0f.txt | 164 ---------- .../rewrite/gradle-wrapper/unix/b6a5b769.txt | 183 ----------- .../rewrite/gradle-wrapper/unix/be340f5d.txt | 185 ----------- .../rewrite/gradle-wrapper/unix/bf16f1fe.txt | 188 ----------- .../rewrite/gradle-wrapper/unix/ec6799f9.txt | 292 ------------------ .../rewrite/gradle-wrapper/unix/f27d7133.txt | 272 ---------------- .../rewrite/gradle-wrapper/unix/f642e19f.txt | 164 ---------- .../rewrite/gradle-wrapper/unix/fb8375e7.txt | 290 ----------------- .../rewrite/gradle-wrapper/unix/fdd0b9a9.txt | 160 ---------- .../rewrite/gradle-wrapper/versions.csv | 258 ---------------- .../gradle-wrapper/windows/12e9f1b3.txt | 91 ------ .../gradle-wrapper/windows/22edc5d0.txt | 85 ----- .../gradle-wrapper/windows/2b81bfec.txt | 93 ------ .../gradle-wrapper/windows/2e72f1ba.txt | 91 ------ .../gradle-wrapper/windows/4c6b9dc9.txt | 90 ------ .../gradle-wrapper/windows/4fcf87d.txt | 105 ------- .../gradle-wrapper/windows/59b7a264.txt | 101 ------ .../gradle-wrapper/windows/5c81a1f1.txt | 101 ------ .../gradle-wrapper/windows/5eec2db.txt | 104 ------- .../gradle-wrapper/windows/8018d7e6.txt | 95 ------ .../gradle-wrapper/windows/84f6eae6.txt | 91 ------ .../gradle-wrapper/windows/8b23b568.txt | 92 ------ .../gradle-wrapper/windows/9016f1b3.txt | 91 ------ .../gradle-wrapper/windows/f0ac8f2.txt | 93 ------ .../gradle/UpdateGradleWrapperTest.java | 36 ++- .../GradleWrapperScriptLoaderTest.java | 40 --- .../gradle/internal/GradleWrapperTest.java | 30 -- .../DistributionInfosTest.java | 12 +- .../gradle/util/GradleWrapperTest.java | 92 ++++++ .../gradle/util}/package-info.java | 4 +- .../maven/internal/MavenPomDownloader.java | 1 - .../maven/utilities/MavenWrapper.java | 54 ++-- .../maven/UpdateMavenWrapperTest.java | 18 +- .../org/openrewrite/test/RewriteTest.java | 19 +- .../org/openrewrite/yaml/CreateYamlFile.java | 4 +- 88 files changed, 311 insertions(+), 8733 deletions(-) delete mode 100644 rewrite-core/src/main/java/org/openrewrite/remote/RemoteResource.java delete mode 100644 rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/GradleWrapperScriptDownloader.java delete mode 100644 rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/GradleWrapperScriptLoader.java delete mode 100644 rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/package-info.java delete mode 100644 rewrite-gradle/src/main/java/org/openrewrite/gradle/table/package-info.java rename rewrite-gradle/src/main/java/org/openrewrite/gradle/{internal => util}/ChangeStringLiteral.java (96%) rename rewrite-gradle/src/main/java/org/openrewrite/gradle/{internal => util}/Dependency.java (97%) rename rewrite-gradle/src/main/java/org/openrewrite/gradle/{internal => util}/DependencyStringNotationConverter.java (98%) delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/12dcd60b.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/27be095c.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/2aa59cb0.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/2c2f80d5.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/318f9d0c.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/3a7e8b97.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/4d0d6bb.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/547edccc.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/5760ee9b.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/5aac1e11.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/63c55010.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/6e691335.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7129bfb3.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7545ee5b.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7bdb49ed.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8dae574.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8e0d96aa.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8fdcd9ad.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/91001e71.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/97200f5d.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/a4d9e5e7.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/ad2cdb0f.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/b6a5b769.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/be340f5d.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/bf16f1fe.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/ec6799f9.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/f27d7133.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/f642e19f.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/fb8375e7.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/fdd0b9a9.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/versions.csv delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/12e9f1b3.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/22edc5d0.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/2b81bfec.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/2e72f1ba.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/4c6b9dc9.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/4fcf87d.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/59b7a264.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/5c81a1f1.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/5eec2db.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/8018d7e6.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/84f6eae6.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/8b23b568.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/9016f1b3.txt delete mode 100644 rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/f0ac8f2.txt delete mode 100644 rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/GradleWrapperScriptLoaderTest.java delete mode 100644 rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/GradleWrapperTest.java rename rewrite-gradle/src/test/java/org/openrewrite/gradle/{internal => util}/DistributionInfosTest.java (79%) create mode 100644 rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java rename rewrite-gradle/src/{main/java/org/openrewrite/gradle/style => test/java/org/openrewrite/gradle/util}/package-info.java (87%) diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/Remote.java b/rewrite-core/src/main/java/org/openrewrite/remote/Remote.java index d977c1590f8..0608abc19c5 100644 --- a/rewrite-core/src/main/java/org/openrewrite/remote/Remote.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/Remote.java @@ -44,6 +44,10 @@ * If a Checksum is provided it will be used to validate the integrity of the downloaded file. */ public interface Remote extends SourceFile { + URI getUri(); + + R withUri(URI uri); + /** * Any text describing what this remote URI represents. Used to present human-readable results to an end user. */ @@ -62,6 +66,7 @@ default T withChecksum(@Nullable Checksum checksum) { return (T) this; } + /** * Download the remote file * @@ -92,12 +97,16 @@ default

boolean isAcceptable(TreeVisitor v, P p) { return v.isAdaptableTo(RemoteVisitor.class); } - static Builder builder(SourceFile before) { - return new Builder(before.getId(), before.getSourcePath(), before.getMarkers()); + static Builder builder(SourceFile before, URI uri) { + return new Builder(before.getId(), before.getSourcePath(), before.getMarkers(), uri); } - static Builder builder(Path sourcePath) { - return new Builder(Tree.randomId(), sourcePath, Markers.EMPTY); + static Builder builder(Path sourcePath, URI uri) { + return new Builder(Tree.randomId(), sourcePath, Markers.EMPTY, uri); + } + + static Builder builder(UUID id, Path sourcePath, Markers markers, URI uri) { + return new Builder(id, sourcePath, markers, uri); } @Override @@ -118,6 +127,7 @@ class Builder { protected final UUID id; protected final Path sourcePath; protected final Markers markers; + protected final URI uri; @Nullable @Language("markdown") @@ -134,10 +144,11 @@ class Builder { @Nullable FileAttributes fileAttributes; - Builder(UUID id, Path sourcePath, Markers markers) { + Builder(UUID id, Path sourcePath, Markers markers, URI uri) { this.id = id; this.sourcePath = sourcePath; this.markers = markers; + this.uri = uri; } public Builder description(@Language("markdown") String description) { @@ -165,21 +176,17 @@ public Builder checksum(Checksum checksum) { return this; } - public RemoteResource build(InputStream inputStream) { - return new RemoteResource(id, sourcePath, markers, inputStream, charset, charsetBomMarked, fileAttributes, description, checksum); - } - - public RemoteFile build(URI uri) { + public RemoteFile build() { return new RemoteFile(id, sourcePath, markers, uri, charset, charsetBomMarked, fileAttributes, description, checksum); } - public RemoteArchive build(URI uri, Path path) { + public RemoteArchive build(Path path) { return new RemoteArchive(id, sourcePath, markers, uri, charset, charsetBomMarked, fileAttributes, description, Arrays.asList(path.toString().replace("/", "\\/").replace(".", "\\.") .split("!")), checksum); } - public RemoteArchive build(URI uri, String... paths) { + public RemoteArchive build(String... paths) { return new RemoteArchive(id, sourcePath, markers, uri, charset, charsetBomMarked, fileAttributes, description, Arrays.asList(paths), checksum); } diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArchive.java b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArchive.java index cae34b576c1..6e553fdac4b 100644 --- a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArchive.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArchive.java @@ -47,8 +47,8 @@ * Useful when a Recipe wishes to create a SourceFile based on something specific from within a remote archive, but not * the entire archive. *

- * Downloading and extracting the correct file from within the archive are not handled during recipe execution. - * Post-processing of recipe results by a build plugin or other caller of OpenRewrite is responsible for this. + * Downloading and extracting the correct file from within the archive are not handled during Recipe execution. + * Post-processing of Recipe results by a build plugin or other caller of OpenRewrite is responsible for this. */ @Value @EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) @@ -70,7 +70,6 @@ public class RemoteArchive implements Remote { FileAttributes fileAttributes; @Language("markdown") - @Nullable String description; /** @@ -93,10 +92,10 @@ public InputStream getInputStream(ExecutionContext ctx) { RemoteArtifactCache cache = RemoteExecutionContextView.view(ctx).getArtifactCache(); try { Path localArchive = cache.compute(uri, () -> { + //noinspection resource if ("file".equals(uri.getScheme())) { return Files.newInputStream(Paths.get(uri)); } - //noinspection resource HttpSender.Response response = httpSender.send(httpSender.get(uri.toString()).build()); if (response.isSuccessful()) { return response.getBody(); diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteFile.java b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteFile.java index c6a821f1c51..c579845edd4 100644 --- a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteFile.java @@ -56,7 +56,6 @@ public class RemoteFile implements Remote { FileAttributes fileAttributes; @Language("markdown") - @Nullable String description; @Nullable diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteResource.java b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteResource.java deleted file mode 100644 index 0a3fdb2bb9b..00000000000 --- a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteResource.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - *

- * 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 - *

- * https://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 org.openrewrite.remote; - -import lombok.EqualsAndHashCode; -import lombok.Value; -import lombok.With; -import org.intellij.lang.annotations.Language; -import org.jspecify.annotations.Nullable; -import org.openrewrite.Checksum; -import org.openrewrite.ExecutionContext; -import org.openrewrite.FileAttributes; -import org.openrewrite.marker.Markers; - -import java.io.InputStream; -import java.nio.charset.Charset; -import java.nio.file.Path; -import java.util.UUID; - -/** - * A remote resource that can be fetched from an {@link java.io.InputStream} which - * could be, for example, a classpath resource. - */ -@Value -@EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) -@With -public class RemoteResource implements Remote { - @EqualsAndHashCode.Include - UUID id; - - Path sourcePath; - Markers markers; - InputStream inputStream; - - @Nullable - Charset charset; - - boolean charsetBomMarked; - - @Nullable - FileAttributes fileAttributes; - - @Language("markdown") - @Nullable - String description; - - @Nullable - Checksum checksum; - - /** - * Note that this method can only be called once, consuming the - * {@link InputStream} in the process. - * - * @param ctx Unused in this implementation of {@link Remote}. - * @return The data of the file. - */ - @Override - public InputStream getInputStream(ExecutionContext ctx) { - return inputStream; - } -} diff --git a/rewrite-core/src/test/java/org/openrewrite/remote/RemoteArchiveTest.java b/rewrite-core/src/test/java/org/openrewrite/remote/RemoteArchiveTest.java index 5ffdb79d6ac..e09fc8454f5 100644 --- a/rewrite-core/src/test/java/org/openrewrite/remote/RemoteArchiveTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/remote/RemoteArchiveTest.java @@ -44,8 +44,11 @@ void gradleWrapper(String version) throws Exception { ExecutionContext ctx = new InMemoryExecutionContext(); RemoteArchive remoteArchive = Remote - .builder(Paths.get("gradle/wrapper/gradle-wrapper.jar")) - .build(distributionUrl.toURI(), "gradle-[^\\/]+\\/(?:.*\\/)+gradle-wrapper-(?!shared).*\\.jar"); + .builder( + Paths.get("gradle/wrapper/gradle-wrapper.jar"), + distributionUrl.toURI() + ) + .build("gradle-[^\\/]+\\/(?:.*\\/)+gradle-wrapper-(?!shared).*\\.jar"); long actual = getInputStreamSize(remoteArchive.getInputStream(ctx)); assertThat(actual).isGreaterThan(50_000); @@ -60,8 +63,11 @@ void gradleWrapperDownloadFails() throws Exception { .setLargeFileHttpSender(new MockHttpSender(408)); RemoteArchive remoteArchive = Remote - .builder(Paths.get("gradle/wrapper/gradle-wrapper.jar")) - .build(distributionUrl.toURI(), "gradle-[^\\/]+\\/(?:.*\\/)+gradle-wrapper-(?!shared).*\\.jar"); + .builder( + Paths.get("gradle/wrapper/gradle-wrapper.jar"), + distributionUrl.toURI() + ) + .build("gradle-[^\\/]+\\/(?:.*\\/)+gradle-wrapper-(?!shared).*\\.jar"); assertThatThrownBy(() -> getInputStreamSize(remoteArchive.getInputStream(ctx))) .isInstanceOf(IllegalStateException.class) @@ -88,8 +94,11 @@ void gradleWrapperConcurrent(String version) throws Exception { .setLargeFileHttpSender(new MockHttpSender(distributionUrl::openStream)); RemoteArchive remoteArchive = Remote - .builder(Paths.get("gradle/wrapper/gradle-wrapper.jar")) - .build(distributionUrl.toURI(), "gradle-[^\\/]+\\/(?:.*\\/)+gradle-wrapper-(?!shared).*\\.jar"); + .builder( + Paths.get("gradle/wrapper/gradle-wrapper.jar"), + distributionUrl.toURI() + ) + .build("gradle-[^\\/]+\\/(?:.*\\/)+gradle-wrapper-(?!shared).*\\.jar"); return getInputStreamSize(remoteArchive.getInputStream(ctx)); }); @@ -109,8 +118,11 @@ void printingRemoteArchive() throws URISyntaxException { URL zipUrl = requireNonNull(RemoteArchiveTest.class.getClassLoader().getResource("zipfile.zip")); RemoteArchive remoteArchive = Remote - .builder(Paths.get("content.txt")) - .build(zipUrl.toURI(), "content.txt"); + .builder( + Paths.get("content.txt"), + zipUrl.toURI() + ) + .build("content.txt"); String printed = remoteArchive.printAll(new PrintOutputCapture<>(0, PrintOutputCapture.MarkerPrinter.DEFAULT)); assertThat(printed).isEqualTo("this is a zipped file"); diff --git a/rewrite-core/src/test/java/org/openrewrite/remote/RemoteFileTest.java b/rewrite-core/src/test/java/org/openrewrite/remote/RemoteFileTest.java index 6fb365d7f2d..de1b23476c8 100644 --- a/rewrite-core/src/test/java/org/openrewrite/remote/RemoteFileTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/remote/RemoteFileTest.java @@ -43,8 +43,11 @@ void gradleWrapperProperties() throws Exception { .setLargeFileHttpSender(new MockHttpSender(distributionUrl::openStream)); RemoteFile remoteFile = Remote - .builder(Paths.get("gradle/wrapper/gradle-wrapper.properties")) - .build(distributionUrl.toURI()); + .builder( + Paths.get("gradle/wrapper/gradle-wrapper.properties"), + distributionUrl.toURI() + ) + .build(); long actual = getInputStreamSize(remoteFile.getInputStream(ctx)); assertThat(actual).isGreaterThan(800); @@ -58,8 +61,11 @@ void gradleWrapperDownloadFails() throws Exception { .setLargeFileHttpSender(new MockHttpSender(408)); RemoteArchive remoteFile = Remote - .builder(Paths.get("gradle/wrapper/gradle-wrapper.properties")) - .build(distributionUrl.toURI(), "gradle-[^\\/]+\\/(?:.*\\/)+gradle-wrapper-(?!shared).*\\.jar"); + .builder( + Paths.get("gradle/wrapper/gradle-wrapper.properties"), + distributionUrl.toURI() + ) + .build("gradle-[^\\/]+\\/(?:.*\\/)+gradle-wrapper-(?!shared).*\\.jar"); assertThatThrownBy(() -> getInputStreamSize(remoteFile.getInputStream(ctx))) @@ -84,8 +90,11 @@ void gradleWrapperPropertiesConcurrent() throws Exception { .setLargeFileHttpSender(new MockHttpSender(distributionUrl::openStream)); RemoteFile remoteFile = Remote - .builder(Paths.get("gradle/wrapper/gradle-wrapper.properties")) - .build(distributionUrl.toURI()); + .builder( + Paths.get("gradle/wrapper/gradle-wrapper.properties"), + distributionUrl.toURI() + ) + .build(); return getInputStreamSize(remoteFile.getInputStream(ctx)); }); diff --git a/rewrite-gradle/build.gradle.kts b/rewrite-gradle/build.gradle.kts index d49621129ef..9df2c9c9477 100644 --- a/rewrite-gradle/build.gradle.kts +++ b/rewrite-gradle/build.gradle.kts @@ -1,5 +1,3 @@ -import nl.javadude.gradle.plugins.license.LicenseExtension - plugins { id("org.openrewrite.build.language-library") id("groovy") @@ -96,7 +94,3 @@ tasks.withType { "**/GradleSettings**" ) } - -configure { - excludePatterns.add("**/gradle-wrapper/*") -} diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependency.java index 57f84371916..9312fa96c3b 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependency.java @@ -24,9 +24,9 @@ import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.search.FindGradleProject; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.ChangeStringLiteral; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.ChangeStringLiteral; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java index 887bc631dff..02e028fd305 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java @@ -22,9 +22,9 @@ import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.ChangeStringLiteral; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.ChangeStringLiteral; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java index 3e5b364d3fe..007f0c45ef4 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java @@ -22,9 +22,9 @@ import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.ChangeStringLiteral; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.ChangeStringLiteral; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java index 6506f9b0445..f937e30c1fe 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java @@ -20,8 +20,8 @@ import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.StringUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java index ccbb1bdff6d..dc103c00f75 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java @@ -20,9 +20,9 @@ import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.ChangeStringLiteral; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.ChangeStringLiteral; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java index 5d4b92b5279..ade503f67d1 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java @@ -22,9 +22,9 @@ import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.ChangeStringLiteral; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.ChangeStringLiteral; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java index 193bc2b92f0..301fb375987 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java @@ -20,8 +20,8 @@ import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java index 0c257fac3b9..42ed6e8f96e 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java @@ -22,9 +22,9 @@ import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.ChangeStringLiteral; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.ChangeStringLiteral; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java index e6cfeea7db1..80fa69ba0c0 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java @@ -222,10 +222,8 @@ public Properties visitEntry(Properties.Entry entry, ExecutionContext ctx) { // Typical example: https://services.gradle.org/distributions/gradle-7.4-all.zip or https://company.com/repo/gradle-8.2-bin.zip String currentDistributionUrl = entry.getValue().getText(); - if (gradleWrapper == null) { - getGradleWrapper(ctx); - } - if (StringUtils.isBlank(gradleWrapper.getDistributionUrl()) && !StringUtils.isBlank(version) && + GradleWrapper gradleWrpr = getGradleWrapper(ctx); + if (StringUtils.isBlank(gradleWrpr.getDistributionUrl()) && !StringUtils.isBlank(version) && Semver.validate(version, null).getValue() instanceof ExactVersion) { String newDownloadUrl = currentDistributionUrl.replace("\\", "") .replaceAll("(.*gradle-)(\\d+\\.\\d+(?:\\.\\d+)?)(.*-(?:bin|all).zip)", @@ -233,13 +231,13 @@ public Properties visitEntry(Properties.Entry entry, ExecutionContext ctx) { gradleWrapper = new GradleWrapper(version, new DistributionInfos(newDownloadUrl, null, null)); } String wrapperHost = currentDistributionUrl.substring(0, currentDistributionUrl.lastIndexOf("/")) + "/gradle-"; - if (StringUtils.isBlank(wrapperUri) && !StringUtils.isBlank(gradleWrapper.getDistributionUrl()) && - !gradleWrapper.getPropertiesFormattedUrl().startsWith(wrapperHost)) { - String newDownloadUrl = gradleWrapper.getDistributionUrl() + if (StringUtils.isBlank(wrapperUri) && !StringUtils.isBlank(gradleWrpr.getDistributionUrl()) && + !gradleWrpr.getPropertiesFormattedUrl().startsWith(wrapperHost)) { + String newDownloadUrl = gradleWrpr.getDistributionUrl() .replace("\\", "") .replaceAll("(.*gradle-)(\\d+\\.\\d+(?:\\.\\d+)?)(.*-(?:bin|all).zip)", wrapperHost + gradleWrapper.getVersion() + "$3"); - gradleWrapper = new GradleWrapper(gradleWrapper.getVersion(), new DistributionInfos(newDownloadUrl, null, null)); + gradleWrapper = new GradleWrapper(gradleWrpr.getVersion(), new DistributionInfos(newDownloadUrl, null, null)); } if (!gradleWrapper.getPropertiesFormattedUrl().equals(currentDistributionUrl)) { @@ -361,7 +359,6 @@ public TreeVisitor getVisitor(GradleWrapperState acc) { @Override public Tree visit(@Nullable Tree tree, ExecutionContext ctx) { if (!(tree instanceof SourceFile)) { - //noinspection DataFlowIssue return tree; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java index f9ce59a6d35..6543204360c 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java @@ -19,7 +19,7 @@ import lombok.Value; import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.gradle.internal.ChangeStringLiteral; +import org.openrewrite.gradle.util.ChangeStringLiteral; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeDependencyVersion.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeDependencyVersion.java index d1512a8107b..cce27b216a0 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeDependencyVersion.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeDependencyVersion.java @@ -24,9 +24,9 @@ import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.trait.GradleDependency; -import org.openrewrite.gradle.internal.ChangeStringLiteral; -import org.openrewrite.gradle.internal.Dependency; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.ChangeStringLiteral; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/GradleWrapperScriptDownloader.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/GradleWrapperScriptDownloader.java deleted file mode 100644 index 969df9ccaff..00000000000 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/GradleWrapperScriptDownloader.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - *

- * 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 - *

- * https://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 org.openrewrite.gradle.internal; - -import org.openrewrite.InMemoryExecutionContext; -import org.openrewrite.gradle.util.DistributionInfos; -import org.openrewrite.gradle.util.GradleWrapper; -import org.openrewrite.internal.StringUtils; -import org.openrewrite.remote.Remote; -import org.openrewrite.semver.LatestRelease; - -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ForkJoinPool; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import java.util.stream.Collectors; -import java.util.zip.Adler32; - -import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_BATCH_LOCATION; -import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_SCRIPT_LOCATION; - -public class GradleWrapperScriptDownloader { - private static final Path WRAPPER_SCRIPTS = Paths.get("rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/"); - - public static void main(String[] args) throws IOException, InterruptedException { - Lock lock = new ReentrantLock(); - InMemoryExecutionContext ctx = new InMemoryExecutionContext(); - List allGradleReleases = GradleWrapper.listAllVersions(null, ctx); - Map allDownloadedVersions = - new ConcurrentHashMap<>(new GradleWrapperScriptLoader().getAllVersions()); - - AtomicInteger i = new AtomicInteger(); - ForkJoinPool pool = ForkJoinPool.commonPool(); - pool.invokeAll(allGradleReleases.stream().map(version -> (Callable) () -> { - String v = version.getVersion(); - String threadName = " [" + Thread.currentThread().getName() + "]"; - - if (allDownloadedVersions.containsKey(v)) { - System.out.printf("%03d: %s already exists. Skipping.%s%n", i.incrementAndGet(), - v, threadName); - return null; - } - - try { - DistributionInfos infos = DistributionInfos.fetch(GradleWrapper.DistributionType.Bin, version, ctx); - GradleWrapper wrapper = new GradleWrapper(v, infos); - - String gradlewChecksum = downloadScript(WRAPPER_SCRIPT_LOCATION, wrapper, "unix", ctx); - String gradlewBatChecksum = downloadScript(WRAPPER_BATCH_LOCATION, wrapper, "windows", ctx); - - lock.lock(); - allDownloadedVersions.put(v, new GradleWrapperScriptLoader.Version(v, gradlewChecksum, gradlewBatChecksum)); - - List sortedVersions = new ArrayList<>(allDownloadedVersions.keySet()); - sortedVersions.sort(new LatestRelease(null).reversed()); - try (BufferedWriter writer = Files.newBufferedWriter(WRAPPER_SCRIPTS.resolve("versions.csv"))) { - writer.write("version,gradlew,gradlewBat\n"); - for (String sortedVersion : sortedVersions) { - GradleWrapperScriptLoader.Version version1 = allDownloadedVersions.get(sortedVersion); - writer.write(sortedVersion + "," + version1.getGradlewChecksum() + "," + version1.getGradlewBatChecksum() + "\n"); - } - } - System.out.printf("%03d: %s downloaded.%s%n", i.incrementAndGet(), v, threadName); - } catch (Throwable t) { - // FIXME There are some wrappers that are not downloading successfully. Why? - System.out.printf("%03d: %s failed to download: %s.%s%n", i.incrementAndGet(), v, t.getMessage(), threadName); - return null; - } finally { - lock.unlock(); - } - return null; - }).collect(Collectors.toList())); - - while (pool.getActiveThreadCount() > 0) { - //noinspection BusyWait - Thread.sleep(100); - } - } - - private static String downloadScript(Path wrapperScriptLocation, GradleWrapper wrapper, String os, - InMemoryExecutionContext ctx) throws IOException, NoSuchAlgorithmException { - InputStream is = Remote.builder(wrapperScriptLocation) - .build( - URI.create(wrapper.getDistributionInfos().getDownloadUrl()), - "gradle-[^\\/]+/(?:.*\\/)+gradle-plugins-.*\\.jar", - "org/gradle/api/internal/plugins/" + os + "StartScript.txt" - ) - .getInputStream(ctx); - - byte[] scriptText = StringUtils.readFully(is).getBytes(StandardCharsets.UTF_8); - Adler32 adler32 = new Adler32(); - adler32.update(scriptText, 0, scriptText.length); - - String scriptChecksum = Long.toHexString(adler32.getValue()); - Path scriptChecksumPath = WRAPPER_SCRIPTS.resolve(os).resolve(scriptChecksum + ".txt"); - if (!Files.exists(scriptChecksumPath)) { - Files.write(scriptChecksumPath, scriptText); - } - - return scriptChecksum; - } -} diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/GradleWrapperScriptLoader.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/GradleWrapperScriptLoader.java deleted file mode 100644 index 9b198032710..00000000000 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/GradleWrapperScriptLoader.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - *

- * 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 - *

- * https://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 org.openrewrite.gradle.internal; - -import lombok.Getter; -import lombok.Value; -import org.jspecify.annotations.Nullable; -import org.openrewrite.gradle.util.GradleWrapper; -import org.openrewrite.marker.Markup; -import org.openrewrite.remote.Remote; -import org.openrewrite.remote.RemoteResource; -import org.openrewrite.semver.LatestRelease; - -import java.io.*; -import java.util.NavigableMap; -import java.util.TreeMap; - -import static java.util.Objects.requireNonNull; - -public class GradleWrapperScriptLoader { - @Getter - private final NavigableMap allVersions = new TreeMap<>( - new LatestRelease(null)); - - public GradleWrapperScriptLoader() { - try (BufferedReader in = new BufferedReader(new InputStreamReader(requireNonNull( - getClass().getResourceAsStream("/META-INF/rewrite/gradle-wrapper/versions.csv"))))) { - in.readLine(); // header - String line; - while ((line = in.readLine()) != null) { - String[] row = line.split(","); - allVersions.put(row[0], new Version(row[0], row[1], row[2])); - } - } catch (IOException e) { - throw new UncheckedIOException(e); - } - } - - /** - * When the requested version is unavailable we pick the nearest available. - */ - public Nearest findNearest(@Nullable String requestedVersion) { - if (requestedVersion == null) { - return new Nearest(null, allVersions.lastEntry().getValue()); - } - return new Nearest(requestedVersion, allVersions.floorEntry(requestedVersion).getValue()); - } - - @SuppressWarnings("resource") - @Value - public static class Nearest { - @Nullable - String requestedVersion; - - Version resolved; - - public RemoteResource gradlew() { - InputStream script = getClass().getResourceAsStream("/META-INF/rewrite/gradle-wrapper/unix/" + resolved.getGradlewChecksum() + ".txt"); - return maybeWarn(Remote.builder(GradleWrapper.WRAPPER_SCRIPT_LOCATION) - .description(String.format("Unix Gradle wrapper script template for %s", resolved.getVersion())) - .build(requireNonNull(script))); - } - - public RemoteResource gradlewBat() { - InputStream script = getClass().getResourceAsStream("/META-INF/rewrite/gradle-wrapper/windows/" + resolved.getGradlewBatChecksum() + ".txt"); - return maybeWarn(Remote.builder(GradleWrapper.WRAPPER_BATCH_LOCATION) - .description(String.format("Windows Gradle wrapper script template for %s", resolved.getVersion())) - .build(requireNonNull(script))); - } - - public RemoteResource maybeWarn(RemoteResource script) { - if (!resolved.getVersion().equals(requestedVersion)) { - return Markup.warn(script, new Exception( - "rewrite-gradle does not contain a script for requested version" + - (requestedVersion == null ? "" : requestedVersion + ". ") + - "Using the script from nearest available version " + resolved.getVersion() + " instead.")); - } - return script; - } - } - - @Value - public static class Version { - String version; - String gradlewChecksum; - String gradlewBatChecksum; - } -} diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/InsertDependencyComparator.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/InsertDependencyComparator.java index df3a54e1e03..691a2e243d2 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/InsertDependencyComparator.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/InsertDependencyComparator.java @@ -16,6 +16,8 @@ package org.openrewrite.gradle.internal; import lombok.Getter; +import org.openrewrite.gradle.util.Dependency; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.tree.G; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/package-info.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/package-info.java deleted file mode 100644 index 45276869647..00000000000 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - *

- * 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 - *

- * https://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. - */ -@NullMarked -package org.openrewrite.gradle.internal; - -import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java index 7023a20c6be..fe26fee92cc 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java @@ -25,7 +25,7 @@ import org.openrewrite.gradle.marker.GradlePluginDescriptor; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.marker.GradleSettings; -import org.openrewrite.gradle.internal.ChangeStringLiteral; +import org.openrewrite.gradle.util.ChangeStringLiteral; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java index 96f8b964211..329cec7121c 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java @@ -24,7 +24,7 @@ import org.openrewrite.gradle.IsSettingsGradle; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.marker.GradleSettings; -import org.openrewrite.gradle.internal.ChangeStringLiteral; +import org.openrewrite.gradle.util.ChangeStringLiteral; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/security/UseHttpsForRepositories.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/security/UseHttpsForRepositories.java index 7a3e9ceea5b..3057c7e214b 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/security/UseHttpsForRepositories.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/security/UseHttpsForRepositories.java @@ -19,7 +19,7 @@ import org.openrewrite.Preconditions; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.gradle.internal.ChangeStringLiteral; +import org.openrewrite.gradle.util.ChangeStringLiteral; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/table/package-info.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/table/package-info.java deleted file mode 100644 index 9598e68e4c4..00000000000 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/table/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - *

- * 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 - *

- * https://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. - */ -@NullMarked -package org.openrewrite.gradle.table; - -import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java index 2ff564169ae..fd73e81388d 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java @@ -21,7 +21,7 @@ import org.openrewrite.Cursor; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; -import org.openrewrite.gradle.internal.DependencyStringNotationConverter; +import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.StringUtils; import org.openrewrite.java.MethodMatcher; @@ -97,7 +97,7 @@ public Matcher artifactId(@Nullable String artifactId) { return null; } - org.openrewrite.gradle.internal.Dependency dependency = null; + org.openrewrite.gradle.util.Dependency dependency = null; Expression argument = methodInvocation.getArguments().get(0); if (argument instanceof J.Literal || argument instanceof G.GString || argument instanceof G.MapEntry || argument instanceof G.MapLiteral) { dependency = parseDependency(methodInvocation.getArguments()); @@ -203,7 +203,7 @@ private boolean withinDependencyConstraintsBlock(Cursor cursor) { return withinBlock(cursor, "constraints") && withinDependenciesBlock(cursor); } - private org.openrewrite.gradle.internal.@Nullable Dependency parseDependency(List arguments) { + private org.openrewrite.gradle.util.@Nullable Dependency parseDependency(List arguments) { Expression argument = arguments.get(0); if (argument instanceof J.Literal) { return DependencyStringNotationConverter.parse((String) ((J.Literal) argument).getValue()); @@ -226,7 +226,7 @@ private boolean withinDependencyConstraintsBlock(Cursor cursor) { return null; } - private static org.openrewrite.gradle.internal.@Nullable Dependency getMapEntriesDependency(List arguments) { + private static org.openrewrite.gradle.util.@Nullable Dependency getMapEntriesDependency(List arguments) { String group = null; String artifact = null; @@ -255,7 +255,7 @@ private boolean withinDependencyConstraintsBlock(Cursor cursor) { return null; } - return new org.openrewrite.gradle.internal.Dependency(group, artifact, null, null, null); + return new org.openrewrite.gradle.util.Dependency(group, artifact, null, null, null); } } } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/ChangeStringLiteral.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/ChangeStringLiteral.java similarity index 96% rename from rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/ChangeStringLiteral.java rename to rewrite-gradle/src/main/java/org/openrewrite/gradle/util/ChangeStringLiteral.java index 8bef7829490..605224c0ec4 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/ChangeStringLiteral.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/ChangeStringLiteral.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.openrewrite.gradle.internal; +package org.openrewrite.gradle.util; import org.openrewrite.Incubating; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/Dependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/Dependency.java similarity index 97% rename from rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/Dependency.java rename to rewrite-gradle/src/main/java/org/openrewrite/gradle/util/Dependency.java index a6e0240c012..9fd440d188a 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/Dependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/Dependency.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.openrewrite.gradle.internal; +package org.openrewrite.gradle.util; import lombok.EqualsAndHashCode; import lombok.Value; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/DependencyStringNotationConverter.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DependencyStringNotationConverter.java similarity index 98% rename from rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/DependencyStringNotationConverter.java rename to rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DependencyStringNotationConverter.java index dbb9cb86a1b..47646439ce1 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/internal/DependencyStringNotationConverter.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DependencyStringNotationConverter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.openrewrite.gradle.internal; +package org.openrewrite.gradle.util; import org.jspecify.annotations.Nullable; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DistributionInfos.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DistributionInfos.java index 59bc8adf053..0a0040e1526 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DistributionInfos.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DistributionInfos.java @@ -18,8 +18,6 @@ import lombok.Value; import org.jspecify.annotations.Nullable; import org.openrewrite.Checksum; -import org.openrewrite.ExecutionContext; -import org.openrewrite.HttpSenderExecutionContextView; import org.openrewrite.ipc.http.HttpSender; import java.io.IOException; @@ -35,15 +33,11 @@ public class DistributionInfos { @Nullable Checksum wrapperJarChecksum; - public static DistributionInfos fetch(GradleWrapper.DistributionType distributionType, - GradleWrapper.GradleVersion gradleVersion, ExecutionContext ctx) throws IOException { - HttpSender httpSender = HttpSenderExecutionContextView.view(ctx).getHttpSender(); + static DistributionInfos fetch(HttpSender httpSender, GradleWrapper.DistributionType distributionType, + GradleWrapper.GradleVersion gradleVersion) throws IOException { String downloadUrl = toDistTypeUrl(distributionType, gradleVersion.getDownloadUrl()); Checksum checksum = fetchChecksum(httpSender, toDistTypeUrl(distributionType, gradleVersion.getChecksumUrl())); - Checksum jarChecksum = gradleVersion.getWrapperChecksumUrl() == null ? - null : - fetchChecksum(httpSender, gradleVersion.getWrapperChecksumUrl()); - + Checksum jarChecksum = fetchChecksum(httpSender, gradleVersion.getWrapperChecksumUrl()); return new DistributionInfos(downloadUrl, checksum, jarChecksum); } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/GradleWrapper.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/GradleWrapper.java index d19762162e8..806b1a13b75 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/GradleWrapper.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/GradleWrapper.java @@ -22,12 +22,9 @@ import lombok.Value; import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.gradle.internal.GradleWrapperScriptLoader; import org.openrewrite.internal.StringUtils; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.remote.Remote; -import org.openrewrite.remote.RemoteArchive; -import org.openrewrite.remote.RemoteResource; import org.openrewrite.semver.LatestRelease; import org.openrewrite.semver.Semver; import org.openrewrite.semver.VersionComparator; @@ -69,32 +66,24 @@ public static GradleWrapper create(@Nullable String distributionTypeName, @Nulla new LatestRelease(null) : requireNonNull(Semver.validate(version, null).getValue()); - List allVersions = listAllVersions(repositoryUrl, ctx); - GradleVersion gradleVersion = allVersions.stream() - .filter(v -> versionComparator.isValid(null, v.version)) - .max((v1, v2) -> versionComparator.compare(null, v1.version, v2.version)) - .orElseThrow(() -> new IllegalStateException("Expected to find at least one Gradle wrapper version to select from.")); - - try { - DistributionInfos infos = DistributionInfos.fetch(distributionType, gradleVersion, ctx); - return new GradleWrapper(gradleVersion.version, infos); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - } - - public static List listAllVersions(@Nullable String repositoryUrl, ExecutionContext ctx) { - HttpSender httpSender = HttpSenderExecutionContextView.view(ctx).getHttpSender(); + HttpSender httpSender = HttpSenderExecutionContextView.view(ctx).getLargeFileHttpSender(); String gradleVersionsUrl = StringUtils.isBlank(repositoryUrl) ? "https://services.gradle.org/versions/all" : repositoryUrl; try (HttpSender.Response resp = httpSender.send(httpSender.get(gradleVersionsUrl).build())) { if (resp.isSuccessful()) { - return new ObjectMapper() + List allVersions = new ObjectMapper() .registerModule(new ParameterNamesModule()) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .readValue(resp.getBody(), new TypeReference>() { }); + GradleVersion gradleVersion = allVersions.stream() + .filter(v -> versionComparator.isValid(null, v.version)) + .max((v1, v2) -> versionComparator.compare(null, v1.version, v2.version)) + .orElseThrow(() -> new IllegalStateException("Expected to find at least one Gradle wrapper version to select from.")); + + DistributionInfos infos = DistributionInfos.fetch(httpSender, distributionType, gradleVersion); + return new GradleWrapper(gradleVersion.version, infos); } - throw new IOException("Could not get Gradle versions. HTTP " + resp.getCode()); + throw new IOException("Could not get Gradle versions at: " + gradleVersionsUrl); } catch (IOException e) { throw new UncheckedIOException(e); } @@ -102,9 +91,13 @@ public static List listAllVersions(@Nullable String repositoryUrl private static final Pattern GRADLE_VERSION_PATTERN = Pattern.compile("gradle-([0-9.]+)"); + // Supports org.openrewrite.gradle.toolingapi.Assertions.withToolingApi(URI) + // This method is provided to support recipe development at organizations which require gradle to come from + // internal repositories. This is not used in contexts where services.gradle.org is accessible + /** * Construct a Gradle wrapper from a URI. - * Can be used in contexts where services.gradle.org, normally used for version lookups, is unavailable. + * Can be used in contexts where servcies.gradle.org, normally used for version lookups, is unavailable. */ public static GradleWrapper create(URI fullDistributionUri, @SuppressWarnings("unused") ExecutionContext ctx) { String version = ""; @@ -129,22 +122,32 @@ public String getPropertiesFormattedUrl() { static final FileAttributes WRAPPER_JAR_FILE_ATTRIBUTES = new FileAttributes(null, null, null, true, true, false, 0); - public RemoteArchive wrapperJar() { - return Remote.builder(WRAPPER_JAR_LOCATION) - .build(URI.create(distributionInfos.getDownloadUrl()), "gradle-[^\\/]+\\/(?:.*\\/)+gradle-(plugins|wrapper)-(?!shared).*\\.jar", "gradle-wrapper.jar"); + public Remote wrapperJar() { + return Remote.builder( + WRAPPER_JAR_LOCATION, + URI.create(distributionInfos.getDownloadUrl()) + ).build("gradle-[^\\/]+\\/(?:.*\\/)+gradle-(plugins|wrapper)-(?!shared).*\\.jar", "gradle-wrapper.jar"); } - public RemoteArchive wrapperJar(SourceFile before) { - return Remote.builder(before) - .build(URI.create(distributionInfos.getDownloadUrl()), "gradle-[^\\/]+\\/(?:.*\\/)+gradle-(plugins|wrapper)-(?!shared).*\\.jar", "gradle-wrapper.jar"); + public Remote wrapperJar(SourceFile before) { + return Remote.builder( + before, + URI.create(distributionInfos.getDownloadUrl()) + ).build("gradle-[^\\/]+\\/(?:.*\\/)+gradle-(plugins|wrapper)-(?!shared).*\\.jar", "gradle-wrapper.jar"); } - public RemoteResource gradlew() { - return new GradleWrapperScriptLoader().findNearest(version).gradlew(); + public Remote gradlew() { + return Remote.builder( + WRAPPER_SCRIPT_LOCATION, + URI.create(distributionInfos.getDownloadUrl()) + ).build("gradle-[^\\/]+/(?:.*/)+gradle-plugins-.*\\.jar", "org/gradle/api/internal/plugins/unixStartScript.txt"); } - public RemoteResource gradlewBat() { - return new GradleWrapperScriptLoader().findNearest(version).gradlewBat(); + public Remote gradlewBat() { + return Remote.builder( + WRAPPER_BATCH_LOCATION, + URI.create(distributionInfos.getDownloadUrl()) + ).build("gradle-[^\\/]+/(?:.*/)+gradle-plugins-.*\\.jar", "org/gradle/api/internal/plugins/windowsStartScript.txt"); } public enum DistributionType { @@ -153,15 +156,10 @@ public enum DistributionType { } @Value - public static class GradleVersion { + static class GradleVersion { String version; String downloadUrl; String checksumUrl; - - /** - * Is null for every non-release version (e.g. RCs and milestones). - */ - @Nullable String wrapperChecksumUrl; } } diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/12dcd60b.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/12dcd60b.txt deleted file mode 100644 index e8190bfe6cf..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/12dcd60b.txt +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/27be095c.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/27be095c.txt deleted file mode 100644 index 7c081de8b87..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/27be095c.txt +++ /dev/null @@ -1,171 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -for s in "\${@}" ; do - s=\"\$s\" - APP_ARGS=\$APP_ARGS" "\$s -done - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- "\$DEFAULT_JVM_OPTS" "\$JAVA_OPTS" "\$${optsEnvironmentVar}" <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "\$(uname)" = "Darwin" ] && [ "\$HOME" = "\$PWD" ]; then - cd "\$(dirname "\$0")" -fi - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/2aa59cb0.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/2aa59cb0.txt deleted file mode 100644 index 4e7a0da153f..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/2aa59cb0.txt +++ /dev/null @@ -1,292 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -# Discard cd standard output in case \$CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=\$( cd -P "\${APP_HOME:-./}${appHomeRelativePath}" > /dev/null && printf '%s\n' "\$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -<% /* -# The DEFAULT_JVM_OPTS variable is intentionally defined here to allow using cygwin-processed APP_HOME. -# So far the only way to inject APP_HOME reference into DEFAULT_JVM_OPTS is to post-process the start script; the declaration is a good anchor to do that. -*/ %> -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect \${Hostname} to be expanded, as it is an environment variable and will be -# treated as '\${Hostname}' itself on the command line. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/2c2f80d5.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/2c2f80d5.txt deleted file mode 100644 index 643dc5b8b79..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/2c2f80d5.txt +++ /dev/null @@ -1,290 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -# Discard cd standard output in case \$CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" > /dev/null && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -<% /* -# The DEFAULT_JVM_OPTS variable is intentionally defined here to allow using cygwin-processed APP_HOME. -# So far the only way to inject APP_HOME reference into DEFAULT_JVM_OPTS is to post-process the start script; the declaration is a good anchor to do that. -*/ %> -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect \${Hostname} to be expanded, as it is an environment variable and will be -# treated as '\${Hostname}' itself on the command line. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/318f9d0c.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/318f9d0c.txt deleted file mode 100644 index f082fb12074..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/318f9d0c.txt +++ /dev/null @@ -1,292 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -# Discard cd standard output in case \$CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=\$( cd -P "\${APP_HOME:-./}${appHomeRelativePath}" > /dev/null && printf '%s\\n' "\$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -<% /* -# The DEFAULT_JVM_OPTS variable is intentionally defined here to allow using cygwin-processed APP_HOME. -# So far the only way to inject APP_HOME reference into DEFAULT_JVM_OPTS is to post-process the start script; the declaration is a good anchor to do that. -*/ %> -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect \${Hostname} to be expanded, as it is an environment variable and will be -# treated as '\${Hostname}' itself on the command line. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/3a7e8b97.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/3a7e8b97.txt deleted file mode 100644 index fd3290ec9a9..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/3a7e8b97.txt +++ /dev/null @@ -1,290 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -# Discard cd standard output in case \$CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" > /dev/null && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -<% /* -# The DEFAULT_JVM_OPTS variable is intentionally defined here to allow using cygwin-processed APP_HOME. -# So far the only way to inject APP_HOME reference into DEFAULT_JVM_OPTS is to post-process the start script; the declaration is a good anchor to do that. -*/ %> -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect \${Hostname} to be expanded, as it is an environment variable and will be -# treated as '\${Hostname}' itself on the command line. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/4d0d6bb.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/4d0d6bb.txt deleted file mode 100644 index 5fb166b4a56..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/4d0d6bb.txt +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if \$cygwin ; then - [ -n "\$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "\$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" -APP_HOME="`pwd -P`" -cd "\$SAVED" - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/547edccc.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/547edccc.txt deleted file mode 100644 index bd7005a3785..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/547edccc.txt +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if \$cygwin ; then - [ -n "\$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "\$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" -APP_HOME="`pwd -P`" -cd "\$SAVED" - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query businessSystem maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/5760ee9b.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/5760ee9b.txt deleted file mode 100644 index 6c2db0679ba..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/5760ee9b.txt +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * \$DEFAULT_JVM_OPTS, \$JAVA_OPTS, and \$${optsEnvironmentVar} can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/5aac1e11.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/5aac1e11.txt deleted file mode 100644 index 1d3c58f853c..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/5aac1e11.txt +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "\$*" -} - -die () { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done - echo " " -} -APP_ARGS=\$(save "\$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "\$(uname)" = "Darwin" ] && [ "\$HOME" = "\$PWD" ]; then - cd "\$(dirname "\$0")" -fi - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/63c55010.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/63c55010.txt deleted file mode 100644 index 077e52752cf..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/63c55010.txt +++ /dev/null @@ -1,289 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -<% /* -# The DEFAULT_JVM_OPTS variable is intentionally defined here to allow using cygwin-processed APP_HOME. -# So far the only way to inject APP_HOME reference into DEFAULT_JVM_OPTS is to post-process the start script; the declaration is a good anchor to do that. -*/ %> -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Collect all arguments for the java command; -# * \$DEFAULT_JVM_OPTS, \$JAVA_OPTS, and \$${optsEnvironmentVar} can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/6e691335.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/6e691335.txt deleted file mode 100644 index 53c0d885d5f..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/6e691335.txt +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [[ "\$(uname)" == "Darwin" ]] && [[ "\$HOME" == "\$PWD" ]]; then - cd "\$(dirname "\$0")" -fi - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7129bfb3.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7129bfb3.txt deleted file mode 100644 index 5c256f6fab1..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7129bfb3.txt +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7545ee5b.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7545ee5b.txt deleted file mode 100644 index 7c5bcf694dd..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7545ee5b.txt +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * \$DEFAULT_JVM_OPTS, \$JAVA_OPTS, and \$${optsEnvironmentVar} can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7bdb49ed.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7bdb49ed.txt deleted file mode 100644 index b68f1f91803..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/7bdb49ed.txt +++ /dev/null @@ -1,286 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -<% /* -# The DEFAULT_JVM_OPTS variable is intentionally defined here to allow using cygwin-processed APP_HOME. -# So far the only way to inject APP_HOME reference into DEFAULT_JVM_OPTS is to post-process the start script; the declaration is a good anchor to do that. -*/ %> -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Collect all arguments for the java command; -# * \$DEFAULT_JVM_OPTS, \$JAVA_OPTS, and \$${optsEnvironmentVar} can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8dae574.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8dae574.txt deleted file mode 100644 index 19356c84284..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8dae574.txt +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# 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. -# - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "\$*" -} - -die () { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done - echo " " -} -APP_ARGS=\$(save "\$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "\$(uname)" = "Darwin" ] && [ "\$HOME" = "\$PWD" ]; then - cd "\$(dirname "\$0")" -fi - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8e0d96aa.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8e0d96aa.txt deleted file mode 100644 index 9bc4bd8646d..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8e0d96aa.txt +++ /dev/null @@ -1,278 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/master/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" && pwd -P ) || exit - -APP_NAME="${applicationName}" -APP_BASE_NAME=\${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * \$DEFAULT_JVM_OPTS, \$JAVA_OPTS, and \$${optsEnvironmentVar} can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8fdcd9ad.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8fdcd9ad.txt deleted file mode 100644 index 3c9db91680e..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/8fdcd9ad.txt +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if \$cygwin ; then - [ -n "\$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "\$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" -APP_HOME="`pwd -P`" -cd "\$SAVED" - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/91001e71.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/91001e71.txt deleted file mode 100644 index 53f4f035249..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/91001e71.txt +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -save ( ) { - for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done - echo " " -} -APP_ARGS=\$(save "\$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "\$(uname)" = "Darwin" ] && [ "\$HOME" = "\$PWD" ]; then - cd "\$(dirname "\$0")" -fi - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/97200f5d.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/97200f5d.txt deleted file mode 100644 index 755e4881791..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/97200f5d.txt +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# 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 -# -# https://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. -# - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "\$*" -} - -die () { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>MODULE_PATH=$modulePath<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "\$cygwin" = "true" -o "\$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - <% if ( mainClassName.startsWith('--module ') ) { %>MODULE_PATH=`cygpath --path --mixed "\$MODULE_PATH"`<% } %> - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=`expr \$i + 1` - done - case \$i in - 0) set -- ;; - 1) set -- "\$args0" ;; - 2) set -- "\$args0" "\$args1" ;; - 3) set -- "\$args0" "\$args1" "\$args2" ;; - 4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - 5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - 6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - 7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - 8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - 9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done - echo " " -} -APP_ARGS=`save "\$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "\"\$MODULE_PATH\"" <% } %>${mainClassName} "\$APP_ARGS" - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/a4d9e5e7.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/a4d9e5e7.txt deleted file mode 100644 index 84f045578be..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/a4d9e5e7.txt +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# 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 -# -# https://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. -# - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "\$*" -} - -die () { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done - echo " " -} -APP_ARGS=\$(save "\$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "\$(uname)" = "Darwin" ] && [ "\$HOME" = "\$PWD" ]; then - cd "\$(dirname "\$0")" -fi - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/ad2cdb0f.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/ad2cdb0f.txt deleted file mode 100644 index 8732f7fd9ff..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/ad2cdb0f.txt +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if \$cygwin ; then - [ -n "\$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "\$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >&- -APP_HOME="`pwd -P`" -cd "\$SAVED" >&- - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/b6a5b769.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/b6a5b769.txt deleted file mode 100644 index 35b1be7de12..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/b6a5b769.txt +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# 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 -# -# https://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. -# - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "\$*" -} - -die () { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "\$cygwin" = "true" -o "\$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=`expr \$i + 1` - done - case \$i in - 0) set -- ;; - 1) set -- "\$args0" ;; - 2) set -- "\$args0" "\$args1" ;; - 3) set -- "\$args0" "\$args1" "\$args2" ;; - 4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - 5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - 6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - 7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - 8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - 9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done - echo " " -} -APP_ARGS=`save "\$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS" - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/be340f5d.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/be340f5d.txt deleted file mode 100644 index 505325e09f2..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/be340f5d.txt +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# 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 -# -# https://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. -# - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "\$*" -} - -die () { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>MODULE_PATH=$modulePath<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "\$cygwin" = "true" -o "\$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=`cygpath --path --mixed "\$MODULE_PATH"`<% } %> - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=`expr \$i + 1` - done - case \$i in - 0) set -- ;; - 1) set -- "\$args0" ;; - 2) set -- "\$args0" "\$args1" ;; - 3) set -- "\$args0" "\$args1" "\$args2" ;; - 4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - 5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - 6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - 7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - 8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - 9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done - echo " " -} -APP_ARGS=`save "\$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "\"\$MODULE_PATH\"" <% } %>${mainClassName} "\$APP_ARGS" - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/bf16f1fe.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/bf16f1fe.txt deleted file mode 100644 index 3101b4fa82f..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/bf16f1fe.txt +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# 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 -# -# https://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. -# - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >/dev/null -APP_HOME="`pwd -P`" -cd "\$SAVED" >/dev/null - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "\$*" -} - -die () { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" -a "\$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "\$cygwin" = "true" -o "\$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\\\n "\$i" | sed "s/'/'\\\\\\\\''/g;1s/^/'/;\\\$s/\\\$/' \\\\\\\\/" ; done - echo " " -} -APP_ARGS=\$(save "\$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} <% if ( appNameSystemProperty ) { %>"\"-D${appNameSystemProperty}=\$APP_BASE_NAME\"" <% } %>-classpath "\"\$CLASSPATH\"" ${mainClassName} "\$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "\$(uname)" = "Darwin" ] && [ "\$HOME" = "\$PWD" ]; then - cd "\$(dirname "\$0")" -fi - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/ec6799f9.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/ec6799f9.txt deleted file mode 100644 index 047b108f08c..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/ec6799f9.txt +++ /dev/null @@ -1,292 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -# Discard cd standard output in case \$CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=\$( cd -P "\${APP_HOME:-./}${appHomeRelativePath}" > /dev/null && printf '%s\\n' "\$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -<% /* -# The DEFAULT_JVM_OPTS variable is intentionally defined here to allow using cygwin-processed APP_HOME. -# So far the only way to inject APP_HOME reference into DEFAULT_JVM_OPTS is to post-process the start script; the declaration is a good anchor to do that. -*/ %> -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect \${Hostname} to be expanded, as it is an environment variable and will be -# treated as '\${Hostname}' itself on the command line. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/f27d7133.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/f27d7133.txt deleted file mode 100644 index 6d5fc0e1cb7..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/f27d7133.txt +++ /dev/null @@ -1,272 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/master/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" && pwd -P ) || exit - -APP_NAME="${applicationName}" -APP_BASE_NAME=\${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * \$DEFAULT_JVM_OPTS, \$JAVA_OPTS, and \$${optsEnvironmentVar} can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/f642e19f.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/f642e19f.txt deleted file mode 100644 index bec72be175c..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/f642e19f.txt +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if \$cygwin ; then - [ -n "\$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "\$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >&- -APP_HOME="`pwd -P`" -cd "\$SAVED" >&- - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/fb8375e7.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/fb8375e7.txt deleted file mode 100644 index 64f56d08b98..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/fb8375e7.txt +++ /dev/null @@ -1,290 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# 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 -# -# https://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. -# - -############################################################################## -# -# ${applicationName} start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh ${applicationName} -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «\$var», «\${var}», «\${var:-default}», «\${var+SET}», -# «\${var#prefix}», «\${var%suffix}», and «\$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "\$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and ${optsEnvironmentVar}) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -#<% /* -# ... and if you're reading this, this IS the template just mentioned. -# -# This template is processed by -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/java/org/gradle/api/internal/plugins/UnixStartScriptGenerator.java -# -# Gradle is a meta-build system used by the project that you're building -# or installing. It's like autoconf but for projects that are written in -# Java and related languages. It's also used to build parts of the Gradle -# project itself. -# -# The Groovy template language is run in two phases. -# -# 1. Any character following \ is passed unmodified through to the -# next phase, while the \ is removed. Any other $ followed by -# varName or {varName} is replaced by the value of that variable. -# -# 2. The result of the first phase is parsed and run in a similar -# manner to JSP or MASON or PHP: anything within < % ... % > is a -# code block, anything else is sent as output, subject to the -# flow imposed by any code segments. -# -# 3. The "output" is a POSIX shell script, which has its own ideas about -# escaping with backslashes, so to get «\» you need to write «\\\\» -# and to get «$» you need to write «\\\$». -# -# For more details about the Groovy Template Engine, see -# https://docs.groovy-lang.org/next/html/documentation/ section §3.15 -# (Template Engines) for details. -# -# (An example invocation of this template is from -# https://github.com/gradle/gradle/blob/HEAD/subprojects/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java -# within the Gradle project, which builds "gradlew".) -# */ %> -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: \$0 may be a link -app_path=\$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=\${app_path%"\${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "\$app_path" ] -do - ls=\$( ls -ld "\$app_path" ) - link=\${ls#*' -> '} - case \$link in #( - /*) app_path=\$link ;; #( - *) app_path=\$APP_HOME\$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=\${0##*/} -# Discard cd standard output in case \$CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=\$( cd "\${APP_HOME:-./}${appHomeRelativePath}" > /dev/null && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "\$*" -} >&2 - -die () { - echo - echo "\$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "\$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %> -MODULE_PATH=$modulePath -<% } %> - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=\$JAVA_HOME/jre/sh/java - else - JAVACMD=\$JAVA_HOME/bin/java - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "\$cygwin" && ! "\$darwin" && ! "\$nonstop" ; then - case \$MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=\$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case \$MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "\$MAX_FD" || - warn "Could not set maximum file descriptor limit to \$MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and ${optsEnvironmentVar} environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "\$cygwin" || "\$msys" ; then - APP_HOME=\$( cygpath --path --mixed "\$APP_HOME" ) - CLASSPATH=\$( cygpath --path --mixed "\$CLASSPATH" ) -<% if ( mainClassName.startsWith('--module ') ) { %> MODULE_PATH=\$( cygpath --path --mixed "\$MODULE_PATH" )<% } %> - JAVACMD=\$( cygpath --unix "\$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case \$arg in #( - -*) false ;; # don't mess with options #( - /?*) t=\${arg#/} t=/\${t%%/*} # looks like a POSIX filepath - [ -e "\$t" ] ;; #( - *) false ;; - esac - then - arg=\$( cygpath --path --ignore --mixed "\$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "\$@" "\$arg" # push replacement arg - done -fi - -<% /* -# The DEFAULT_JVM_OPTS variable is intentionally defined here to allow using cygwin-processed APP_HOME. -# So far the only way to inject APP_HOME reference into DEFAULT_JVM_OPTS is to post-process the start script; the declaration is a good anchor to do that. -*/ %> -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -# Collect all arguments for the java command; -# * \$DEFAULT_JVM_OPTS, \$JAVA_OPTS, and \$${optsEnvironmentVar} can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \\ -<% if ( appNameSystemProperty ) { - %> "-D${appNameSystemProperty}=\$APP_BASE_NAME" \\ -<% } %> -classpath "\$CLASSPATH" \\ -<% if ( mainClassName.startsWith('--module ') ) { - %> --module-path "\$MODULE_PATH" \\ -<% } %> ${mainClassName} \\ - "\$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"\$var" ) && -# set -- "\${ARGS[@]}" "\$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- \$( - printf '%s\\n' "\$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar}" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' | - tr '\\n' ' ' - )" '"\$@"' - -exec "\$JAVACMD" "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/fdd0b9a9.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/fdd0b9a9.txt deleted file mode 100644 index e8a187a9b2d..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/unix/fdd0b9a9.txt +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## ${applicationName} start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -DEFAULT_JVM_OPTS=${defaultJvmOpts} - -APP_NAME="${applicationName}" -APP_BASE_NAME=`basename "\$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "\$*" -} - -die ( ) { - echo - echo "\$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: \$0 may be a link -PRG="\$0" -# Need this for relative symlinks. -while [ -h "\$PRG" ] ; do - ls=`ls -ld "\$PRG"` - link=`expr "\$ls" : '.*-> \\(.*\\)\$'` - if expr "\$link" : '/.*' > /dev/null; then - PRG="\$link" - else - PRG=`dirname "\$PRG"`"/\$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"\$PRG\"`/${appHomeRelativePath}" >&- -APP_HOME="`pwd -P`" -cd "\$SAVED" >&- - -CLASSPATH=$classpath - -# Determine the Java command to use to start the JVM. -if [ -n "\$JAVA_HOME" ] ; then - if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="\$JAVA_HOME/jre/sh/java" - else - JAVACMD="\$JAVA_HOME/bin/java" - fi - if [ ! -x "\$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: \$JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "\$cygwin" = "false" -a "\$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ \$? -eq 0 ] ; then - if [ "\$MAX_FD" = "maximum" -o "\$MAX_FD" = "max" ] ; then - MAX_FD="\$MAX_FD_LIMIT" - fi - ulimit -n \$MAX_FD - if [ \$? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: \$MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: \$MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if \$darwin; then - GRADLE_OPTS="\$GRADLE_OPTS \\"-Xdock:name=\$APP_NAME\\" \\"-Xdock:icon=\$APP_HOME/media/gradle.icns\\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if \$cygwin ; then - APP_HOME=`cygpath --path --mixed "\$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "\$CLASSPATH"` - JAVACMD=`cygpath --unix "\$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in \$ROOTDIRSRAW ; do - ROOTDIRS="\$ROOTDIRS\$SEP\$dir" - SEP="|" - done - OURCYGPATTERN="(^(\$ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "\$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="\$OURCYGPATTERN|(\$GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "\$@" ; do - CHECK=`echo "\$arg"|egrep -c "\$OURCYGPATTERN" -` - CHECK2=`echo "\$arg"|egrep -c "^-"` ### Determine if an option - - if [ \$CHECK -ne 0 ] && [ \$CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args\$i`=`cygpath --path --ignore --mixed "\$arg"` - else - eval `echo args\$i`="\"\$arg\"" - fi - i=\$((i+1)) - done - case \$i in - (0) set -- ;; - (1) set -- "\$args0" ;; - (2) set -- "\$args0" "\$args1" ;; - (3) set -- "\$args0" "\$args1" "\$args2" ;; - (4) set -- "\$args0" "\$args1" "\$args2" "\$args3" ;; - (5) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" ;; - (6) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" ;; - (7) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" ;; - (8) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" ;; - (9) set -- "\$args0" "\$args1" "\$args2" "\$args3" "\$args4" "\$args5" "\$args6" "\$args7" "\$args8" ;; - esac -fi - -# Split up the JVM_OPTS And ${optsEnvironmentVar} values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("\$@") -} -eval splitJvmOpts \$DEFAULT_JVM_OPTS \$JAVA_OPTS \$${optsEnvironmentVar} -<% if ( appNameSystemProperty ) { %>JVM_OPTS[\${#JVM_OPTS[*]}]="-D${appNameSystemProperty}=\$APP_BASE_NAME"<% } %> - -exec "\$JAVACMD" "\${JVM_OPTS[@]}" -classpath "\$CLASSPATH" ${mainClassName} "\$@" diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/versions.csv b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/versions.csv deleted file mode 100644 index 5ca6249a436..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/versions.csv +++ /dev/null @@ -1,258 +0,0 @@ -version,gradlew,gradlewBat -8.13-milestone-1,318f9d0c,8018d7e6 -8.13-milestone-3,318f9d0c,8018d7e6 -8.13-milestone-2,318f9d0c,8018d7e6 -8.13-20250128002155+0000,ec6799f9,8018d7e6 -8.13-20250127102731+0000,ec6799f9,8018d7e6 -8.12.1-milestone-1,318f9d0c,8018d7e6 -8.12.1,318f9d0c,8018d7e6 -8.12.1-20250124123609+0000,318f9d0c,8018d7e6 -8.12-rc-1,318f9d0c,8018d7e6 -8.12-rc-2,318f9d0c,8018d7e6 -8.12,318f9d0c,8018d7e6 -8.11.1,2aa59cb0,8018d7e6 -8.11-rc-1,2aa59cb0,8018d7e6 -8.11-rc-2,2aa59cb0,8018d7e6 -8.11-rc-3,2aa59cb0,8018d7e6 -8.11-milestone-1,2aa59cb0,8018d7e6 -8.11,2aa59cb0,8018d7e6 -8.10.2-milestone-1,2aa59cb0,8018d7e6 -8.10.2,2aa59cb0,8018d7e6 -8.10.1,2aa59cb0,8018d7e6 -8.10-rc-1,2aa59cb0,8018d7e6 -8.10,2aa59cb0,8018d7e6 -8.9-rc-1,2aa59cb0,8018d7e6 -8.9-rc-2,2aa59cb0,8018d7e6 -8.9,2aa59cb0,8018d7e6 -8.8-rc-2,3a7e8b97,f0ac8f2 -8.8-rc-1,3a7e8b97,f0ac8f2 -8.8,3a7e8b97,f0ac8f2 -8.7-rc-2,2c2f80d5,f0ac8f2 -8.7-rc-3,2c2f80d5,f0ac8f2 -8.7-rc-1,2c2f80d5,f0ac8f2 -8.7-rc-4,2c2f80d5,f0ac8f2 -8.7,2c2f80d5,f0ac8f2 -8.6-rc-4,2c2f80d5,f0ac8f2 -8.6-rc-3,2c2f80d5,f0ac8f2 -8.6-rc-2,2c2f80d5,f0ac8f2 -8.6-rc-1,2c2f80d5,f0ac8f2 -8.6-milestone-1,2c2f80d5,f0ac8f2 -8.6,2c2f80d5,f0ac8f2 -8.5-rc-1,2c2f80d5,2b81bfec -8.5-rc-2,2c2f80d5,2b81bfec -8.5-rc-3,2c2f80d5,2b81bfec -8.5-rc-4,2c2f80d5,2b81bfec -8.5,2c2f80d5,2b81bfec -8.4-rc-3,2c2f80d5,2b81bfec -8.4-rc-2,2c2f80d5,2b81bfec -8.4-rc-1,2c2f80d5,2b81bfec -8.4,2c2f80d5,2b81bfec -8.3-rc-3,fb8375e7,2b81bfec -8.3-rc-2,fb8375e7,2b81bfec -8.3-rc-1,fb8375e7,2b81bfec -8.3-rc-4,fb8375e7,2b81bfec -8.3,fb8375e7,2b81bfec -8.2.1,63c55010,2b81bfec -8.2-rc-3,63c55010,2b81bfec -8.2,63c55010,2b81bfec -8.1-rc-3,7bdb49ed,2b81bfec -8.1-rc-4,7bdb49ed,2b81bfec -8.1-rc-1,7bdb49ed,2b81bfec -8.1,7bdb49ed,2b81bfec -8.0.2,7545ee5b,2b81bfec -8.0-rc-4,7545ee5b,2b81bfec -8.0-rc-5,7545ee5b,2b81bfec -8.0-milestone-1,7545ee5b,2b81bfec -8.0-milestone-2,7545ee5b,2b81bfec -8.0,7545ee5b,2b81bfec -7.6.4,5760ee9b,2b81bfec -7.6.3,5760ee9b,2b81bfec -7.6.2,5760ee9b,2b81bfec -7.6-rc-3,5760ee9b,2b81bfec -7.6-rc-4,5760ee9b,2b81bfec -7.6-milestone-1,5760ee9b,2b81bfec -7.6,5760ee9b,2b81bfec -7.5.1,8e0d96aa,8b23b568 -7.5-rc-2,8e0d96aa,8b23b568 -7.5-rc-1,8e0d96aa,8b23b568 -7.5,8e0d96aa,8b23b568 -7.4.2,f27d7133,4c6b9dc9 -7.4.1,f27d7133,4c6b9dc9 -7.4,f27d7133,4c6b9dc9 -7.3.2,f27d7133,4c6b9dc9 -7.3.1,f27d7133,4c6b9dc9 -7.3-rc-2,f27d7133,4c6b9dc9 -7.3-rc-1,f27d7133,4c6b9dc9 -7.2-rc-3,f27d7133,4c6b9dc9 -7.2-rc-2,f27d7133,4c6b9dc9 -7.2,f27d7133,4c6b9dc9 -7.0.2,be340f5d,4c6b9dc9 -7.0.1,be340f5d,4c6b9dc9 -7.0-milestone-2,be340f5d,4c6b9dc9 -7.0-milestone-3,be340f5d,4c6b9dc9 -6.9.4,f27d7133,4c6b9dc9 -6.9.3,f27d7133,4c6b9dc9 -6.9.2,f27d7133,4c6b9dc9 -6.9.1,be340f5d,4c6b9dc9 -6.9-rc-1,be340f5d,4c6b9dc9 -6.9-rc-2,be340f5d,4c6b9dc9 -6.9,be340f5d,4c6b9dc9 -6.8.3,be340f5d,4c6b9dc9 -6.8.2,be340f5d,4c6b9dc9 -6.8.1,be340f5d,4c6b9dc9 -6.8-rc-3,be340f5d,4c6b9dc9 -6.8-rc-1,be340f5d,4c6b9dc9 -6.8-milestone-3,be340f5d,4c6b9dc9 -6.7.1,be340f5d,4c6b9dc9 -6.7-rc-1,be340f5d,4c6b9dc9 -6.7-rc-2,be340f5d,4c6b9dc9 -6.7-rc-3,be340f5d,4c6b9dc9 -6.7-rc-4,be340f5d,4c6b9dc9 -6.7-rc-5,be340f5d,4c6b9dc9 -6.6.1,be340f5d,4c6b9dc9 -6.6-rc-4,be340f5d,4c6b9dc9 -6.6-rc-3,be340f5d,4fcf87d -6.6-rc-2,be340f5d,4fcf87d -6.6-rc-1,be340f5d,4fcf87d -6.6-rc-6,be340f5d,4c6b9dc9 -6.6-rc-5,be340f5d,4c6b9dc9 -6.6-milestone-3,97200f5d,4fcf87d -6.6-milestone-2,be340f5d,4fcf87d -6.6-milestone-1,97200f5d,4fcf87d -6.6,be340f5d,4c6b9dc9 -6.5.1,97200f5d,4fcf87d -6.5-rc-1,97200f5d,4fcf87d -6.5-milestone-1,97200f5d,4fcf87d -6.5-milestone-2,97200f5d,4fcf87d -6.5,97200f5d,4fcf87d -6.4.1,97200f5d,4fcf87d -6.4-rc-4,97200f5d,4fcf87d -6.4-rc-3,97200f5d,4fcf87d -6.4-rc-2,97200f5d,4fcf87d -6.4-rc-1,97200f5d,4fcf87d -6.4,97200f5d,4fcf87d -6.3-rc-1,b6a5b769,5eec2db -6.3-rc-2,b6a5b769,5eec2db -6.3-rc-3,b6a5b769,5eec2db -6.3-rc-4,b6a5b769,5eec2db -6.3,b6a5b769,5eec2db -6.2.2,b6a5b769,5eec2db -6.2.1,b6a5b769,5eec2db -6.2-rc-3,b6a5b769,5eec2db -6.2-rc-2,b6a5b769,5eec2db -6.2-rc-1,b6a5b769,5eec2db -6.2,b6a5b769,5eec2db -6.1.1,b6a5b769,59b7a264 -6.1-rc-3,b6a5b769,59b7a264 -6.1-rc-2,b6a5b769,59b7a264 -6.1-rc-1,b6a5b769,59b7a264 -6.1-milestone-1,b6a5b769,59b7a264 -6.1-milestone-2,b6a5b769,59b7a264 -6.1-milestone-3,b6a5b769,59b7a264 -6.1,b6a5b769,59b7a264 -6.0.1,b6a5b769,59b7a264 -6.0-rc-3,b6a5b769,59b7a264 -6.0-rc-1,b6a5b769,59b7a264 -6.0-rc-2,b6a5b769,59b7a264 -6.0,b6a5b769,59b7a264 -5.6.4,bf16f1fe,59b7a264 -5.6.3,bf16f1fe,59b7a264 -5.6.2,bf16f1fe,59b7a264 -5.6.1,bf16f1fe,59b7a264 -5.6-rc-2,bf16f1fe,59b7a264 -5.6-rc-1,bf16f1fe,59b7a264 -5.6,bf16f1fe,59b7a264 -5.5.1,a4d9e5e7,59b7a264 -5.5-rc-4,8dae574,5c81a1f1 -5.5-rc-3,8dae574,5c81a1f1 -5.5-rc-2,8dae574,5c81a1f1 -5.5-rc-1,8dae574,5c81a1f1 -5.5,a4d9e5e7,59b7a264 -5.4.1,8dae574,5c81a1f1 -5.4-rc-1,8dae574,5c81a1f1 -5.4,8dae574,5c81a1f1 -5.3.1,8dae574,5c81a1f1 -5.3-rc-3,8dae574,5c81a1f1 -5.3-rc-2,8dae574,5c81a1f1 -5.3-rc-1,8dae574,5c81a1f1 -5.3,8dae574,5c81a1f1 -5.2.1,5aac1e11,22edc5d0 -5.2-rc-1,5aac1e11,22edc5d0 -5.2,5aac1e11,22edc5d0 -5.1.1,5aac1e11,22edc5d0 -5.1-rc-2,5aac1e11,22edc5d0 -5.1-rc-1,5aac1e11,22edc5d0 -5.1-rc-3,5aac1e11,22edc5d0 -5.1-milestone-1,5aac1e11,22edc5d0 -5.1,5aac1e11,22edc5d0 -5.0-rc-2,5aac1e11,22edc5d0 -5.0-rc-3,5aac1e11,22edc5d0 -5.0-rc-4,5aac1e11,22edc5d0 -5.0-rc-5,5aac1e11,22edc5d0 -5.0-rc-1,5aac1e11,22edc5d0 -5.0-milestone-1,5aac1e11,22edc5d0 -5.0,5aac1e11,22edc5d0 -4.10.3,5aac1e11,22edc5d0 -4.10.2,5aac1e11,22edc5d0 -4.10.1,5aac1e11,22edc5d0 -4.10-rc-1,5aac1e11,22edc5d0 -4.10-rc-3,5aac1e11,22edc5d0 -4.10-rc-2,5aac1e11,22edc5d0 -4.10,5aac1e11,22edc5d0 -4.9-rc-2,5aac1e11,22edc5d0 -4.9-rc-1,5aac1e11,22edc5d0 -4.9,5aac1e11,22edc5d0 -4.8.1,5aac1e11,22edc5d0 -4.8-rc-3,5aac1e11,22edc5d0 -4.8-rc-1,5aac1e11,22edc5d0 -4.8-rc-2,5aac1e11,22edc5d0 -4.8,5aac1e11,22edc5d0 -4.7-rc-1,5aac1e11,22edc5d0 -4.7-rc-2,5aac1e11,22edc5d0 -4.7,5aac1e11,22edc5d0 -4.6-rc-1,5aac1e11,22edc5d0 -4.6-rc-2,5aac1e11,22edc5d0 -4.6,5aac1e11,22edc5d0 -4.5.1,5aac1e11,22edc5d0 -4.5-rc-2,5aac1e11,22edc5d0 -4.5-rc-1,5aac1e11,22edc5d0 -4.5,5aac1e11,22edc5d0 -4.4.1,5aac1e11,22edc5d0 -4.4-rc-6,5aac1e11,22edc5d0 -4.4,5aac1e11,22edc5d0 -4.3.1,5aac1e11,22edc5d0 -4.3-rc-1,5aac1e11,22edc5d0 -4.3,5aac1e11,22edc5d0 -4.2.1,5aac1e11,22edc5d0 -4.2-rc-2,5aac1e11,22edc5d0 -4.2,5aac1e11,22edc5d0 -4.1,5aac1e11,22edc5d0 -3.2.1,91001e71,22edc5d0 -3.2,27be095c,22edc5d0 -3.1,6e691335,22edc5d0 -3.0,6e691335,22edc5d0 -2.14.1,12dcd60b,9016f1b3 -2.14,12dcd60b,9016f1b3 -2.13,12dcd60b,9016f1b3 -2.12,7129bfb3,12e9f1b3 -2.11,7129bfb3,12e9f1b3 -2.10,7129bfb3,2e72f1ba -2.9,7129bfb3,2e72f1ba -2.8,7129bfb3,2e72f1ba -2.7,fdd0b9a9,2e72f1ba -2.6,f642e19f,2e72f1ba -2.5,f642e19f,2e72f1ba -2.4,f642e19f,2e72f1ba -2.3,f642e19f,2e72f1ba -2.2.1,f642e19f,2e72f1ba -2.2,f642e19f,2e72f1ba -2.1,f642e19f,2e72f1ba -1.12,f642e19f,2e72f1ba -1.11,f642e19f,2e72f1ba -1.10,f642e19f,2e72f1ba -1.8,f642e19f,2e72f1ba -1.4,ad2cdb0f,84f6eae6 -1.3,ad2cdb0f,84f6eae6 -1.2,8fdcd9ad,84f6eae6 -1.1,4d0d6bb,84f6eae6 -1.0,547edccc,84f6eae6 diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/12e9f1b3.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/12e9f1b3.txt deleted file mode 100644 index 1dd2637a719..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/12e9f1b3.txt +++ /dev/null @@ -1,91 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem ${applicationName} startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=.\ - -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME%${appHomeRelativePath} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%\$ - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/22edc5d0.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/22edc5d0.txt deleted file mode 100644 index 8977b1a10bf..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/22edc5d0.txt +++ /dev/null @@ -1,85 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem ${applicationName} 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%${appHomeRelativePath} - -@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/2b81bfec.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/2b81bfec.txt deleted file mode 100644 index 7e3817e5f27..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/2b81bfec.txt +++ /dev/null @@ -1,93 +0,0 @@ -@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 ${applicationName} 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=.\ - -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME%${appHomeRelativePath} - -@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 ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 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=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>set MODULE_PATH=$modulePath<% } %> - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "%MODULE_PATH%" <% } %>${mainClassName} %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%${exitEnvironmentVar}%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/2e72f1ba.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/2e72f1ba.txt deleted file mode 100644 index 03f2bacdf0b..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/2e72f1ba.txt +++ /dev/null @@ -1,91 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem ${applicationName} startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=.\ - -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME%${appHomeRelativePath} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%\$ - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/4c6b9dc9.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/4c6b9dc9.txt deleted file mode 100644 index 747fe6b0e6d..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/4c6b9dc9.txt +++ /dev/null @@ -1,90 +0,0 @@ -@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 ${applicationName} 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%${appHomeRelativePath} - -@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 ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@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=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>set MODULE_PATH=$modulePath<% } %> - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "%MODULE_PATH%" <% } %>${mainClassName} %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/4fcf87d.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/4fcf87d.txt deleted file mode 100644 index e083e0e92b1..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/4fcf87d.txt +++ /dev/null @@ -1,105 +0,0 @@ -@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 ${applicationName} 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%${appHomeRelativePath} - -@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 ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>set MODULE_PATH=$modulePath<% } %> - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "%MODULE_PATH%" <% } %>${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/59b7a264.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/59b7a264.txt deleted file mode 100644 index 96bda9a8ae7..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/59b7a264.txt +++ /dev/null @@ -1,101 +0,0 @@ -@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 ${applicationName} 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%${appHomeRelativePath} - -@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/5c81a1f1.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/5c81a1f1.txt deleted file mode 100644 index 5d2ca3cf59d..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/5c81a1f1.txt +++ /dev/null @@ -1,101 +0,0 @@ -@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 http://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 ${applicationName} 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%${appHomeRelativePath} - -@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/5eec2db.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/5eec2db.txt deleted file mode 100644 index eb54dd4f6e6..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/5eec2db.txt +++ /dev/null @@ -1,104 +0,0 @@ -@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 ${applicationName} 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%${appHomeRelativePath} - -@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 ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/8018d7e6.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/8018d7e6.txt deleted file mode 100644 index b487fee0ea4..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/8018d7e6.txt +++ /dev/null @@ -1,95 +0,0 @@ -@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 -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem ${applicationName} 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=.\ - -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME%${appHomeRelativePath} - -@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 ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>set MODULE_PATH=$modulePath<% } %> - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "%MODULE_PATH%" <% } %>${mainClassName} %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%${exitEnvironmentVar}%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/84f6eae6.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/84f6eae6.txt deleted file mode 100644 index 7e034c0ce21..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/84f6eae6.txt +++ /dev/null @@ -1,91 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem ${applicationName} startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=.\ - -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME%${appHomeRelativePath} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%\$ - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/8b23b568.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/8b23b568.txt deleted file mode 100644 index b70a2ecee1d..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/8b23b568.txt +++ /dev/null @@ -1,92 +0,0 @@ -@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 ${applicationName} 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%${appHomeRelativePath} - -@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 ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 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=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>set MODULE_PATH=$modulePath<% } %> - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "%MODULE_PATH%" <% } %>${mainClassName} %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%${exitEnvironmentVar}%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/9016f1b3.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/9016f1b3.txt deleted file mode 100644 index fad88d61bba..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/9016f1b3.txt +++ /dev/null @@ -1,91 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem ${applicationName} 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%${appHomeRelativePath} - -@rem Add default JVM options here. You can also use JAVA_OPTS and ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@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 init - -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 init - -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 - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%\$ - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%${exitEnvironmentVar}%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/f0ac8f2.txt b/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/f0ac8f2.txt deleted file mode 100644 index 47e61dba930..00000000000 --- a/rewrite-gradle/src/main/resources/META-INF/rewrite/gradle-wrapper/windows/f0ac8f2.txt +++ /dev/null @@ -1,93 +0,0 @@ -@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 ${applicationName} 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=.\ - -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME%${appHomeRelativePath} - -@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 ${optsEnvironmentVar} to pass JVM options to this script. -set DEFAULT_JVM_OPTS=${defaultJvmOpts} - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=$classpath -<% if ( mainClassName.startsWith('--module ') ) { %>set MODULE_PATH=$modulePath<% } %> - -@rem Execute ${applicationName} -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" <% if ( mainClassName.startsWith('--module ') ) { %>--module-path "%MODULE_PATH%" <% } %>${mainClassName} %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable ${exitEnvironmentVar} if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%${exitEnvironmentVar}%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java index 60304c830d5..003144c4709 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java @@ -24,7 +24,6 @@ import org.openrewrite.marker.BuildTool; import org.openrewrite.properties.tree.Properties; import org.openrewrite.remote.Remote; -import org.openrewrite.remote.RemoteArchive; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; import org.openrewrite.test.SourceSpecs; @@ -44,9 +43,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; -import static org.openrewrite.gradle.util.GradleWrapper.*; +import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_BATCH_LOCATION; +import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_JAR_LOCATION; +import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_PROPERTIES_LOCATION; +import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_SCRIPT_LOCATION; import static org.openrewrite.properties.Assertions.properties; -import static org.openrewrite.test.SourceSpecs.*; +import static org.openrewrite.test.SourceSpecs.dir; +import static org.openrewrite.test.SourceSpecs.other; +import static org.openrewrite.test.SourceSpecs.text; @SuppressWarnings("UnusedProperty") class UpdateGradleWrapperTest implements RewriteTest { @@ -92,7 +96,7 @@ void addGradleWrapper() { var gradleWrapperProperties = result(run, Properties.File.class, "gradle-wrapper.properties"); assertThat(gradleWrapperProperties.getSourcePath()).isEqualTo(WRAPPER_PROPERTIES_LOCATION); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(gradleWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://services.gradle.org/distributions/gradle-7.4.2-bin.zip")); assertThat(isValidWrapperJar(gradleWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -125,7 +129,7 @@ void updateWrapper() { assertThat(gradleBat.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(gradleBat.getText()).isEqualTo(GRADLEW_BAT_TEXT); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(gradleWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://services.gradle.org/distributions/gradle-7.4.2-bin.zip")); assertThat(isValidWrapperJar(gradleWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -170,7 +174,7 @@ void updateVersionAndDistribution() { var gradleBat = result(run, PlainText.class, "gradlew.bat"); assertThat(gradleBat.getText()).isNotBlank(); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(PathUtils.equalIgnoringSeparators(gradleWrapperJar.getSourcePath(), WRAPPER_JAR_LOCATION)).isTrue(); assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://services.gradle.org/distributions/gradle-7.4.2-bin.zip")); assertThat(isValidWrapperJar(gradleWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -204,7 +208,7 @@ void updateChecksumAlreadySet() { rewriteRun( spec -> spec.allSources(source -> source.markers(new BuildTool(Tree.randomId(), BuildTool.Type.Gradle, "7.4"))) .afterRecipe(run -> { - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(PathUtils.equalIgnoringSeparators(gradleWrapperJar.getSourcePath(), WRAPPER_JAR_LOCATION)).isTrue(); assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://services.gradle.org/distributions/gradle-7.4.2-bin.zip")); assertThat(isValidWrapperJar(gradleWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -315,7 +319,7 @@ void olderThan6_6() { var gradleBat = result(run, PlainText.class, "gradlew.bat"); assertThat(gradleBat.getText()).isNotBlank(); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(PathUtils.equalIgnoringSeparators(gradleWrapperJar.getSourcePath(), WRAPPER_JAR_LOCATION)).isTrue(); assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://services.gradle.org/distributions/gradle-5.6.4-bin.zip")); assertThat(isValidWrapperJar(gradleWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -376,7 +380,7 @@ void allowUpdatingDistributionTypeWhenSameVersion() { var gradleBat = result(run, PlainText.class, "gradlew.bat"); assertThat(gradleBat.getText()).isNotBlank(); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(PathUtils.equalIgnoringSeparators(gradleWrapperJar.getSourcePath(), WRAPPER_JAR_LOCATION)).isTrue(); assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://services.gradle.org/distributions/gradle-5.6.4-bin.zip")); assertThat(isValidWrapperJar(gradleWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -423,7 +427,7 @@ void defaultsToLatestRelease() { assertThat(gradleBat.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(gradleBat.getText()).isNotBlank(); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(gradleWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); //noinspection OptionalGetWithoutIsPresent BuildTool buildTool = gradleWrapperJar.getMarkers().findFirst(BuildTool.class).get(); @@ -501,7 +505,7 @@ void skipWorkIfUpdatedEarlier() { assertThat(gradleBat.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(gradleBat.getText()).isNotBlank(); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(gradleWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); //noinspection OptionalGetWithoutIsPresent BuildTool buildTool = gradleWrapperJar.getMarkers().findFirst(BuildTool.class).get(); @@ -627,7 +631,7 @@ void addWrapperWithCustomDistributionUri() { .setLargeFileHttpSender(customDistributionHost); rewriteRun( spec -> spec - .recipe(new UpdateGradleWrapper(null, null, null, "https://company.com/repo/gradle-8.10-bin.zip", null)) + .recipe(new UpdateGradleWrapper(null, null, null, "https://company.com/repo/gradle-8.0.2-bin.zip", null)) .expectedCyclesThatMakeChanges(1) .executionContext(ctx) .afterRecipe(run -> { @@ -646,9 +650,9 @@ void addWrapperWithCustomDistributionUri() { var gradleWrapperProperties = result(run, Properties.File.class, "gradle-wrapper.properties"); assertThat(gradleWrapperProperties.getSourcePath()).isEqualTo(WRAPPER_PROPERTIES_LOCATION); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(gradleWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); - assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://company.com/repo/gradle-8.10-bin.zip")); + assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://company.com/repo/gradle-8.0.2-bin.zip")); assertThat(isValidWrapperJar(gradleWrapperJar)).as("Wrapper jar is not valid").isTrue(); }), buildGradle( @@ -675,7 +679,7 @@ void addWrapperWithCustomDistributionUriAndDistributionChecksum() { .setLargeFileHttpSender(customDistributionHost); rewriteRun( spec -> spec - .recipe(new UpdateGradleWrapper(null, null, null, "https://company.com/repo/gradle-8.10-bin.zip", wrapperJarChecksum)) + .recipe(new UpdateGradleWrapper(null, null, null, "https://company.com/repo/gradle-8.0.2-bin.zip", wrapperJarChecksum)) .expectedCyclesThatMakeChanges(1) .executionContext(ctx) .afterRecipe(run -> { @@ -875,7 +879,7 @@ void updateWrapperInSubDirectory() { assertThat(gradleBat.getSourcePath()).isEqualTo(subdir.resolve(WRAPPER_BATCH_LOCATION)); assertThat(gradleBat.getText()).isEqualTo(GRADLEW_BAT_TEXT); - var gradleWrapperJar = result(run, RemoteArchive.class, "gradle-wrapper.jar"); + var gradleWrapperJar = result(run, Remote.class, "gradle-wrapper.jar"); assertThat(gradleWrapperJar.getSourcePath()).isEqualTo(subdir.resolve(WRAPPER_JAR_LOCATION)); assertThat(gradleWrapperJar.getUri()).isEqualTo(URI.create("https://services.gradle.org/distributions/gradle-7.4.2-bin.zip")); assertThat(isValidWrapperJar(gradleWrapperJar)).as("Wrapper jar is not valid").isTrue(); diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/GradleWrapperScriptLoaderTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/GradleWrapperScriptLoaderTest.java deleted file mode 100644 index 4ffdeb19332..00000000000 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/GradleWrapperScriptLoaderTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - *

- * 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 - *

- * https://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 org.openrewrite.gradle.internal; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -public class GradleWrapperScriptLoaderTest { - - @Test - void nearestVersion() { - GradleWrapperScriptLoader.Nearest nearest = new GradleWrapperScriptLoader().findNearest("6.9.100"); - String v = nearest.getResolved().getVersion(); - assertThat(v).startsWith("6.9."); - - // this version doesn't exist, so we should get the nearest instead - assertThat(v).isNotEqualTo("6.9.100"); - } - - @Test - void lastVersion() { - GradleWrapperScriptLoader.Nearest nearest = new GradleWrapperScriptLoader().findNearest(null); - String v = nearest.getResolved().getVersion(); - assertThat(Integer.parseInt(v.split("\\.")[0])).isGreaterThanOrEqualTo(8); - } -} diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/GradleWrapperTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/GradleWrapperTest.java deleted file mode 100644 index 942ea1af361..00000000000 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/GradleWrapperTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - *

- * 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 - *

- * https://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 org.openrewrite.gradle.internal; - -import org.junit.jupiter.api.Test; -import org.openrewrite.InMemoryExecutionContext; -import org.openrewrite.gradle.util.GradleWrapper; -import org.openrewrite.remote.RemoteResource; - -public class GradleWrapperTest { - - @Test - void listGradleWrappers() { - RemoteResource resource = GradleWrapper.create(null, null, null, new InMemoryExecutionContext()) - .gradlew(); - } -} diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/DistributionInfosTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/DistributionInfosTest.java similarity index 79% rename from rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/DistributionInfosTest.java rename to rewrite-gradle/src/test/java/org/openrewrite/gradle/util/DistributionInfosTest.java index fb49b660fdf..ef383b977aa 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/internal/DistributionInfosTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/DistributionInfosTest.java @@ -13,14 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.openrewrite.gradle.internal; +package org.openrewrite.gradle.util; import org.junit.jupiter.api.Test; import org.openrewrite.Checksum; -import org.openrewrite.HttpSenderExecutionContextView; -import org.openrewrite.InMemoryExecutionContext; -import org.openrewrite.gradle.util.DistributionInfos; -import org.openrewrite.gradle.util.GradleWrapper; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.ipc.http.HttpUrlConnectionSender; @@ -34,15 +30,13 @@ class DistributionInfosTest { @Test void fetch() throws IOException { HttpSender httpSender = new HttpUrlConnectionSender(Duration.ofSeconds(30), Duration.ofMinutes(1)); - GradleWrapper.GradleVersion gradleVersion = new GradleWrapper.GradleVersion( "7.6", "https://services.gradle.org/distributions/gradle-7.6-bin.zip", "https://services.gradle.org/distributions/gradle-7.6-bin.zip.sha256", "https://services.gradle.org/distributions/gradle-7.6-wrapper.jar.sha256" - ); - DistributionInfos infos = DistributionInfos.fetch(GradleWrapper.DistributionType.Bin, gradleVersion, - HttpSenderExecutionContextView.view(new InMemoryExecutionContext()).setHttpSender(httpSender)); + ); + DistributionInfos infos = DistributionInfos.fetch(httpSender, GradleWrapper.DistributionType.Bin, gradleVersion); assertThat(infos).isEqualTo(new DistributionInfos( "https://services.gradle.org/distributions/gradle-7.6-bin.zip", diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java new file mode 100644 index 00000000000..21d47b90b5e --- /dev/null +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java @@ -0,0 +1,92 @@ +/* + * Copyright 2022 the original author or authors. + *

+ * 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 + *

+ * https://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 org.openrewrite.gradle.util; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; +import okhttp3.mockwebserver.Dispatcher; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.StringUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +import java.util.List; +import java.util.function.Consumer; + +import static org.assertj.core.api.Assertions.assertThat; + +public class GradleWrapperTest { + + public static void mockGradleServices(Consumer block) { + mockGradleServices(List.of("7.5.1", "7.6", "7.6-milestone-1", "7.6-rc-1"), block); + } + + public static void mockGradleServices(Collection gradleVersions, Consumer block) { + try (MockWebServer mockRepo = new MockWebServer()) { + List versions = gradleVersions.stream() + .map(version -> { + String urlPrefix = "http://%s:%d/distributions/gradle-%s".formatted(mockRepo.getHostName(), mockRepo.getPort(), version); + return new GradleWrapper.GradleVersion(version, + urlPrefix + "-bin.zip", + urlPrefix + "-bin.zip.sha256", + urlPrefix + "-wrapper.jar.sha256"); + }) + .toList(); + + String availableVersions = new ObjectMapper() + .registerModule(new ParameterNamesModule()) + .writeValueAsString(versions); + + mockRepo.setDispatcher(new Dispatcher() { + + @NonNull + @Override + public MockResponse dispatch(RecordedRequest recordedRequest) { + String path = recordedRequest.getPath(); + if(path != null) { + if ("/versions/all".equals(path)) { + return new MockResponse().setResponseCode(200).setBody(availableVersions); + } else if (path.startsWith("/distributions/gradle-")) { + String version = path.substring("/distributions/gradle-".length(), path.lastIndexOf("-")); + String extension = path.substring(path.lastIndexOf("-bin.") + "-bin.".length()); + String resourcePath = "gradle-%s-bin.%s".formatted(version, extension); + try ( + InputStream is = getClass().getClassLoader().getResourceAsStream(resourcePath) + ) { + String body = StringUtils.readFully(is); + return new MockResponse().setResponseCode(200).setBody(body); + } catch (IOException e) { + return new MockResponse().setResponseCode(500).setBody("Unable to load resource " + resourcePath); + } + } + } + return new MockResponse().setResponseCode(400).setBody("Mockserver not configured for path " + recordedRequest.getPath()); + } + }); + + block.accept(mockRepo); + assertThat(mockRepo.getRequestCount()) + .as("The mock repository received no requests. The test is not using it.") + .isGreaterThan(0); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/style/package-info.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/package-info.java similarity index 87% rename from rewrite-gradle/src/main/java/org/openrewrite/gradle/style/package-info.java rename to rewrite-gradle/src/test/java/org/openrewrite/gradle/util/package-info.java index ebabbb2fc51..f9779830141 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/style/package-info.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 the original author or authors. + * Copyright 2023 the original author or authors. *

* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,6 @@ * limitations under the License. */ @NullMarked -package org.openrewrite.gradle.style; +package org.openrewrite.gradle.util; import org.jspecify.annotations.NullMarked; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java index ff8e3097553..5ec938bbd44 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java @@ -758,7 +758,6 @@ Collection distinctNormalizedRepositories( normalizedRepositories.put(normalizedRepo.getId(), normalizedRepo); } } - return normalizedRepositories.values(); } diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java b/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java index 24a04d85340..6d00103acb7 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java @@ -50,7 +50,7 @@ public class MavenWrapper { "# \"License\"); you may not use this file except in compliance\n" + "# with the License. You may obtain a copy of the License at\n" + "# \n" + - "# https://www.apache.org/licenses/LICENSE-2.0\n" + + "# http://www.apache.org/licenses/LICENSE-2.0\n" + "# \n" + "# Unless required by applicable law or agreed to in writing,\n" + "# software distributed under the License is distributed on an\n" + @@ -131,21 +131,25 @@ public static MavenWrapper create( .orElseThrow(() -> new IllegalStateException("Expected to find at least one Maven distribution version to select from.")); String resolvedDistributionUri = getDownloadUriFor(repository, distributionGroupArtifact, resolvedDistributionVersion, "bin", "zip"); - Remote wrapperJar = (Remote) Checksum.sha256( - Remote.builder(WRAPPER_JAR_LOCATION).build(URI.create(resolvedWrapperUri)), ctx); + Remote wrapperJar = (Remote) Checksum.sha256(Remote.builder( + WRAPPER_JAR_LOCATION, + URI.create(resolvedWrapperUri) + ).build(), ctx); - Remote mavenDistribution = (Remote) Checksum.sha256(Remote.builder(Paths.get("")) - .build(URI.create(resolvedDistributionUri)), ctx); + Remote mavenDistribution = (Remote) Checksum.sha256(Remote.builder( + Paths.get(""), + URI.create(resolvedDistributionUri) + ).build(), ctx); return new MavenWrapper( resolvedWrapperVersion, resolvedWrapperUri, - requireNonNull(wrapperJar.getChecksum()), + wrapperJar.getChecksum(), resolvedWrapperDistributionUri, wrapperDistributionType, resolvedDistributionVersion, resolvedDistributionUri, - requireNonNull(mavenDistribution.getChecksum()) + mavenDistribution.getChecksum() ); } catch (MavenDownloadingException e) { throw new RuntimeException("Could not get Maven versions at: " + repository.getUri(), e); @@ -161,33 +165,45 @@ public String getDistributionUrl() { } public Remote wrapperJar() { - return Remote.builder(WRAPPER_JAR_LOCATION) - .build(URI.create(wrapperUri)); + return Remote.builder( + WRAPPER_JAR_LOCATION, + URI.create(wrapperUri) + ).build(); } public Remote wrapperJar(SourceFile previous) { - return Remote.builder(previous) - .build(URI.create(wrapperUri)); + return Remote.builder( + previous, + URI.create(wrapperUri) + ).build(); } public Remote wrapperDownloader() { - return Remote.builder(WRAPPER_DOWNLOADER_LOCATION) - .build(URI.create(wrapperDistributionUri), ".mvn/wrapper/MavenWrapperDownloader.java"); + return Remote.builder( + WRAPPER_DOWNLOADER_LOCATION, + URI.create(wrapperDistributionUri) + ).build(".mvn/wrapper/MavenWrapperDownloader.java"); } public Remote wrapperDownloader(SourceFile previous) { - return Remote.builder(previous) - .build(URI.create(wrapperDistributionUri), ".mvn/wrapper/MavenWrapperDownloader.java"); + return Remote.builder( + previous, + URI.create(wrapperDistributionUri) + ).build(".mvn/wrapper/MavenWrapperDownloader.java"); } public Remote mvnw() { - return Remote.builder(WRAPPER_SCRIPT_LOCATION) - .build(URI.create(wrapperDistributionUri), "mvnw"); + return Remote.builder( + WRAPPER_SCRIPT_LOCATION, + URI.create(wrapperDistributionUri) + ).build("mvnw"); } public Remote mvnwCmd() { - return Remote.builder(WRAPPER_BATCH_LOCATION) - .build(URI.create(wrapperDistributionUri), "mvnw.cmd"); + return Remote.builder( + WRAPPER_BATCH_LOCATION, + URI.create(wrapperDistributionUri) + ).build("mvnw.cmd"); } private static String getDownloadUriFor(MavenRepository repository, GroupArtifact ga, String version, @Nullable String classifier, String extension) { diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/UpdateMavenWrapperTest.java b/rewrite-maven/src/test/java/org/openrewrite/maven/UpdateMavenWrapperTest.java index 321261cb064..52fc8e4d9a1 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/UpdateMavenWrapperTest.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/UpdateMavenWrapperTest.java @@ -24,8 +24,6 @@ import org.openrewrite.marker.BuildTool; import org.openrewrite.maven.utilities.MavenWrapper; import org.openrewrite.remote.Remote; -import org.openrewrite.remote.RemoteArchive; -import org.openrewrite.remote.RemoteFile; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; import org.openrewrite.test.SourceSpecs; @@ -87,7 +85,7 @@ void addMavenWrapper() { assertThat(mvnwCmd.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(mvnwCmd.getText()).isEqualTo(MVNW_CMD_TEXT); - var mavenWrapperJar = result(run, RemoteFile.class, "maven-wrapper.jar"); + var mavenWrapperJar = result(run, Remote.class, "maven-wrapper.jar"); assertThat(mavenWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); assertThat(mavenWrapperJar.getUri()).isEqualTo(URI.create("https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar")); assertThat(isValidWrapperJar(mavenWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -122,7 +120,7 @@ void addMavenWrapperWithWrapperJarChecksumEnabled() { assertThat(mvnwCmd.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(mvnwCmd.getText()).isEqualTo(MVNW_CMD_TEXT); - var mavenWrapperJar = result(run, RemoteFile.class, "maven-wrapper.jar"); + var mavenWrapperJar = result(run, Remote.class, "maven-wrapper.jar"); assertThat(mavenWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); assertThat(mavenWrapperJar.getUri()).isEqualTo(URI.create("https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar")); assertThat(isValidWrapperJar(mavenWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -158,7 +156,7 @@ void updateWrapper() { assertThat(mvnwCmd.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(mvnwCmd.getText()).isEqualTo(MVNW_CMD_TEXT); - var mavenWrapperJar = result(run, RemoteFile.class, "maven-wrapper.jar"); + var mavenWrapperJar = result(run, Remote.class, "maven-wrapper.jar"); assertThat(mavenWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); assertThat(mavenWrapperJar.getUri()).isEqualTo(URI.create("https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar")); assertThat(isValidWrapperJar(mavenWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -235,7 +233,7 @@ void updateWrapperWithWrapperJarChecksumDisabledButChecksumAlreadyThere() { assertThat(mvnwCmd.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(mvnwCmd.getText()).isEqualTo(MVNW_CMD_TEXT); - var mavenWrapperJar = result(run, RemoteFile.class, "maven-wrapper.jar"); + var mavenWrapperJar = result(run, Remote.class, "maven-wrapper.jar"); assertThat(mavenWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); assertThat(mavenWrapperJar.getUri()).isEqualTo(URI.create("https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar")); assertThat(isValidWrapperJar(mavenWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -282,7 +280,7 @@ void updateWrapperWithWrapperJarChecksumEnabled() { assertThat(mvnwCmd.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(mvnwCmd.getText()).isEqualTo(MVNW_CMD_TEXT); - var mavenWrapperJar = result(run, RemoteFile.class, "maven-wrapper.jar"); + var mavenWrapperJar = result(run, Remote.class, "maven-wrapper.jar"); assertThat(mavenWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); assertThat(mavenWrapperJar.getUri()).isEqualTo(URI.create("https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar")); assertThat(isValidWrapperJar(mavenWrapperJar)).as("Wrapper jar is not valid").isTrue(); @@ -327,7 +325,7 @@ void updateVersionUsingSourceDistribution() { .isInstanceOf(NoSuchElementException.class) .hasMessage("No value present"); - var mvnwDownloaderJava = result(run, RemoteArchive.class, "MavenWrapperDownloader.java"); + var mvnwDownloaderJava = result(run, Remote.class, "MavenWrapperDownloader.java"); assertThat(mvnwDownloaderJava.getSourcePath()).isEqualTo(WRAPPER_DOWNLOADER_LOCATION); assertThat(mvnwDownloaderJava.getUri()).isEqualTo(URI.create("https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper-distribution/3.1.1/maven-wrapper-distribution-3.1.1-source.zip")); }), @@ -568,7 +566,7 @@ void defaultsToLatestRelease() { assertThat(mvnwCmd.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); assertThat(mvnwCmd.getText()).isNotBlank(); - var mavenWrapperJar = result(run, RemoteFile.class, "maven-wrapper.jar"); + var mavenWrapperJar = result(run, Remote.class, "maven-wrapper.jar"); assertThat(mavenWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); Matcher wrapperVersionMatcher = Pattern.compile("maven-wrapper-(.*?)\\.jar").matcher(mavenWrapperJar.getUri().toString()); assertThat(wrapperVersionMatcher.find()).isTrue(); @@ -656,7 +654,7 @@ void skipWorkIfUpdatedEarlier() { var mvnwCmd = result(run, PlainText.class, "mvnw.cmd"); assertThat(mvnwCmd.getSourcePath()).isEqualTo(WRAPPER_BATCH_LOCATION); - var mavenWrapperJar = result(run, RemoteFile.class, "maven-wrapper.jar"); + var mavenWrapperJar = result(run, Remote.class, "maven-wrapper.jar"); assertThat(mavenWrapperJar.getSourcePath()).isEqualTo(WRAPPER_JAR_LOCATION); assertThat(mavenWrapperJar.getUri()).isEqualTo(URI.create("https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar")); assertThat(isValidWrapperJar(mavenWrapperJar)).as("Wrapper jar is not valid").isTrue(); diff --git a/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java b/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java index 6f878ed174f..073da655b1e 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java @@ -139,15 +139,6 @@ default void rewriteRun(Consumer spec, SourceSpec... sourceSpecs) RecipeSpec testMethodSpec = RecipeSpec.defaults(); spec.accept(testMethodSpec); - ExecutionContext ctx; - if (testMethodSpec.getExecutionContext() != null) { - ctx = testMethodSpec.getExecutionContext(); - } else if (testClassSpec.getExecutionContext() != null) { - ctx = testClassSpec.getExecutionContext(); - } else { - ctx = defaultExecutionContext(sourceSpecs); - } - PrintOutputCapture.MarkerPrinter markerPrinter; if (testMethodSpec.getMarkerPrinter() != null) { markerPrinter = testMethodSpec.getMarkerPrinter(); @@ -157,7 +148,7 @@ default void rewriteRun(Consumer spec, SourceSpec... sourceSpecs) markerPrinter = PrintOutputCapture.MarkerPrinter.DEFAULT; } - PrintOutputCapture out = new PrintOutputCapture<>(ctx, markerPrinter); + PrintOutputCapture out = new PrintOutputCapture<>(0, markerPrinter); Recipe recipe = testMethodSpec.recipe == null ? testClassSpec.recipe == null ? Recipe.noop() : testClassSpec.recipe : @@ -211,6 +202,14 @@ default void rewriteRun(Consumer spec, SourceSpec... sourceSpecs) } } + ExecutionContext ctx; + if (testMethodSpec.getExecutionContext() != null) { + ctx = testMethodSpec.getExecutionContext(); + } else if (testClassSpec.getExecutionContext() != null) { + ctx = testClassSpec.getExecutionContext(); + } else { + ctx = defaultExecutionContext(sourceSpecs); + } for (SourceSpec s : sourceSpecs) { s.customizeExecutionContext.accept(ctx); } diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java index 6ca194e68e2..adbcf45ecd0 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java @@ -132,9 +132,7 @@ public Yaml visitDocuments(Yaml.Documents documents, ExecutionContext ctx) { private String getYamlContents(ExecutionContext ctx) { @Language("yml") String yamlContents = fileContents; if (yamlContents == null && fileContentsUrl != null) { - yamlContents = Remote.builder(Paths.get(relativeFileName)) - .build(URI.create(fileContentsUrl)) - .printAll(ctx); + yamlContents = Remote.builder(Paths.get(relativeFileName), URI.create(fileContentsUrl)).build().printAll(ctx); } return yamlContents == null ? "" : yamlContents; } From d9645ec2a74b9ac14bdbf6d9496e668575fcb402 Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Fri, 31 Jan 2025 11:41:03 +0100 Subject: [PATCH 2/2] Using withToolingApiUsingModulesCaching in rewrite-gradle tests --- .../java/org/openrewrite/gradle/AddDependencyTest.java | 6 +++--- .../openrewrite/gradle/AddJUnitPlatformLauncherTest.java | 4 ++-- .../gradle/ChangeDependencyArtifactIdTest.java | 4 ++-- .../gradle/ChangeDependencyClassifierTest.java | 4 ++-- .../gradle/ChangeDependencyConfigurationTest.java | 4 ++-- .../openrewrite/gradle/ChangeDependencyExtensionTest.java | 4 ++-- .../openrewrite/gradle/ChangeDependencyGroupIdTest.java | 4 ++-- .../java/org/openrewrite/gradle/ChangeDependencyTest.java | 4 ++-- .../openrewrite/gradle/DependencyUseMapNotationTest.java | 4 ++-- .../gradle/DependencyUseStringNotationTest.java | 4 ++-- .../java/org/openrewrite/gradle/RemoveDependencyTest.java | 4 ++-- .../gradle/RemoveRedundantDependencyVersionsTest.java | 4 ++-- .../org/openrewrite/gradle/UpdateGradleWrapperTest.java | 3 ++- .../openrewrite/gradle/UpgradeDependencyVersionTest.java | 6 +++--- .../gradle/UpgradeTransitiveDependencyVersionTest.java | 4 ++-- .../openrewrite/gradle/plugins/AddBuildPluginTest.java | 4 ++-- .../gradle/plugins/AddDevelocityGradlePluginTest.java | 4 ++-- .../openrewrite/gradle/plugins/AddSettingsPluginTest.java | 6 +++--- .../org/openrewrite/gradle/plugins/ChangePluginTest.java | 4 ++-- .../gradle/plugins/ChangePluginVersionTest.java | 4 ++-- .../plugins/MigrateGradleEnterpriseToDevelocityTest.java | 4 ++-- .../openrewrite/gradle/plugins/RemoveDevelocityTest.java | 4 ++-- .../gradle/plugins/UpgradePluginVersionTest.java | 4 ++-- .../openrewrite/gradle/search/DependencyInsightTest.java | 4 ++-- .../openrewrite/gradle/search/FindGradleProjectTest.java | 4 ++-- .../org/openrewrite/gradle/search/FindPluginsTest.java | 8 ++++---- .../openrewrite/gradle/trait/GradleDependencyTest.java | 4 ++-- 27 files changed, 59 insertions(+), 58 deletions(-) diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddDependencyTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddDependencyTest.java index cb1da2ffe4a..cb319d7657f 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddDependencyTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddDependencyTest.java @@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.groovy.Assertions.groovy; import static org.openrewrite.groovy.Assertions.srcMainGroovy; import static org.openrewrite.java.Assertions.java; @@ -48,7 +48,7 @@ class AddDependencyTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .parser(JavaParser.fromJavaVersion().classpath("junit-jupiter-api", "guava", "jackson-databind", "jackson-core", "lombok")); } @@ -1124,7 +1124,7 @@ void addDependencyToProjectsThatNeedIt() { void addDynamicVersionDependency() { rewriteRun( spec -> spec - .beforeRecipe(withToolingApi()) + .beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(addDependency("org.openrewrite:rewrite-core:7.39.X", "java.util.Date", "implementation")), mavenProject("project", srcMainGroovy( diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddJUnitPlatformLauncherTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddJUnitPlatformLauncherTest.java index 0c120dc8bce..64022db26da 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddJUnitPlatformLauncherTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddJUnitPlatformLauncherTest.java @@ -23,7 +23,7 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.java.Assertions.*; class AddJUnitPlatformLauncherTest implements RewriteTest { @@ -31,7 +31,7 @@ class AddJUnitPlatformLauncherTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { spec - .beforeRecipe(withToolingApi()) + .beforeRecipe(withToolingApiUsingModulesCaching()) .parser(JavaParser.fromJavaVersion().classpath("junit-jupiter-api")) .recipeFromResources("org.openrewrite.gradle.AddJUnitPlatformLauncher"); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyArtifactIdTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyArtifactIdTest.java index 4d18b7a5e97..53c0d583538 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyArtifactIdTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyArtifactIdTest.java @@ -26,13 +26,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class ChangeDependencyArtifactIdTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyClassifierTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyClassifierTest.java index fe95d396a8d..7f31911ec84 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyClassifierTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyClassifierTest.java @@ -23,13 +23,13 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class ChangeDependencyClassifierTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyConfigurationTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyConfigurationTest.java index 0889ebf42f6..fc3c8b0d6e6 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyConfigurationTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyConfigurationTest.java @@ -24,14 +24,14 @@ import static org.openrewrite.gradle.Assertions.buildGradle; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.java.Assertions.mavenProject; class ChangeDependencyConfigurationTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyExtensionTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyExtensionTest.java index aa70915d18a..674a63ba132 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyExtensionTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyExtensionTest.java @@ -23,13 +23,13 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class ChangeDependencyExtensionTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyGroupIdTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyGroupIdTest.java index b872c4560f0..fbc1446d7ec 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyGroupIdTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyGroupIdTest.java @@ -26,13 +26,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class ChangeDependencyGroupIdTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyTest.java index decf3758ce9..94c55daaa2d 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyTest.java @@ -21,12 +21,12 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class ChangeDependencyTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/DependencyUseMapNotationTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/DependencyUseMapNotationTest.java index b91a42ea085..bb48ac845db 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/DependencyUseMapNotationTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/DependencyUseMapNotationTest.java @@ -22,13 +22,13 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class DependencyUseMapNotationTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new DependencyUseMapNotation()); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/DependencyUseStringNotationTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/DependencyUseStringNotationTest.java index 8963f259414..614f269f3f1 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/DependencyUseStringNotationTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/DependencyUseStringNotationTest.java @@ -21,13 +21,13 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class DependencyUseStringNotationTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new DependencyUseStringNotation()); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveDependencyTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveDependencyTest.java index e98dcb0fdd6..3d3a7f7c1aa 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveDependencyTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveDependencyTest.java @@ -28,14 +28,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.java.Assertions.mavenProject; class RemoveDependencyTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new RemoveDependency("org.springframework.boot", "spring-boot*", null)); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveRedundantDependencyVersionsTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveRedundantDependencyVersionsTest.java index e32a388616c..d5950deaa9a 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveRedundantDependencyVersionsTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveRedundantDependencyVersionsTest.java @@ -21,12 +21,12 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class RemoveRedundantDependencyVersionsTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new RemoveRedundantDependencyVersions(null, null, null, null)); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java index 003144c4709..58dab803ad5 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java @@ -47,6 +47,7 @@ import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_JAR_LOCATION; import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_PROPERTIES_LOCATION; import static org.openrewrite.gradle.util.GradleWrapper.WRAPPER_SCRIPT_LOCATION; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.properties.Assertions.properties; import static org.openrewrite.test.SourceSpecs.dir; import static org.openrewrite.test.SourceSpecs.other; @@ -71,7 +72,7 @@ class UpdateGradleWrapperTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { spec.recipe(new UpdateGradleWrapper("7.4.2", null, null, null, null)) - .beforeRecipe(withToolingApi()); + .beforeRecipe(withToolingApiUsingModulesCaching()); } @Test diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpgradeDependencyVersionTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpgradeDependencyVersionTest.java index 2626825c559..201180228fa 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpgradeDependencyVersionTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpgradeDependencyVersionTest.java @@ -31,14 +31,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.properties.Assertions.properties; class UpgradeDependencyVersionTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new UpgradeDependencyVersion("com.google.guava", "guava", "30.x", "-jre")); } @@ -102,7 +102,7 @@ void guavaCompileOnly() { @Test void mockitoTestImplementation() { rewriteRun(recipeSpec -> { - recipeSpec.beforeRecipe(withToolingApi()) + recipeSpec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new UpgradeDependencyVersion("org.mockito", "*", "4.11.0", null)); }, buildGradle( diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpgradeTransitiveDependencyVersionTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpgradeTransitiveDependencyVersionTest.java index 80d0d357b4a..a1f63670d46 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpgradeTransitiveDependencyVersionTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpgradeTransitiveDependencyVersionTest.java @@ -24,14 +24,14 @@ import java.util.List; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class UpgradeTransitiveDependencyVersionTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { spec - .beforeRecipe(withToolingApi()) + .beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new UpgradeTransitiveDependencyVersion( "com.fasterxml*", "jackson-core", "2.12.5", null, "CVE-2024-BAD", null)); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddBuildPluginTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddBuildPluginTest.java index 90868e8e2a6..b517dcf411f 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddBuildPluginTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddBuildPluginTest.java @@ -23,12 +23,12 @@ import static org.openrewrite.Tree.randomId; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class AddBuildPluginTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddDevelocityGradlePluginTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddDevelocityGradlePluginTest.java index 1add0c40ef8..e0576bb2209 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddDevelocityGradlePluginTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddDevelocityGradlePluginTest.java @@ -35,14 +35,14 @@ import static org.openrewrite.Tree.randomId; import static org.openrewrite.gradle.Assertions.buildGradle; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.test.SourceSpecs.dir; class AddDevelocityGradlePluginTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new AddDevelocityGradlePlugin("3.x", null, null, null, null, null)); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddSettingsPluginTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddSettingsPluginTest.java index 4700abd60ab..3102203e4ec 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddSettingsPluginTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/AddSettingsPluginTest.java @@ -28,12 +28,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class AddSettingsPluginTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new AddSettingsPlugin("com.gradle.enterprise", "3.11.x", null, null, null)); } @@ -131,7 +131,7 @@ void addPluginWithPluginManagementBlock() { @Test void addPluginApplyFalse() { rewriteRun( - spec -> spec.beforeRecipe(withToolingApi()) + spec -> spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new AddSettingsPlugin("com.gradle.enterprise", "3.11.x", null, false, null)), settingsGradle( "", diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/ChangePluginTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/ChangePluginTest.java index c2fd2c5365d..ddc229f556e 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/ChangePluginTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/ChangePluginTest.java @@ -31,12 +31,12 @@ import static java.util.Objects.requireNonNull; import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class ChangePluginTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new ChangePlugin("org.openrewrite.rewrite", "io.moderne.rewrite", "0.x")); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/ChangePluginVersionTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/ChangePluginVersionTest.java index a93853a9a9f..5305cc8d562 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/ChangePluginVersionTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/ChangePluginVersionTest.java @@ -21,13 +21,13 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class ChangePluginVersionTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/MigrateGradleEnterpriseToDevelocityTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/MigrateGradleEnterpriseToDevelocityTest.java index a4a70e6c888..f3f0818c168 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/MigrateGradleEnterpriseToDevelocityTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/MigrateGradleEnterpriseToDevelocityTest.java @@ -22,13 +22,13 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class MigrateGradleEnterpriseToDevelocityTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { spec.recipe(new MigrateGradleEnterpriseToDevelocity("3.17.x")) - .beforeRecipe(withToolingApi()); + .beforeRecipe(withToolingApiUsingModulesCaching()); } @Test diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/RemoveDevelocityTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/RemoveDevelocityTest.java index 3c26e264f79..340992d43c6 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/RemoveDevelocityTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/RemoveDevelocityTest.java @@ -21,13 +21,13 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; class RemoveDevelocityTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { spec - .beforeRecipe(withToolingApi()) + .beforeRecipe(withToolingApiUsingModulesCaching()) .recipeFromResource("/META-INF/rewrite/gradle.yml", "org.openrewrite.gradle.plugins.RemoveDevelocity"); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/UpgradePluginVersionTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/UpgradePluginVersionTest.java index e5c1c4a081b..b4819957d00 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/UpgradePluginVersionTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/UpgradePluginVersionTest.java @@ -29,13 +29,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.properties.Assertions.properties; class UpgradePluginVersionTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()); + spec.beforeRecipe(withToolingApiUsingModulesCaching()); } @DocumentExample("Upgrading a build plugin") diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/DependencyInsightTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/DependencyInsightTest.java index 72b0309adc1..02f189a33b6 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/DependencyInsightTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/DependencyInsightTest.java @@ -23,14 +23,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.groovy.Assertions.groovy; class DependencyInsightTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - spec.beforeRecipe(withToolingApi()) + spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new DependencyInsight("com.google.guava", "failureaccess", null, null)); } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/FindGradleProjectTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/FindGradleProjectTest.java index 77aac1afae2..b6b0550a03a 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/FindGradleProjectTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/FindGradleProjectTest.java @@ -23,7 +23,7 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.maven.Assertions.pomXml; import static org.openrewrite.test.SourceSpecs.text; @@ -38,7 +38,7 @@ public void defaults(RecipeSpec spec) { @EnumSource(FindGradleProject.SearchCriteria.class) void isGradleGroovyProject(FindGradleProject.SearchCriteria criteria) { rewriteRun( - spec -> spec.beforeRecipe(withToolingApi()) + spec -> spec.beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(new FindGradleProject(criteria)), buildGradle( """ diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/FindPluginsTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/FindPluginsTest.java index 78cd8c053fc..a125e0a1f23 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/FindPluginsTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/FindPluginsTest.java @@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.gradle.Assertions.buildGradle; import static org.openrewrite.gradle.Assertions.settingsGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.properties.Assertions.properties; import static org.openrewrite.test.SourceSpecs.text; @@ -41,7 +41,7 @@ public void defaults(RecipeSpec spec) { @Test void findPlugin() { rewriteRun( - spec -> spec.beforeRecipe(withToolingApi()), + spec -> spec.beforeRecipe(withToolingApiUsingModulesCaching()), buildGradle( """ plugins { @@ -68,7 +68,7 @@ void findPlugin() { @Test void settingsResolutionStrategy() { rewriteRun( - spec -> spec.beforeRecipe(withToolingApi()), + spec -> spec.beforeRecipe(withToolingApiUsingModulesCaching()), settingsGradle( """ pluginManagement { @@ -107,7 +107,7 @@ void settingsResolutionStrategy() { @Test void property() { rewriteRun( - spec -> spec.beforeRecipe(withToolingApi()), + spec -> spec.beforeRecipe(withToolingApiUsingModulesCaching()), properties("rewritePluginVersion=6.22.0", spec -> spec.path("gradle.properties")), buildGradle( """ diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/trait/GradleDependencyTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/trait/GradleDependencyTest.java index a73d5af1cf1..79571573f99 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/trait/GradleDependencyTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/trait/GradleDependencyTest.java @@ -22,14 +22,14 @@ import org.openrewrite.test.RewriteTest; import static org.openrewrite.gradle.Assertions.buildGradle; -import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApi; +import static org.openrewrite.gradle.toolingapi.Assertions.withToolingApiUsingModulesCaching; import static org.openrewrite.gradle.trait.Traits.gradleDependency; class GradleDependencyTest implements RewriteTest { @Override public void defaults(RecipeSpec spec) { spec - .beforeRecipe(withToolingApi()) + .beforeRecipe(withToolingApiUsingModulesCaching()) .recipe(RewriteTest.toRecipe(() -> gradleDependency().asVisitor(dep -> SearchResult.found(dep.getTree(), dep.getResolvedDependency().getGav().toString())))); }