diff --git a/build.gradle b/build.gradle index f3015d04b..6d02fd248 100644 --- a/build.gradle +++ b/build.gradle @@ -14,11 +14,10 @@ */ buildscript { - ext.kotlin_version = '1.2.70' + ext.kotlin_version = '1.6.10' repositories { mavenCentral() - jcenter() } dependencies { @@ -41,10 +40,8 @@ allprojects { subprojects { apply plugin: 'com.github.ben-manes.versions' - apply plugin: 'maven' apply plugin: 'java' apply plugin: 'kotlin' - apply plugin: 'findbugs' sourceCompatibility = JavaVersion.VERSION_1_8 repositories { @@ -53,49 +50,49 @@ subprojects { } dependencies { - compile "org.slf4j:slf4j-api:$slf4jVersion" - testCompile ("org.mockito:mockito-core:$mockitoVersion") { + implementation "org.slf4j:slf4j-api:$slf4jVersion" + testImplementation ("org.mockito:mockito-core:$mockitoVersion") { exclude group: 'org.hamcrest' } - testCompile "junit:junit:$junitVersion" - testCompile "org.slf4j:slf4j-simple:$slf4jVersion" + testImplementation "junit:junit:$junitVersion" + testImplementation "org.slf4j:slf4j-simple:$slf4jVersion" } } -task wrapper(type: Wrapper) { - gradleVersion = '4.7' -} - project(':ds3-sdk') { dependencies { - compile project(':ds3-interfaces') - compile project(':ds3-utils') + implementation project(':ds3-interfaces') + implementation project(':ds3-utils') } } project(':ds3-metadata') { dependencies { - compile project(':ds3-interfaces') - compile project(':ds3-utils') + implementation project(':ds3-interfaces') + implementation project(':ds3-utils') } } project(':ds3-sdk-integration') { dependencies { - compile project(':ds3-sdk') - compile project(':ds3-metadata') + implementation project(':ds3-sdk') + implementation project(':ds3-interfaces') + implementation project(':ds3-metadata') + implementation project(':ds3-utils') } } project(':ds3-sdk-samples') { dependencies { - compile project(':ds3-sdk') + implementation project(':ds3-sdk') + implementation project(':ds3-interfaces') + implementation project(':ds3-utils') } } project(':ds3-utils') { dependencies { - compile project(':ds3-interfaces') + implementation project(':ds3-interfaces') } } diff --git a/ds3-metadata/build.gradle b/ds3-metadata/build.gradle index c0ee177a1..277450ff3 100644 --- a/ds3-metadata/build.gradle +++ b/ds3-metadata/build.gradle @@ -42,10 +42,12 @@ artifacts { } dependencies { - compile group: 'net.java.dev.jna', name: 'jna-platform', version: "$jnaVersion" - compile group: 'net.java.dev.jna', name: 'jna', version: "$jnaVersion" - compile "commons-io:commons-io:$commonsioVersion" - compile "org.apache.httpcomponents:httpclient:$httpclientVersion" + implementation group: 'net.java.dev.jna', name: 'jna-platform', version: "$jnaVersion" + implementation group: 'net.java.dev.jna', name: 'jna', version: "$jnaVersion" + implementation "commons-io:commons-io:$commonsioVersion" + implementation "org.apache.httpcomponents:httpclient:$httpclientVersion" + implementation "com.google.guava:guava:$guavaVersion" - testCompile group: 'org.apache.commons', name: 'commons-lang3', version: "$commonslangVersion" + + testImplementation group: 'org.apache.commons', name: 'commons-lang3', version: "$commonslangVersion" } diff --git a/ds3-sdk-integration/build.gradle b/ds3-sdk-integration/build.gradle index 7c77b95b5..9ed65cf26 100644 --- a/ds3-sdk-integration/build.gradle +++ b/ds3-sdk-integration/build.gradle @@ -14,9 +14,12 @@ */ dependencies { - compile "commons-codec:commons-codec:$commonscodecVersion" - compile "junit:junit:$junitVersion" - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" - testCompile group: 'org.apache.commons', name: 'commons-lang3', version: "$commonslangVersion" + implementation "commons-io:commons-io:$commonsioVersion" + implementation "commons-codec:commons-codec:$commonscodecVersion" + implementation "org.apache.httpcomponents:httpclient:$httpclientVersion" + implementation "com.google.guava:guava:$guavaVersion" + implementation "junit:junit:$junitVersion" + testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion" + testImplementation group: 'org.apache.commons', name: 'commons-lang3', version: "$commonslangVersion" } diff --git a/ds3-sdk-samples/build.gradle b/ds3-sdk-samples/build.gradle index 5fdd170c8..f2e721e7c 100644 --- a/ds3-sdk-samples/build.gradle +++ b/ds3-sdk-samples/build.gradle @@ -18,5 +18,6 @@ apply plugin: 'application' mainClassName = 'com.spectralogic.ds3client.samples.PartialObjectGetExample' dependencies { - compile "org.slf4j:slf4j-simple:$slf4jVersion" + implementation "org.slf4j:slf4j-simple:$slf4jVersion" + implementation "com.google.guava:guava:$guavaVersion" } diff --git a/ds3-sdk/build.gradle b/ds3-sdk/build.gradle index 8f8e1636c..6dc37aebf 100644 --- a/ds3-sdk/build.gradle +++ b/ds3-sdk/build.gradle @@ -69,13 +69,13 @@ task genConfigProperties { } } -task zip(type: Zip) { - from configurations.runtime.allArtifacts.files - from configurations.runtime - into (project.name + "-" + project.version) -} +//task zip(type: Zip) { +// from configurations.runtime.allArtifacts.files +// from configurations.runtime +// into (project.name + "-" + project.version) +//} -zip.dependsOn jar +//zip.dependsOn jar jar { from sourceSets.main.allJava @@ -85,12 +85,13 @@ jar.dependsOn genConfigProperties shadowJar.dependsOn genConfigProperties dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "org.apache.httpcomponents:httpclient:$httpclientVersion" - compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion" - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion" - compile "com.google.guava:guava:$guavaVersion" - compile 'org.codehaus.woodstox:woodstox-core-asl:4.4.1' - compile 'com.google.code.findbugs:annotations:3.0.1' - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "commons-io:commons-io:$commonsioVersion" + implementation "org.apache.httpcomponents:httpclient:$httpclientVersion" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion" + implementation "com.google.guava:guava:$guavaVersion" + implementation 'org.codehaus.woodstox:woodstox-core-asl:4.4.1' + implementation 'com.google.code.findbugs:annotations:3.0.1' + testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion" } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers_Test.java index f8b6c94b8..38188bfe1 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers_Test.java @@ -32,10 +32,10 @@ import com.spectralogic.ds3client.networking.ConnectionDetails; import com.spectralogic.ds3client.networking.FailedRequestException; import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; +import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.mockito.Matchers; import org.mockito.Mockito; import java.io.IOException; @@ -109,7 +109,7 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { public void testReadObjectsWithFailedGet() throws IOException, ParseException { final Ds3Client ds3Client = mock(Ds3Client.class); - Mockito.when(ds3Client.newForNode(Matchers.any())).thenReturn(ds3Client); + Mockito.when(ds3Client.newForNode(any())).thenReturn(ds3Client); final GetBulkJobSpectraS3Response buildBulkGetResponse = buildBulkGetResponse(); Mockito.when(ds3Client.getBulkJobSpectraS3(hasChunkOrdering(JobChunkClientProcessingOrderGuarantee.NONE))).thenReturn(buildBulkGetResponse); @@ -144,7 +144,7 @@ public void testWriteObjects() throws IOException, ParseException { final Ds3Client ds3Client = buildDs3ClientForBulk(); final PutBulkJobSpectraS3Response bulkPutResponse = buildBulkPutResponse(); - Mockito.when(ds3Client.putBulkJobSpectraS3(Matchers.any(PutBulkJobSpectraS3Request.class))).thenReturn(bulkPutResponse); + Mockito.when(ds3Client.putBulkJobSpectraS3(any(PutBulkJobSpectraS3Request.class))).thenReturn(bulkPutResponse); final AllocateJobChunkSpectraS3Response allocateResponse1 = buildAllocateResponse1(); final AllocateJobChunkSpectraS3Response allocateResponse2 = buildAllocateResponse2(); @@ -204,11 +204,11 @@ public void testWriteObjectsWithFailedPut() throws IOException, ParseException { final ConnectionDetails details = mock(ConnectionDetails.class); Mockito.when(details.getEndpoint()).thenReturn("localhost"); - Mockito.when(ds3Client.newForNode(Matchers.any())).thenReturn(ds3Client); + Mockito.when(ds3Client.newForNode(any())).thenReturn(ds3Client); Mockito.when(ds3Client.getConnectionDetails()).thenReturn(details); final PutBulkJobSpectraS3Response buildBulkPutResponse = buildBulkPutResponse(); - Mockito.when(ds3Client.putBulkJobSpectraS3(Matchers.any(PutBulkJobSpectraS3Request.class))).thenReturn(buildBulkPutResponse); + Mockito.when(ds3Client.putBulkJobSpectraS3(any(PutBulkJobSpectraS3Request.class))).thenReturn(buildBulkPutResponse); final AllocateJobChunkSpectraS3Response allocateResponse2 = buildAllocateResponse2(); final AllocateJobChunkSpectraS3Response allocateResponse3 = buildAllocateResponse3(); @@ -296,7 +296,7 @@ public void testRecoverWriteJob() throws IOException, JobRecoveryException, Pars final Ds3Client ds3Client = buildDs3ClientForBulk(); final ModifyJobSpectraS3Response modifyWriteJobResponse = buildModifyWriteJobResponse(); - Mockito.when(ds3Client.modifyJobSpectraS3(Matchers.any(ModifyJobSpectraS3Request.class))).thenReturn(modifyWriteJobResponse); + Mockito.when(ds3Client.modifyJobSpectraS3(any(ModifyJobSpectraS3Request.class))).thenReturn(modifyWriteJobResponse); final Job job = Ds3ClientHelpers.wrap(ds3Client).recoverWriteJob(jobId); assertThat(job.getJobId(), is(jobId)); @@ -308,7 +308,7 @@ public void testRecoverWriteJobThrowsJobRecoveryExceptionForWrongRequestType() t final Ds3Client ds3Client = buildDs3ClientForBulk(); final ModifyJobSpectraS3Response modifyReadJobResponse = buildModifyReadJobResponse(); - Mockito.when(ds3Client.modifyJobSpectraS3(Matchers.any(ModifyJobSpectraS3Request.class))).thenReturn(modifyReadJobResponse); + Mockito.when(ds3Client.modifyJobSpectraS3(any(ModifyJobSpectraS3Request.class))).thenReturn(modifyReadJobResponse); Ds3ClientHelpers.wrap(ds3Client).recoverWriteJob(jobId); } @@ -318,7 +318,7 @@ public void testRecoverReadJob() throws IOException, JobRecoveryException, Parse final Ds3Client ds3Client = buildDs3ClientForBulk(); final ModifyJobSpectraS3Response modifyReadJobResponse = buildModifyReadJobResponse(); - Mockito.when(ds3Client.modifyJobSpectraS3(Matchers.any(ModifyJobSpectraS3Request.class))).thenReturn(modifyReadJobResponse); + Mockito.when(ds3Client.modifyJobSpectraS3(any(ModifyJobSpectraS3Request.class))).thenReturn(modifyReadJobResponse); final Job job = Ds3ClientHelpers.wrap(ds3Client).recoverReadJob(jobId); assertThat(job.getJobId(), is(jobId)); @@ -330,7 +330,7 @@ public void testRecoverReadJobThrowsJobRecoveryExceptionForWrongRequestType() th final Ds3Client ds3Client = buildDs3ClientForBulk(); final ModifyJobSpectraS3Response modifyWriteJobResponse = buildModifyWriteJobResponse(); - Mockito.when(ds3Client.modifyJobSpectraS3(Matchers.any(ModifyJobSpectraS3Request.class))).thenReturn(modifyWriteJobResponse); + Mockito.when(ds3Client.modifyJobSpectraS3(any(ModifyJobSpectraS3Request.class))).thenReturn(modifyWriteJobResponse); Ds3ClientHelpers.wrap(ds3Client).recoverReadJob(jobId); } @@ -424,7 +424,7 @@ private static Ds3Client buildDs3ClientForBulk() throws IOException, .thenReturn(jobChunksResponse2) .thenReturn(jobChunksResponse3); - Mockito.when(ds3Client.newForNode(Matchers.any())).thenReturn(ds3Client); + Mockito.when(ds3Client.newForNode(any())).thenReturn(ds3Client); Mockito.when(ds3Client.getConnectionDetails()).thenReturn(details); return ds3Client; } @@ -613,7 +613,7 @@ public void testWriteObjectsWithRetryAfter() throws IOException, ParseException final PutBulkJobSpectraS3Response bulkPutResponse = buildBulkPutResponse(); Mockito.when(ds3Client - .putBulkJobSpectraS3(Matchers.any(PutBulkJobSpectraS3Request.class))) + .putBulkJobSpectraS3(any(PutBulkJobSpectraS3Request.class))) .thenReturn(bulkPutResponse); final AllocateJobChunkSpectraS3Response allocateResponse1 = buildAllocateResponse1(); @@ -675,22 +675,22 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { public void testEnsureBucketExistsRace() throws IOException { final Ds3Client ds3Client = mock(Ds3Client.class); final HeadBucketResponse response = buildHeadBucketResponse(HeadBucketResponse.Status.DOESNTEXIST); - Mockito.when(ds3Client.headBucket(Matchers.any(HeadBucketRequest.class))).thenReturn(response); - Mockito.when(ds3Client.putBucket(Matchers.any(PutBucketRequest.class))) + Mockito.when(ds3Client.headBucket(any(HeadBucketRequest.class))).thenReturn(response); + Mockito.when(ds3Client.putBucket(any(PutBucketRequest.class))) .thenThrow(new FailedRequestException(ImmutableList.of(202, 409), 409, new Error(), "Conflict", "5")); final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(ds3Client); helpers.ensureBucketExists("fake_bucket"); // if this throws an exception, then this test should fail - verify(ds3Client, atLeastOnce()).putBucket(Matchers.any(PutBucketRequest.class)); + verify(ds3Client, atLeastOnce()).putBucket(any(PutBucketRequest.class)); } @Test(expected = FailedRequestException.class) public void testEnsureBucketExistsReturnsError() throws IOException { final Ds3Client ds3Client = mock(Ds3Client.class); final HeadBucketResponse response = buildHeadBucketResponse(HeadBucketResponse.Status.DOESNTEXIST); - Mockito.when(ds3Client.headBucket(Matchers.any(HeadBucketRequest.class))).thenReturn(response); - Mockito.when(ds3Client.putBucket(Matchers.any(PutBucketRequest.class))) + Mockito.when(ds3Client.headBucket(any(HeadBucketRequest.class))).thenReturn(response); + Mockito.when(ds3Client.putBucket(any(PutBucketRequest.class))) .thenThrow(new FailedRequestException(ImmutableList.of(202, 409, 500), 500, new Error(), "Error", "5")); final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(ds3Client); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RequestMatchers.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RequestMatchers.java index b96015a48..7a5e5a359 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RequestMatchers.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RequestMatchers.java @@ -34,6 +34,7 @@ import static org.mockito.Matchers.argThat; + public final class RequestMatchers { public static GetBulkJobSpectraS3Request hasChunkOrdering(final JobChunkClientProcessingOrderGuarantee chunkOrdering) { return argThat(new TypeSafeMatcher() { diff --git a/ds3-utils/build.gradle b/ds3-utils/build.gradle index 370813280..862a689ff 100644 --- a/ds3-utils/build.gradle +++ b/ds3-utils/build.gradle @@ -17,7 +17,7 @@ apply from: "$rootDir/gradle/scripts/publish.gradle" dependencies { - compile "commons-codec:commons-codec:$commonscodecVersion" - compile "commons-io:commons-io:$commonsioVersion" - compile "com.google.guava:guava:$guavaVersion" + implementation "commons-codec:commons-codec:$commonscodecVersion" + implementation "commons-io:commons-io:$commonsioVersion" + implementation "com.google.guava:guava:$guavaVersion" } diff --git a/gradle.properties b/gradle.properties index 81eac5e78..91ddd564f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,14 +13,14 @@ # ***************************************************************************** # -commonscodecVersion=1.10 -commonsioVersion=2.4 -commonslangVersion=3.6 -guavaVersion=23.0 +commonscodecVersion=1.15 +commonsioVersion=2.11.0 +commonslangVersion=3.12.0 +guavaVersion=31.1-jre hamcrestVersion=1.3 -httpclientVersion=4.5.3 -jacksonVersion=2.9.0 -jnaVersion=4.2.2 +httpclientVersion=4.5.13 +jacksonVersion=2.13.3 +jnaVersion=4.5.1 junitVersion=4.12 mockitoVersion=1.10.+ -slf4jVersion=1.7.25 \ No newline at end of file +slf4jVersion=1.7.36 \ No newline at end of file diff --git a/gradle/scripts/publish.gradle b/gradle/scripts/publish.gradle index 7c973e883..288b16440 100644 --- a/gradle/scripts/publish.gradle +++ b/gradle/scripts/publish.gradle @@ -13,26 +13,24 @@ * **************************************************************************** */ -apply plugin: 'com.jfrog.bintray' - -bintray { - user = System.getenv('BINTRAY_USER') - key = System.getenv('BINTRAY_KEY') - - configurations = ['archives'] - - //dryRun = true - //publish = true - - pkg { - name = "$project.name" - repo = "ds3" - userOrg = "spectralogic" - websiteUrl = "https://github.com/SpectraLogic/ds3_java_sdk" - vcsUrl = "https://github.com/SpectraLogic/ds3_java_sdk.git" - licenses = ['Apache-2.0'] - version { - name = "$project.version" - } - } -} +//bintray { +// user = System.getenv('BINTRAY_USER') +// key = System.getenv('BINTRAY_KEY') +// +// configurations = ['archives'] +// +// //dryRun = true +// //publish = true +// +// pkg { +// name = "$project.name" +// repo = "ds3" +// userOrg = "spectralogic" +// websiteUrl = "https://github.com/SpectraLogic/ds3_java_sdk" +// vcsUrl = "https://github.com/SpectraLogic/ds3_java_sdk.git" +// licenses = ['Apache-2.0'] +// version { +// name = "$project.version" +// } +// } +//} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f6b961fd5..e708b1c02 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b251836b4..8049c684f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,20 +1,5 @@ -# -# ******************************************************************************* -# Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. -# Licensed under the Apache License, Version 2.0 (the "License"). You may not use -# this file except in compliance with the License. A copy of the License is located at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# or in the "license" file accompanying this file. -# This file 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. -# ***************************************************************************** -# - distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index cccdd3d51..4f906e0c8 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/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. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -66,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -109,10 +126,11 @@ 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 +# 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 @@ -138,19 +156,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + 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" ;; + 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 @@ -159,14 +177,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$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/gradlew.bat b/gradlew.bat index e95643d6a..ac1b06f93 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@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 @@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,28 +64,14 @@ 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=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell