You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2021/08/26 09:25:07 UTC

[groovy-release] branch master updated (a63566f -> 402bdb5)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy-release.git.


    from a63566f  refactoring to use built-in JDK11+ HttpClient
     new d2b4d89  bump gradle to 6.9.1
     new 402bdb5  use JDK11 Http client

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build.gradle                             |  20 +++---
 buildSrc/src/main/groovy/HttpUtil.groovy |  43 +++++++++++-
 gradle.properties                        |   4 --
 gradle/adhoc.gradle                      |  16 +----
 gradle/buildscript.gradle                |  10 +++
 gradle/phase1.gradle                     |  16 +----
 gradle/phase2.gradle                     | 117 +++++++++----------------------
 gradle/wrapper/gradle-wrapper.jar        | Bin 56177 -> 59203 bytes
 gradle/wrapper/gradle-wrapper.properties |   2 +-
 gradlew                                  |  53 ++++++++------
 gradlew.bat                              |  43 +++++++-----
 11 files changed, 157 insertions(+), 167 deletions(-)
 create mode 100644 gradle/buildscript.gradle

[groovy-release] 02/02: use JDK11 Http client

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy-release.git

commit 402bdb571137775aa3e754b041e2b4579e2151c6
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Aug 26 19:25:01 2021 +1000

    use JDK11 Http client
---
 build.gradle                             |  20 +++---
 buildSrc/src/main/groovy/HttpUtil.groovy |  43 +++++++++++-
 gradle.properties                        |   4 --
 gradle/adhoc.gradle                      |  16 +----
 gradle/buildscript.gradle                |  10 +++
 gradle/phase1.gradle                     |  16 +----
 gradle/phase2.gradle                     | 117 +++++++++----------------------
 7 files changed, 99 insertions(+), 127 deletions(-)

diff --git a/build.gradle b/build.gradle
index c698703..d16f948 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-import org.apache.tools.ant.taskdefs.condition.Os
+//import org.apache.tools.ant.taskdefs.condition.Os
 
 /**
  * Phase1 is invoked with:
@@ -54,26 +54,22 @@ import org.apache.tools.ant.taskdefs.condition.Os
  * <li>The KEYS file is currently assumed to be updated manually outside this build script</li>
  * </ul>
  */
-
 buildscript {
     repositories {
-        jcenter()
-        maven {
-            url "https://plugins.gradle.org/m2/"
-        }
+        mavenCentral()
     }
 
     dependencies {
-        classpath "org.ajoberstar:grgit:${getProperty('version.grgit')}"
-        classpath "at.bxm.gradleplugins:gradle-svntools-plugin:${getProperty('version.svntools')}"
-        classpath "io.github.http-builder-ng:http-builder-ng-okhttp:${getProperty('version.httpbuilderng')}"
-        classpath "org.hidetake:gradle-ssh-plugin:${getProperty('version.sshplugin')}"
-        classpath "gradle.plugin.io.sdkman:gradle-sdkvendor-plugin:${getProperty('version.sdkmanplugin')}"
+        classpath 'javax.xml.bind:jaxb-api:2.3.1'
     }
 }
 
+plugins {
+    id 'org.hidetake.ssh' version '2.10.1'
+    id "io.sdkman.vendors" version "1.2.0"
+}
+
 ext {
-    grgitClass = org.ajoberstar.grgit.Grgit
     repoBase = 'https://gitbox.apache.org/repos/asf'
     repoUri = "$repoBase/groovy.git"
     websiteRepo = 'https://gitbox.apache.org/repos/asf/groovy-website.git'
diff --git a/buildSrc/src/main/groovy/HttpUtil.groovy b/buildSrc/src/main/groovy/HttpUtil.groovy
index 6a83fab..191771d 100644
--- a/buildSrc/src/main/groovy/HttpUtil.groovy
+++ b/buildSrc/src/main/groovy/HttpUtil.groovy
@@ -22,16 +22,57 @@ class HttpUtil {
                 .build()
     }
 
-    static HttpRequest putRequest(url, json, user, password) {
+    static HttpRequest headRequest(url, user, password) {
+        HttpRequest.newBuilder()
+                .uri(new URI(url))
+                .header('Authorization', 'Basic ' + "$user:$password".getBytes('iso-8859-1').encodeBase64())
+                .method("HEAD", HttpRequest.BodyPublishers.noBody())
+                .build()
+    }
+
+    static HttpRequest putRequest(url, String json, user, password) {
+        def body = HttpRequest.BodyPublishers.ofString(json)
+        HttpRequest.newBuilder()
+                .uri(new URI(url))
+                .header('Authorization', 'Basic ' + "$user:$password".getBytes('iso-8859-1').encodeBase64())
+                .header('Content-Type', 'application/json')
+                .PUT(body)
+                .build()
+    }
+
+    static HttpRequest postRequest(url, String json, user, password) {
         def body = HttpRequest.BodyPublishers.ofString(json)
         HttpRequest.newBuilder()
                 .uri(new URI(url))
                 .header('Authorization', 'Basic ' + "$user:$password".getBytes('iso-8859-1').encodeBase64())
                 .header('Content-Type', 'application/json')
+                .POST(body)
+                .build()
+    }
+
+    static HttpRequest putRequest(prefix, File file, user, password) {
+        def body = HttpRequest.BodyPublishers.ofFile(file.toPath())
+        HttpRequest.newBuilder()
+                .uri(new URI("$prefix/$file.name"))
+                .header('Authorization', 'Basic ' + "$user:$password".getBytes('iso-8859-1').encodeBase64())
+                .header('Content-Type', 'octet-stream')
                 .PUT(body)
                 .build()
     }
 
+    static boolean awaitPublication(url, user, password, int delay, int numTries) {
+        def found = false
+        def request = headRequest(url, user, password)
+        def client = newClient()
+        def response
+        while (!found && numTries-- > 0) {
+            response = client.send(request, HttpResponse.BodyHandlers.discarding())
+            if (response.statusCode() == 200) found = true
+            else sleep delay
+        }
+        found
+    }
+
     static WrappedResponse send(HttpClient client, HttpRequest request) {
         new WrappedResponse(client.send(request, HttpResponse.BodyHandlers.ofString()))
     }
diff --git a/gradle.properties b/gradle.properties
index 8bb8af5..93a1ab3 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,5 +1 @@
-version.grgit=2.3.0
-version.svntools=2.2.1
 version.httpbuilderng=1.0.4
-version.sshplugin=2.7.0
-version.sdkmanplugin=1.1.1
diff --git a/gradle/adhoc.gradle b/gradle/adhoc.gradle
index 8327b6b..8f05fb6 100644
--- a/gradle/adhoc.gradle
+++ b/gradle/adhoc.gradle
@@ -3,20 +3,11 @@ import org.ajoberstar.grgit.util.JGitUtil
 import org.apache.tools.ant.taskdefs.condition.Os
 
 buildscript {
-    repositories {
-        maven {
-            url "https://plugins.gradle.org/m2/"
-        }
-    }
-
-    dependencies {
-        classpath "org.ajoberstar:grgit:${getProperty('version.grgit')}"
-        classpath "at.bxm.gradleplugins:gradle-svntools-plugin:${getProperty('version.svntools')}"
-        classpath "org.hidetake:gradle-ssh-plugin:${getProperty('version.sshplugin')}"
-        classpath "gradle.plugin.io.sdkman:gradle-sdkvendor-plugin:${getProperty('version.sdkmanplugin')}"
-    }
+    apply from: "gradle/buildscript.gradle", to: buildscript
 }
 
+ext.grgitClass = org.ajoberstar.grgit.Grgit
+
 ssh.settings {
     dryRun = project.hasProperty('dryRun')
     // TODO explore whether this can be made more secure - below not working on windows
@@ -68,7 +59,6 @@ task websitePublishUserSite(dependsOn: websiteBuild) {
 task untagVersion(dependsOn: assumesPropsSet) {
     doLast {
         def apacheCredentials = new Credentials(apacheUser, apachePassword)
-//        def apacheCredentials = new Credentials(username: apacheUser, password: apachePassword)
         def grgit = grgitClass.open(dir: stagingDir, creds: apacheCredentials)
         def tagName = "GROOVY_$underVersion"
         def tag = null
diff --git a/gradle/buildscript.gradle b/gradle/buildscript.gradle
new file mode 100644
index 0000000..47e2611
--- /dev/null
+++ b/gradle/buildscript.gradle
@@ -0,0 +1,10 @@
+repositories {
+    maven {
+        url "https://plugins.gradle.org/m2/"
+    }
+}
+
+dependencies {
+    classpath "org.ajoberstar:grgit:2.3.0"
+    classpath "at.bxm.gradleplugins:gradle-svntools-plugin:3.1"
+}
diff --git a/gradle/phase1.gradle b/gradle/phase1.gradle
index 8629b6a..d7dc5e1 100644
--- a/gradle/phase1.gradle
+++ b/gradle/phase1.gradle
@@ -9,21 +9,11 @@ import org.ajoberstar.grgit.util.JGitUtil
 import org.apache.tools.ant.taskdefs.condition.Os
 
 buildscript {
-    repositories {
-        maven {
-            url "https://plugins.gradle.org/m2/"
-        }
-    }
-
-    dependencies {
-        classpath "org.ajoberstar:grgit:${getProperty('version.grgit')}"
-        classpath "at.bxm.gradleplugins:gradle-svntools-plugin:${getProperty('version.svntools')}"
-        classpath "org.hidetake:gradle-ssh-plugin:${getProperty('version.sshplugin')}"
-        classpath "gradle.plugin.io.sdkman:gradle-sdkvendor-plugin:${getProperty('version.sdkmanplugin')}"
-    }
+    apply from: "gradle/buildscript.gradle", to: buildscript
 }
+apply plugin: at.bxm.gradleplugins.svntools.SvnToolsPlugin
 
-apply plugin: "at.bxm.svntools"
+ext.grgitClass = org.ajoberstar.grgit.Grgit
 
 svntools {
     username = apacheUser
diff --git a/gradle/phase2.gradle b/gradle/phase2.gradle
index ffd7a6d..aa84776 100644
--- a/gradle/phase2.gradle
+++ b/gradle/phase2.gradle
@@ -3,29 +3,16 @@ import at.bxm.gradleplugins.svntools.tasks.SvnAdd
 import at.bxm.gradleplugins.svntools.tasks.SvnCheckout
 import at.bxm.gradleplugins.svntools.tasks.SvnCommit
 import at.bxm.gradleplugins.svntools.tasks.SvnDelete
-import groovyx.net.http.HttpBuilder
 import org.ajoberstar.grgit.Credentials
 
 buildscript {
-    repositories {
-        jcenter()
-        maven {
-            url "https://plugins.gradle.org/m2/"
-        }
-    }
-
+    apply from: "gradle/buildscript.gradle", to: buildscript
     dependencies {
-        classpath "org.ajoberstar:grgit:${getProperty('version.grgit')}"
-        classpath "at.bxm.gradleplugins:gradle-svntools-plugin:${getProperty('version.svntools')}"
         classpath "io.github.http-builder-ng:http-builder-ng-okhttp:${getProperty('version.httpbuilderng')}"
-        classpath "org.hidetake:gradle-ssh-plugin:${getProperty('version.sshplugin')}"
-        classpath "gradle.plugin.io.sdkman:gradle-sdkvendor-plugin:${getProperty('version.sdkmanplugin')}"
     }
 }
 
-apply plugin: "at.bxm.svntools"
-apply plugin: "org.hidetake.ssh"
-apply plugin: "io.sdkman.vendors"
+ext.grgitClass = org.ajoberstar.grgit.Grgit
 
 svntools {
     username = apacheUser
@@ -60,30 +47,25 @@ sdkman {
 
 task jiraCheckPhase2(dependsOn: assumesRelVersion) {
     doLast {
-        def prefix = '/jira/rest/api/2'
-        def jira = HttpBuilder.configure {
-            request.uri = 'https://issues.apache.org'
-            request.auth.basic apacheUser, apachePassword
-        }
-        def resp = jira.get {
-            request.uri.path = "$prefix/project/GROOVY/versions"
-        }
-        def versionFields = resp.find { it.name == relVersion }
+        def prefix = 'https://issues.apache.org/jira/rest/api/2'
+        def client = HttpUtil.newClient()
+        def request = HttpUtil.getRequest("$prefix/project/GROOVY/versions", apacheUser, apachePassword)
+        def response = HttpUtil.send(client, request)
+        assert response.statusCode() == 200
+        def versionFields = response.json.find { it.name == relVersion }
         assert versionFields, "Version $relVersion not found in Jira!"
         assert versionFields.released, "Version $relVersion not yet released!"
         project.ext.versionId = versionFields.id
         project.ext.projectId = versionFields.projectId
 
-        resp = jira.get {
-            request.uri.path = "$prefix/version/$versionId/unresolvedIssueCount"
-        }
-        if (resp.issuesUnresolvedCount) {
+        request = HttpUtil.getRequest("$prefix/version/$versionId/unresolvedIssueCount", apacheUser, apachePassword)
+        response = HttpUtil.send(client, request)
+        if (response.json.issuesUnresolvedCount) {
             logger.warn "Warning found $resp.issuesUnresolvedCount unresolved issues for version $relVersion"
         }
-        resp = jira.get {
-            request.uri.path = "$prefix/version/$versionId/relatedIssueCounts"
-        }
-        project.ext.fixCount = resp.issuesFixedCount
+        request = HttpUtil.getRequest("$prefix/version/$versionId/relatedIssueCounts", apacheUser, apachePassword)
+        response = HttpUtil.send(client, request)
+        project.ext.fixCount = response.json.issuesFixedCount
     }
 }
 
@@ -194,17 +176,13 @@ task publishZipsOnArtifactory(dependsOn: [jiraCheckPhase2, assumesRelVersion]) {
     group = "Post-passed phase"
     description = "Publish distribution zips to Groovy artifactory instance"
     doLast {
-        def artifactory = HttpBuilder.configure {
-            request.uri = 'https://groovy.jfrog.io/'
-            request.headers['Authorization'] = 'Basic ' + "$artifactoryUser:$artifactoryPassword".getBytes('iso-8859-1').encodeBase64()
-        }
+        def prefix = 'https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips'
+        def client = HttpUtil.newClient()
         fileTree("$distParentDir/distributions").files.each { File f ->
             println "Uploading $f.name"
-            artifactory.put {
-                request.uri.path = "/artifactory/dist-release-local/groovy-zips/${f.name}"
-                request.body = f.bytes
-                request.contentType = 'application/octet-stream'
-            }
+            def request = HttpUtil.putRequest(prefix, f, apacheUser, apachePassword)
+            def response = HttpUtil.send(client, request)
+            assert response.statusCode() == 200
         }
         println "Zips uploaded! You may need to release manually."
     }
@@ -214,22 +192,10 @@ task waitForArtifactoryZipPublication(dependsOn: [publishZipsOnArtifactory/*, pr
     group = "Post-passed phase"
     description = "Polls the artifactory instance website to check if it is released"
     doLast {
-        def found = false
         def delay = 30000 // 1/2 a minute
         def numTries = 60 // wait for up to 30 mins
-        def artifactory = HttpBuilder.configure {
-            request.uri = 'https://groovy.jfrog.io/'
-        }
-        while (!found && numTries-- > 0) {
-            found = true
-            artifactory.head {
-                request.uri.path = "/artifactory/dist-release-local/groovy-zips/apache-groovy-sdk-${relVersion}.zip"
-                response.failure { fs ->
-                    sleep delay
-                    found = false
-                }
-            }
-        }
+        def url = "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-sdk-${relVersion}.zip"
+        def found = HttpUtil.awaitPublication(url, apacheUser, apachePassword, delay, numTries)
         assert found, 'Timed out waiting for artifactory publish/sync - please check manually'
     }
 }
@@ -396,7 +362,6 @@ task pushGroovyWebsite(dependsOn: updateGroovySitemap) {
     group = "Post-passed phase"
     description = "Pushes the Groovy website so that the new website is published"
     doLast {
-//        def githubCredentials = new Credentials(username: githubUser, password: githubPassword)
         def githubCredentials = new Credentials(githubUser, githubPassword)
         def grgit = grgitClass.open(dir: stagingWebsiteDir, creds: githubCredentials)
         grgit.add(patterns: ['sitemap.groovy'])
@@ -411,22 +376,10 @@ task waitForWebsitePublication(dependsOn: pushGroovyWebsite) {
     group = "Post-passed phase"
     description = "Polls the Groovy website to check if the changelog for this version is published"
     doLast {
-        def found = false
         def delay = 30000 // 1/2 a minute
         def numTries = 60 // wait for up to 30 mins
-        def usersite = HttpBuilder.configure {
-            request.uri = 'https://groovy-lang.org'
-        }
-        while (!found && numTries-- > 0) {
-            found = true
-            usersite.head {
-                request.uri.path = "/changelogs/changelog-${relVersion}.html"
-                response.failure { fs ->
-                    sleep delay
-                    found = false
-                }
-            }
-        }
+        def url = "https://groovy-lang.org/changelogs/changelog-${relVersion}.html"
+        def found = HttpUtil.awaitPublication(url, apacheUser, apachePassword, delay, numTries)
         assert found, 'Timed out waiting for website to be published - please check manually'
     }
 }
@@ -449,23 +402,19 @@ task createNextVersionInJira(dependsOn: [jiraCheckPhase2]) {
     group = "Post-passed phase"
     description = "Make sure that Jira is ready for the next version on this branch"
     doLast {
-        def prefix = '/jira/rest/api/2'
-        def jira = HttpBuilder.configure {
-            request.uri = 'https://issues.apache.org'
-            request.auth.basic apacheUser, apachePassword
-        }
-        def resp = jira.get {
-            request.uri.path = "$prefix/project/GROOVY/versions"
-        }
-        def versionFields = resp.find { it.name == nextVersion }
+        def prefix = 'https://issues.apache.org/jira/rest/api/2'
+        def client = HttpUtil.newClient()
+        def request = HttpUtil.getRequest("$prefix/project/GROOVY/versions", apacheUser, apachePassword)
+        def response = HttpUtil.send(client, request)
+        assert response.statusCode() == 200
+        def versionFields = response.json.find { it.name == nextVersion }
         if (versionFields) {
             println "Version $nextVersion already found in Jira!"
         } else {
-            jira.post {
-                request.uri.path = "$prefix/version"
-                request.body = /{ "name": "$nextVersion", "project": "GROOVY", "projectId": $projectId }/
-                request.contentType = 'application/json'
-            }
+            def body = /{ "name": "$nextVersion", "project": "GROOVY", "projectId": $projectId }/
+            request = HttpUtil.postRequest("$prefix/version", body, apacheUser, apachePassword)
+            response = HttpUtil.send(client, request)
+            assert response.statusCode() == 200
         }
     }
 }

[groovy-release] 01/02: bump gradle to 6.9.1

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy-release.git

commit d2b4d89d73c4723ad962451a1878144562366189
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Aug 26 18:38:04 2021 +1000

    bump gradle to 6.9.1
---
 gradle/wrapper/gradle-wrapper.jar        | Bin 56177 -> 59203 bytes
 gradle/wrapper/gradle-wrapper.properties |   2 +-
 gradlew                                  |  53 +++++++++++++++++++------------
 gradlew.bat                              |  43 ++++++++++++++-----------
 4 files changed, 58 insertions(+), 40 deletions(-)

diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 94336fc..e708b1c 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 442d913..3ab0b72 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index cccdd3d..4f906e0 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 f955316..107acd3 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