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 2022/08/23 03:23:23 UTC

[groovy] branch master updated (286c9192ae -> 956b4daa22)

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.git


    from 286c9192ae GROOVY-10521: plain array parameter descriptor
     new 3c712d1e5d Remove aliyun maven repos
     new f8311c872c Move repos into settings.gradle
     new 6c0cdaa7a1 Enable typesafe project accessors
     new 659a4fa506 Add .gitattributes
     new 7965d1e8b6 Generate wrapper
     new cc841050a2 Publish build scan when running on GHA
     new 55e9003e19 Add .editorconfig
     new 956b4daa22 Remove redundant plugin applying

The 8 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:
 .editorconfig                                      |  10 +
 .gitattributes                                     |   4 +
 .github/workflows/groovy-build-test-ea.yml         |   4 +-
 .github/workflows/groovy-build-test.yml            |   2 -
 build.gradle                                       |  41 +---
 .../main/groovy/org.apache.groovy-common.gradle    |   4 -
 .../groovy/org.apache.groovy-distribution.gradle   |   8 +-
 .../groovy/org.apache.groovy-documented.gradle     |   4 +-
 gradle/build-scans.gradle                          |   2 +-
 gradle/wrapper/gradle-wrapper.jar                  | Bin 59203 -> 59821 bytes
 gradlew                                            | 257 ++++++++++++---------
 settings.gradle                                    |  10 +
 subprojects/groovy-ant/build.gradle                |   6 +-
 subprojects/groovy-astbuilder/build.gradle         |   2 +-
 subprojects/groovy-binary/build.gradle             |   2 +-
 subprojects/groovy-cli-commons/build.gradle        |   4 +-
 subprojects/groovy-cli-picocli/build.gradle        |   4 +-
 subprojects/groovy-console/build.gradle            |   8 +-
 subprojects/groovy-contracts/build.gradle          |   4 +-
 subprojects/groovy-datetime/build.gradle           |   4 +-
 subprojects/groovy-dateutil/build.gradle           |   2 +-
 subprojects/groovy-docgenerator/build.gradle       |   4 +-
 subprojects/groovy-ginq/build.gradle               |   8 +-
 subprojects/groovy-groovydoc/build.gradle          |   8 +-
 subprojects/groovy-groovysh/build.gradle           |   8 +-
 subprojects/groovy-jmx/build.gradle                |   4 +-
 subprojects/groovy-json/build.gradle               |   6 +-
 subprojects/groovy-jsr223/build.gradle             |   2 +-
 subprojects/groovy-macro-library/build.gradle      |   4 +-
 subprojects/groovy-macro/build.gradle              |   2 +-
 subprojects/groovy-nio/build.gradle                |   2 +-
 subprojects/groovy-servlet/build.gradle            |   8 +-
 subprojects/groovy-sql/build.gradle                |   4 +-
 subprojects/groovy-swing/build.gradle              |   4 +-
 subprojects/groovy-templates/build.gradle          |   4 +-
 subprojects/groovy-test-junit5/build.gradle        |   2 +-
 subprojects/groovy-test/build.gradle               |   2 +-
 subprojects/groovy-testng/build.gradle             |   2 +-
 subprojects/groovy-toml/build.gradle               |   6 +-
 subprojects/groovy-typecheckers/build.gradle       |   2 +-
 subprojects/groovy-xml/build.gradle                |   4 +-
 subprojects/groovy-yaml/build.gradle               |   6 +-
 subprojects/stress/build.gradle                    |   2 +-
 subprojects/tests-preview/build.gradle             |   2 +-
 44 files changed, 260 insertions(+), 218 deletions(-)
 create mode 100644 .editorconfig
 create mode 100644 .gitattributes


[groovy] 08/08: Remove redundant plugin applying

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.git

commit 956b4daa2288a18588a5061fbf4ce5b20b595e8a
Author: Goooler <wa...@gmail.com>
AuthorDate: Sun Aug 14 09:54:47 2022 +0800

    Remove redundant plugin applying
---
 build.gradle | 2 --
 1 file changed, 2 deletions(-)

diff --git a/build.gradle b/build.gradle
index de05611c5f..9f8bcb573e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -35,8 +35,6 @@ buildScanRecipes {
 
 archivesBaseName = 'groovy'
 
-apply plugin: "com.github.jk1.dependency-license-report"
-
 repositories {
     // todo Some repos are needed only for some configs. Declare them just for the configuration once Gradle allows this.
     maven { url 'https://repository.jboss.org/nexus/content/groups/m2-release-proxy' } // tools


[groovy] 07/08: Add .editorconfig

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.git

commit 55e9003e19ee9f6bad1530bd40c6e0f0aec338ed
Author: Goooler <wa...@gmail.com>
AuthorDate: Sun Aug 14 09:48:45 2022 +0800

    Add .editorconfig
---
 .editorconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..3a9b2b5d52
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,10 @@
+root = true
+
+[*]
+charset = utf-8
+indent_size = 4
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.{yml,yaml}]
+indent_size = 2


[groovy] 02/08: Move repos into settings.gradle

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.git

commit f8311c872c36b8f103fe9a59fee58ccff0e82e00
Author: Goooler <wa...@gmail.com>
AuthorDate: Sun Aug 14 00:52:11 2022 +0800

    Move repos into settings.gradle
---
 build.gradle    | 19 +------------------
 settings.gradle |  8 ++++++++
 2 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/build.gradle b/build.gradle
index 304ea47d55..6761dfb99c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -16,28 +16,11 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-buildscript {
-    repositories {
-        mavenCentral()
-//        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
-        maven {
-            url "https://plugins.gradle.org/m2/"
-        }
-        maven {
-            url 'https://jitpack.io'
-        }
-    }
-
-    dependencies {
-        //classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
-        classpath "gradle.plugin.com.github.jk1:gradle-license-report:1.3"
-    }
-}
-
 plugins {
     id 'me.champeau.buildscan-recipes' version '0.2.3'
     id 'com.github.ben-manes.versions' version '0.42.0'
     id 'com.github.blindpirate.osgi' version '0.0.6'
+    id "com.github.jk1.dependency-license-report" version "1.3"
     id 'org.sonarqube' version '3.0'
     id 'org.apache.groovy-core'
     id 'java-test-fixtures'
diff --git a/settings.gradle b/settings.gradle
index d83b6fb1c2..ee0e934b2a 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -18,6 +18,14 @@
  */
 import org.gradle.util.GradleVersion
 
+pluginManagement {
+    repositories {
+        gradlePluginPortal()
+        mavenCentral()
+//        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
+    }
+}
+
 plugins {
     id "com.gradle.enterprise" version "3.5.2"
 }


[groovy] 06/08: Publish build scan when running on GHA

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.git

commit cc841050a20488cc96c8ccd4bbb2e3cf2927176d
Author: Goooler <wa...@gmail.com>
AuthorDate: Sun Aug 14 08:44:54 2022 +0800

    Publish build scan when running on GHA
---
 .github/workflows/groovy-build-test-ea.yml | 4 +---
 .github/workflows/groovy-build-test.yml    | 2 --
 gradle/build-scans.gradle                  | 2 +-
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/groovy-build-test-ea.yml b/.github/workflows/groovy-build-test-ea.yml
index 3dd5f1794b..e1323754c7 100644
--- a/.github/workflows/groovy-build-test-ea.yml
+++ b/.github/workflows/groovy-build-test-ea.yml
@@ -42,6 +42,4 @@ jobs:
       - uses: gradle/gradle-build-action@v2
       - name: Test with Gradle
         run: ./gradlew test -Ptarget.java.home=/home/runner/openjdk
-        timeout-minutes: 60
-        env:
-          GRADLE_SCANS_ACCEPT: yes
+        timeout-minutes: 60
\ No newline at end of file
diff --git a/.github/workflows/groovy-build-test.yml b/.github/workflows/groovy-build-test.yml
index 0116b4861b..e17cce8db7 100644
--- a/.github/workflows/groovy-build-test.yml
+++ b/.github/workflows/groovy-build-test.yml
@@ -40,5 +40,3 @@ jobs:
       - name: Test with Gradle
         run: ./gradlew test
         timeout-minutes: 60
-        env:
-          GRADLE_SCANS_ACCEPT: yes
diff --git a/gradle/build-scans.gradle b/gradle/build-scans.gradle
index 427ddf5b33..5b4af89eec 100644
--- a/gradle/build-scans.gradle
+++ b/gradle/build-scans.gradle
@@ -19,7 +19,7 @@
 
 def acceptFile = new File(gradle.gradleUserHomeDir, "gradle-scans-license-agree.txt")
 def env = System.getenv()
-boolean isCI = env.CI || env.TRAVIS || env.TEAMCITY_VERSION
+boolean isCI = env.CI || env.TRAVIS || env.TEAMCITY_VERSION || env.GITHUB_ACTIONS
 boolean hasAccepted = isCI || env.GRADLE_SCANS_ACCEPT=='yes' || acceptFile.exists() && acceptFile.text.trim() == 'yes'
 boolean hasRefused = env.GRADLE_SCANS_ACCEPT=='no' || acceptFile.exists() && acceptFile.text.trim() == 'no'
 


[groovy] 03/08: Enable typesafe project accessors

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.git

commit 6c0cdaa7a191b0e6790d4d8a9517cb188d89d9ee
Author: Goooler <wa...@gmail.com>
AuthorDate: Sun Aug 14 00:57:38 2022 +0800

    Enable typesafe project accessors
---
 build.gradle                                             | 16 ++++++++--------
 .../main/groovy/org.apache.groovy-distribution.gradle    |  8 ++++----
 .../src/main/groovy/org.apache.groovy-documented.gradle  |  4 ++--
 settings.gradle                                          |  2 ++
 subprojects/groovy-ant/build.gradle                      |  6 +++---
 subprojects/groovy-astbuilder/build.gradle               |  2 +-
 subprojects/groovy-binary/build.gradle                   |  2 +-
 subprojects/groovy-cli-commons/build.gradle              |  4 ++--
 subprojects/groovy-cli-picocli/build.gradle              |  4 ++--
 subprojects/groovy-console/build.gradle                  |  8 ++++----
 subprojects/groovy-contracts/build.gradle                |  4 ++--
 subprojects/groovy-datetime/build.gradle                 |  4 ++--
 subprojects/groovy-dateutil/build.gradle                 |  2 +-
 subprojects/groovy-docgenerator/build.gradle             |  4 ++--
 subprojects/groovy-ginq/build.gradle                     |  8 ++++----
 subprojects/groovy-groovydoc/build.gradle                |  8 ++++----
 subprojects/groovy-groovysh/build.gradle                 |  8 ++++----
 subprojects/groovy-jmx/build.gradle                      |  4 ++--
 subprojects/groovy-json/build.gradle                     |  6 +++---
 subprojects/groovy-jsr223/build.gradle                   |  2 +-
 subprojects/groovy-macro-library/build.gradle            |  4 ++--
 subprojects/groovy-macro/build.gradle                    |  2 +-
 subprojects/groovy-nio/build.gradle                      |  2 +-
 subprojects/groovy-servlet/build.gradle                  |  8 ++++----
 subprojects/groovy-sql/build.gradle                      |  4 ++--
 subprojects/groovy-swing/build.gradle                    |  4 ++--
 subprojects/groovy-templates/build.gradle                |  4 ++--
 subprojects/groovy-test-junit5/build.gradle              |  2 +-
 subprojects/groovy-test/build.gradle                     |  2 +-
 subprojects/groovy-testng/build.gradle                   |  2 +-
 subprojects/groovy-toml/build.gradle                     |  6 +++---
 subprojects/groovy-typecheckers/build.gradle             |  2 +-
 subprojects/groovy-xml/build.gradle                      |  4 ++--
 subprojects/groovy-yaml/build.gradle                     |  6 +++---
 subprojects/stress/build.gradle                          |  2 +-
 subprojects/tests-preview/build.gradle                   |  2 +-
 36 files changed, 82 insertions(+), 80 deletions(-)

diff --git a/build.gradle b/build.gradle
index 6761dfb99c..de05611c5f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -111,12 +111,12 @@ dependencies {
         exclude(group: 'org.codehaus.groovy', module: 'groovy-all')
     }
 
-    testImplementation project(':groovy-ant')
-    testImplementation project(':groovy-xml')
-    testImplementation project(':groovy-json')
-    testImplementation project(':groovy-test')
-    testImplementation project(':groovy-macro')
-    testImplementation project(':groovy-dateutil')
+    testImplementation projects.groovyAnt
+    testImplementation projects.groovyXml
+    testImplementation projects.groovyJson
+    testImplementation projects.groovyTest
+    testImplementation projects.groovyMacro
+    testImplementation projects.groovyDateutil
     testImplementation "jmock:jmock:${versions.jmock}"
     testImplementation "jmock:jmock-cglib:${versions.jmock}"
     testImplementation "net.jcip:jcip-annotations:${versions.jcipAnnotations}"
@@ -126,8 +126,8 @@ dependencies {
     testImplementation "org.slf4j:jcl-over-slf4j:${versions.slf4j}"
     testImplementation "com.thoughtworks.qdox:qdox:${versions.qdox}"
 
-    testFixturesImplementation project(':groovy-xml')
-    testFixturesImplementation project(':groovy-test')
+    testFixturesImplementation projects.groovyXml
+    testFixturesImplementation projects.groovyTest
     testFixturesImplementation "xmlunit:xmlunit:${versions.xmlunit}"
 
     tools "com.eed3si9n.jarjar:jarjar:${versions.jarjar}"
diff --git a/buildSrc/src/main/groovy/org.apache.groovy-distribution.gradle b/buildSrc/src/main/groovy/org.apache.groovy-distribution.gradle
index ab3e993acc..2e4ff94bfc 100644
--- a/buildSrc/src/main/groovy/org.apache.groovy-distribution.gradle
+++ b/buildSrc/src/main/groovy/org.apache.groovy-distribution.gradle
@@ -107,15 +107,15 @@ dependencies {
             requireCapability 'org.apache.groovy:groovy-logging'
         }
     }
-    doc project(":groovy-all")
-    docgeneratorTool project(":groovy-docgenerator")
+    doc projects.groovyAll
+    docgeneratorTool projects.groovyDocgenerator
 }
 
 def docGDK = tasks.register('docGDK', DocGDK) {
     classpath.from configurations.docgeneratorTool
     classes.set(distributionExtension.docgeneratorClasses)
-    resources.from project(':groovy-docgenerator').file('src/main/resources/org/apache/groovy/docgenerator/groovy.ico')
-    resources.from project(':groovy-docgenerator').file('src/main/resources/org/apache/groovy/docgenerator/stylesheet.css')
+    resources.from projects.groovyDocgenerator.dependencyProject.file('src/main/resources/org/apache/groovy/docgenerator/groovy.ico')
+    resources.from projects.groovyDocgenerator.dependencyProject.file('src/main/resources/org/apache/groovy/docgenerator/stylesheet.css')
 }
 
 def distBin = tasks.register('distBin', Zip) {
diff --git a/buildSrc/src/main/groovy/org.apache.groovy-documented.gradle b/buildSrc/src/main/groovy/org.apache.groovy-documented.gradle
index 6e3b5e2777..fbf6da1912 100644
--- a/buildSrc/src/main/groovy/org.apache.groovy-documented.gradle
+++ b/buildSrc/src/main/groovy/org.apache.groovy-documented.gradle
@@ -38,8 +38,8 @@ configurations {
 }
 
 dependencies {
-    groovydocClasspath project(":groovy-groovydoc")
-    groovydocClasspath project(":groovy-ant")
+    groovydocClasspath projects.groovyGroovydoc
+    groovydocClasspath projects.groovyAnt
 }
 
 tasks.withType(Javadoc).configureEach {
diff --git a/settings.gradle b/settings.gradle
index ee0e934b2a..e0c59c7590 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -37,6 +37,8 @@ gradleEnterprise {
     }
 }
 
+enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
+
 def subprojects = [
         'groovy-all',
         'groovy-ant',
diff --git a/subprojects/groovy-ant/build.gradle b/subprojects/groovy-ant/build.gradle
index e7873c168f..13fb37c546 100644
--- a/subprojects/groovy-ant/build.gradle
+++ b/subprojects/groovy-ant/build.gradle
@@ -31,11 +31,11 @@ dependencies {
     implementation "org.apache.ant:ant-launcher:${versions.ant}"
     implementation "org.apache.ant:ant-antlr:${versions.ant}"
     // for groovydoc ant command
-    implementation project(':groovy-groovydoc'), {
+    implementation projects.groovyGroovydoc, {
         transitive = false
     }
     compileOnly "org.ow2.asm:asm-tree:${versions.asm}" // VerifyClass
     compileOnly "org.ow2.asm:asm-util:${versions.asm}" // VerifyClass
-    testImplementation project(':groovy-test')
-    testImplementation project(':groovy-xml')
+    testImplementation projects.groovyTest
+    testImplementation projects.groovyXml
 }
diff --git a/subprojects/groovy-astbuilder/build.gradle b/subprojects/groovy-astbuilder/build.gradle
index 65bf092361..e42fe5f45f 100644
--- a/subprojects/groovy-astbuilder/build.gradle
+++ b/subprojects/groovy-astbuilder/build.gradle
@@ -22,7 +22,7 @@ plugins {
 
 dependencies {
     api rootProject // AstBuilderTransformation publicly references numerous core classes
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-binary/build.gradle b/subprojects/groovy-binary/build.gradle
index 44f6ce1337..46c87b1d0c 100644
--- a/subprojects/groovy-binary/build.gradle
+++ b/subprojects/groovy-binary/build.gradle
@@ -96,7 +96,7 @@ distribution {
                 fileMode = 0755
                 exclude 'groovy.icns'
             }
-            from project(':groovy-docgenerator').file('src/main/resources/org/apache/groovy/docgenerator/groovy.ico')
+            from projects.groovyDocgenerator.dependencyProject.file('src/main/resources/org/apache/groovy/docgenerator/groovy.ico')
         }
         into('licenses') {
             from rootProject.file('licenses')
diff --git a/subprojects/groovy-cli-commons/build.gradle b/subprojects/groovy-cli-commons/build.gradle
index 1894ce5be4..51f9135904 100644
--- a/subprojects/groovy-cli-commons/build.gradle
+++ b/subprojects/groovy-cli-commons/build.gradle
@@ -23,8 +23,8 @@ plugins {
 dependencies {
     api rootProject // CliBuilder uses Option...
     implementation "commons-cli:commons-cli:${versions.commonsCli}"
-    testImplementation project(':groovy-test')
-    testImplementation project(':groovy-dateutil')
+    testImplementation projects.groovyTest
+    testImplementation projects.groovyDateutil
     testRuntimeOnly testFixtures(project(":"))
 }
 
diff --git a/subprojects/groovy-cli-picocli/build.gradle b/subprojects/groovy-cli-picocli/build.gradle
index 48925908b5..0b62385bb0 100644
--- a/subprojects/groovy-cli-picocli/build.gradle
+++ b/subprojects/groovy-cli-picocli/build.gradle
@@ -23,6 +23,6 @@ plugins {
 dependencies {
     api rootProject   // CliBuilder uses Option...
     implementation "info.picocli:picocli:${versions.picocli}"
-    testImplementation project(':groovy-test')
-    testImplementation project(':groovy-dateutil')
+    testImplementation projects.groovyTest
+    testImplementation projects.groovyDateutil
 }
diff --git a/subprojects/groovy-console/build.gradle b/subprojects/groovy-console/build.gradle
index 54e28043b4..83b9825f09 100644
--- a/subprojects/groovy-console/build.gradle
+++ b/subprojects/groovy-console/build.gradle
@@ -25,13 +25,13 @@ dependencies {
     implementation "com.github.javaparser:javaparser-core:${versions.javaParser}"
     implementation "org.ow2.asm:asm-util:${versions.asm}"
     implementation "org.abego.treelayout:org.abego.treelayout.core:${versions.treelayout}"
-    implementation project(':groovy-swing')
-    implementation project(':groovy-templates')
+    implementation projects.groovySwing
+    implementation projects.groovyTemplates
     implementation ("org.apache.ivy:ivy:${versions.ivy}") {
         transitive = false
     }
-    testImplementation project(':groovy-test')
-    testImplementation testFixtures(project(':groovy-swing'))
+    testImplementation projects.groovyTest
+    testImplementation testFixtures(projects.groovySwing)
 
     groovyCompilerClasspath(project(":")) {
         capabilities {
diff --git a/subprojects/groovy-contracts/build.gradle b/subprojects/groovy-contracts/build.gradle
index 864ff1e892..54e91e9b05 100644
--- a/subprojects/groovy-contracts/build.gradle
+++ b/subprojects/groovy-contracts/build.gradle
@@ -23,8 +23,8 @@ plugins {
 dependencies {
     api rootProject // ASTMatcher uses ASTNode
 
-    testImplementation project(':groovy-test')
-    testImplementation project(':groovy-templates')
+    testImplementation projects.groovyTest
+    testImplementation projects.groovyTemplates
     testImplementation("org.spockframework:spock-junit4:${versions.spock}") {
         exclude group: 'org.codehaus.groovy'
     }
diff --git a/subprojects/groovy-datetime/build.gradle b/subprojects/groovy-datetime/build.gradle
index 4ee582bd27..77d82404c9 100644
--- a/subprojects/groovy-datetime/build.gradle
+++ b/subprojects/groovy-datetime/build.gradle
@@ -22,8 +22,8 @@ plugins {
 
 dependencies {
     api rootProject // DateTimeExtensions has methods with Closure params...
-    testImplementation project(':groovy-test')
-    testImplementation project(':groovy-dateutil')
+    testImplementation projects.groovyTest
+    testImplementation projects.groovyDateutil
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-dateutil/build.gradle b/subprojects/groovy-dateutil/build.gradle
index 164ee00541..d7e17ee1c2 100644
--- a/subprojects/groovy-dateutil/build.gradle
+++ b/subprojects/groovy-dateutil/build.gradle
@@ -22,7 +22,7 @@ plugins {
 
 dependencies {
     api rootProject  // DateUtilExtensions has methods with Closure params...
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-docgenerator/build.gradle b/subprojects/groovy-docgenerator/build.gradle
index a41eac89da..0f6f6c912f 100644
--- a/subprojects/groovy-docgenerator/build.gradle
+++ b/subprojects/groovy-docgenerator/build.gradle
@@ -22,10 +22,10 @@ plugins {
 
 dependencies {
     implementation rootProject
-    implementation project(':groovy-templates')
+    implementation projects.groovyTemplates
     implementation "com.thoughtworks.qdox:qdox:${versions.qdox}"
 
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 plugins.withId('eclipse') {
diff --git a/subprojects/groovy-ginq/build.gradle b/subprojects/groovy-ginq/build.gradle
index c009144011..6ee05ca695 100644
--- a/subprojects/groovy-ginq/build.gradle
+++ b/subprojects/groovy-ginq/build.gradle
@@ -22,10 +22,10 @@ plugins {
 
 dependencies {
     api rootProject
-    api project(':groovy-macro')
-    testImplementation project(':groovy-test')
-    testImplementation project(':groovy-json')
-    testImplementation project(':groovy-console')
+    api projects.groovyMacro
+    testImplementation projects.groovyTest
+    testImplementation projects.groovyJson
+    testImplementation projects.groovyConsole
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-groovydoc/build.gradle b/subprojects/groovy-groovydoc/build.gradle
index 8d3b7d075f..94cccb55e5 100644
--- a/subprojects/groovy-groovydoc/build.gradle
+++ b/subprojects/groovy-groovydoc/build.gradle
@@ -24,11 +24,11 @@ dependencies {
     api rootProject // GroovydocVisitor extends ClassCodeVisitorSupport...
     api "com.github.javaparser:javaparser-core:${versions.javaParser}" // GroovydocJavaVisitor extends VoidVisitorAdapter...
 
-    implementation project(':groovy-templates')
-    implementation project(':groovy-docgenerator')
+    implementation projects.groovyTemplates
+    implementation projects.groovyDocgenerator
 
-    testImplementation project(':groovy-ant')
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyAnt
+    testImplementation projects.groovyTest
     testImplementation "org.apache.ant:ant-testutil:${versions.ant}"
 }
 
diff --git a/subprojects/groovy-groovysh/build.gradle b/subprojects/groovy-groovysh/build.gradle
index 10493ea80e..380f5fe1a5 100644
--- a/subprojects/groovy-groovysh/build.gradle
+++ b/subprojects/groovy-groovysh/build.gradle
@@ -22,10 +22,10 @@ plugins {
 
 dependencies {
     implementation rootProject
-    implementation project(':groovy-console')
-    implementation project(':groovy-templates')
-    implementation project(':groovy-xml')
-    testImplementation project(':groovy-test')
+    implementation projects.groovyConsole
+    implementation projects.groovyTemplates
+    implementation projects.groovyXml
+    testImplementation projects.groovyTest
     implementation("jline:jline:${versions.jline}") {
         exclude(group: 'junit', module: 'junit')
     }
diff --git a/subprojects/groovy-jmx/build.gradle b/subprojects/groovy-jmx/build.gradle
index 92743ab139..5ee777db95 100644
--- a/subprojects/groovy-jmx/build.gradle
+++ b/subprojects/groovy-jmx/build.gradle
@@ -22,9 +22,9 @@ plugins {
 
 dependencies {
     api rootProject // JmxBuilder extends FactoryBuilderSupport...
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
     testRuntimeOnly("org.apache.ivy:ivy:${versions.ivy}") {
         transitive = false
     }
-    testRuntimeOnly project(":groovy-swing")
+    testRuntimeOnly projects.groovySwing
 }
\ No newline at end of file
diff --git a/subprojects/groovy-json/build.gradle b/subprojects/groovy-json/build.gradle
index 917c11731b..de02faf881 100644
--- a/subprojects/groovy-json/build.gradle
+++ b/subprojects/groovy-json/build.gradle
@@ -23,8 +23,8 @@ plugins {
 dependencies {
     api rootProject // JsonBuilder extends GroovyObjectSupport...
 
-    testImplementation project(':groovy-test')
-    testImplementation project(':groovy-dateutil')
+    testImplementation projects.groovyTest
+    testImplementation projects.groovyDateutil
     testImplementation 'net.javacrumbs.json-unit:json-unit:2.35.0'
 
     testRuntimeOnly project(':'), {
@@ -33,7 +33,7 @@ dependencies {
             requireCapability 'org.apache.groovy:groovy-grapes'
         }
     }
-    testRuntimeOnly project(':groovy-ant') // for JavadocAssertionTests
+    testRuntimeOnly projects.groovyAnt // for JavadocAssertionTests
     testRuntimeOnly 'com.google.code.gson:gson:2.9.0' // json-unit requires gson, jackson1 or jackson2
 }
 
diff --git a/subprojects/groovy-jsr223/build.gradle b/subprojects/groovy-jsr223/build.gradle
index fc8dc82d56..6cae0bd9d1 100644
--- a/subprojects/groovy-jsr223/build.gradle
+++ b/subprojects/groovy-jsr223/build.gradle
@@ -22,7 +22,7 @@ plugins {
 
 dependencies {
     api rootProject // ScriptExtensions use Binding...
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-macro-library/build.gradle b/subprojects/groovy-macro-library/build.gradle
index 23c2d8729f..f334e87fc9 100644
--- a/subprojects/groovy-macro-library/build.gradle
+++ b/subprojects/groovy-macro-library/build.gradle
@@ -22,8 +22,8 @@ plugins {
 
 dependencies {
     implementation rootProject
-    implementation project(':groovy-macro')
-    testImplementation project(':groovy-test')
+    implementation projects.groovyMacro
+    testImplementation projects.groovyTest
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-macro/build.gradle b/subprojects/groovy-macro/build.gradle
index 0d7d15e09f..6793e2195a 100644
--- a/subprojects/groovy-macro/build.gradle
+++ b/subprojects/groovy-macro/build.gradle
@@ -22,7 +22,7 @@ plugins {
 
 dependencies {
     api rootProject // ASTMatcher use ASTNode...
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-nio/build.gradle b/subprojects/groovy-nio/build.gradle
index a84e338d7f..0ed023e105 100644
--- a/subprojects/groovy-nio/build.gradle
+++ b/subprojects/groovy-nio/build.gradle
@@ -23,7 +23,7 @@ plugins {
 dependencies {
     api rootProject // NioExtensions uses Closure
 
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
     testImplementation("org.spockframework:spock-junit4:${versions.spock}") {
         exclude group: 'org.codehaus.groovy'
     }
diff --git a/subprojects/groovy-servlet/build.gradle b/subprojects/groovy-servlet/build.gradle
index 30576dab74..8443d8930d 100644
--- a/subprojects/groovy-servlet/build.gradle
+++ b/subprojects/groovy-servlet/build.gradle
@@ -27,14 +27,14 @@ dependencies {
     }
 
     api rootProject  // ServletBinding extends Binding...
-    implementation project(':groovy-xml') // needed for MarkupBuilder
-    implementation project(':groovy-templates') // needed by TemplateServlet
+    implementation projects.groovyXml // needed for MarkupBuilder
+    implementation projects.groovyTemplates // needed by TemplateServlet
 
     testImplementation("javax.servlet:javax.servlet-api:${versions.javaxServletApi}")
     testImplementation("javax.servlet.jsp:javax.servlet.jsp-api:${versions.javaxJspApi}") {
         transitive = false
     }
     testImplementation "jmock:jmock:${versions.jmock}"
-    testImplementation project(':groovy-json')
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyJson
+    testImplementation projects.groovyTest
 }
diff --git a/subprojects/groovy-sql/build.gradle b/subprojects/groovy-sql/build.gradle
index 100766974f..1bd3e90e47 100644
--- a/subprojects/groovy-sql/build.gradle
+++ b/subprojects/groovy-sql/build.gradle
@@ -26,14 +26,14 @@ dependencies {
 // uncomment to test with other databases (requires changes elsewhere too)
 //    testImplementation 'com.h2database:h2:1.3.164'
 //    testImplementation 'hsqldb:hsqldb:1.8.0.10'
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
     testRuntimeOnly(project(':')) {
         because "Tests are using Grapes"
         capabilities {
             requireCapability("org.apache.groovy:groovy-grapes")
         }
     }
-    testCompileOnly(project(":groovy-macro")) {
+    testCompileOnly(projects.groovyMacro) {
         because "tests are using macro methods"
     }
 }
diff --git a/subprojects/groovy-swing/build.gradle b/subprojects/groovy-swing/build.gradle
index 84da59b668..58c9aa4b7a 100644
--- a/subprojects/groovy-swing/build.gradle
+++ b/subprojects/groovy-swing/build.gradle
@@ -23,9 +23,9 @@ plugins {
 
 dependencies {
     api rootProject  // SwingBuilder extends FactoryBuilderSupport...
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
     testImplementation testFixtures(project(':'))
-    testFixturesImplementation project(':groovy-test')
+    testFixturesImplementation projects.groovyTest
     testFixturesImplementation testFixtures(project(':'))
 }
 
diff --git a/subprojects/groovy-templates/build.gradle b/subprojects/groovy-templates/build.gradle
index 5605d61a36..0b7ec93e70 100644
--- a/subprojects/groovy-templates/build.gradle
+++ b/subprojects/groovy-templates/build.gradle
@@ -22,8 +22,8 @@ plugins {
 
 dependencies {
     api rootProject // Template uses Writable...
-    implementation project(':groovy-xml')
-    testImplementation project(':groovy-test')
+    implementation projects.groovyXml
+    testImplementation projects.groovyTest
     testImplementation ("org.spockframework:spock-core:${versions.spock}") {
         exclude group: 'org.codehaus.groovy'
     }
diff --git a/subprojects/groovy-test-junit5/build.gradle b/subprojects/groovy-test-junit5/build.gradle
index 1afdaff171..dd41e65b11 100644
--- a/subprojects/groovy-test-junit5/build.gradle
+++ b/subprojects/groovy-test-junit5/build.gradle
@@ -36,7 +36,7 @@ dependencies {
     testImplementation 'net.jqwik:jqwik:1.6.5'
     testRuntimeOnly "org.junit.platform:junit-platform-engine:${versions.junit5Platform}"
     testRuntimeOnly "org.junit.platform:junit-platform-runner:${versions.junit5Platform}"
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 tasks.named('test') {
diff --git a/subprojects/groovy-test/build.gradle b/subprojects/groovy-test/build.gradle
index 2849c0822c..655944cb0b 100644
--- a/subprojects/groovy-test/build.gradle
+++ b/subprojects/groovy-test/build.gradle
@@ -24,7 +24,7 @@ dependencies {
     api rootProject   // GroovyTestCase uses Closure...
     api "junit:junit:${versions.junit}" // GroovyTestCase extends TestCase...
     // groovy-ant needed for FileNameFinder used in AllTestSuite and JavadocAssertionTestSuite
-    testRuntimeOnly(project(':groovy-ant')) {
+    testRuntimeOnly(projects.groovyAnt) {
         transitive = false // bring in just what we need below
     }
     testRuntimeOnly "org.apache.ant:ant:${versions.ant}"
diff --git a/subprojects/groovy-testng/build.gradle b/subprojects/groovy-testng/build.gradle
index c06e97148e..61e09eacf3 100644
--- a/subprojects/groovy-testng/build.gradle
+++ b/subprojects/groovy-testng/build.gradle
@@ -29,7 +29,7 @@ dependencies {
         exclude(group: 'org.apache.ant', module: 'ant')
         exclude(group: 'org.yaml', module: 'snakeyaml')
     }
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-toml/build.gradle b/subprojects/groovy-toml/build.gradle
index 8b5b626e96..6211143335 100644
--- a/subprojects/groovy-toml/build.gradle
+++ b/subprojects/groovy-toml/build.gradle
@@ -23,9 +23,9 @@ plugins {
 dependencies {
     api rootProject  // TomlBuilder extends GroovyObjectSupport...
     implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-toml:${versions.jackson}"
-    implementation project(':groovy-json')
-    testImplementation project(':groovy-test')
-    testRuntimeOnly project(':groovy-ant') // for JavadocAssertionTests
+    implementation projects.groovyJson
+    testImplementation projects.groovyTest
+    testRuntimeOnly projects.groovyAnt // for JavadocAssertionTests
 }
 
 plugins.withId('eclipse') {
diff --git a/subprojects/groovy-typecheckers/build.gradle b/subprojects/groovy-typecheckers/build.gradle
index 7e68d652d0..6564937772 100644
--- a/subprojects/groovy-typecheckers/build.gradle
+++ b/subprojects/groovy-typecheckers/build.gradle
@@ -22,7 +22,7 @@ plugins {
 
 dependencies {
     implementation rootProject
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 groovyLibrary {
diff --git a/subprojects/groovy-xml/build.gradle b/subprojects/groovy-xml/build.gradle
index 42268c0102..a4dc0fb93e 100644
--- a/subprojects/groovy-xml/build.gradle
+++ b/subprojects/groovy-xml/build.gradle
@@ -23,13 +23,13 @@ plugins {
 dependencies {
     api rootProject // MarkupBuilder extends BuilderSupport...
 
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
     testImplementation "xmlunit:xmlunit:${versions.xmlunit}"
     testImplementation("org.spockframework:spock-core:${versions.spock}") {
         exclude group: 'org.codehaus.groovy'
     }
 
-    testRuntimeOnly project(':groovy-ant') // for JavadocAssertionTests
+    testRuntimeOnly projects.groovyAnt // for JavadocAssertionTests
     testRuntimeOnly("org.apache.ivy:ivy:${versions.ivy}") {
         transitive = false
         because 'JavadocAssertionTests use @Grab'
diff --git a/subprojects/groovy-yaml/build.gradle b/subprojects/groovy-yaml/build.gradle
index 9d2739d269..2e18115e20 100644
--- a/subprojects/groovy-yaml/build.gradle
+++ b/subprojects/groovy-yaml/build.gradle
@@ -24,10 +24,10 @@ dependencies {
     api rootProject  // YamlBuilder extends GroovyObjectSupport...
     implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}"
     implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jacksonDatabind}"
-    implementation project(':groovy-json')
-    testImplementation project(':groovy-test')
+    implementation projects.groovyJson
+    testImplementation projects.groovyTest
     testRuntimeOnly "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
-    testRuntimeOnly project(':groovy-ant') // for JavadocAssertionTests
+    testRuntimeOnly projects.groovyAnt // for JavadocAssertionTests
 }
 
 plugins.withId('eclipse') {
diff --git a/subprojects/stress/build.gradle b/subprojects/stress/build.gradle
index fd0246acfb..55ff802d79 100644
--- a/subprojects/stress/build.gradle
+++ b/subprojects/stress/build.gradle
@@ -21,7 +21,7 @@ plugins {
 }
 
 dependencies {
-    stressTestImplementation project(':groovy-test')
+    stressTestImplementation projects.groovyTest
 }
 
 sonarqube {
diff --git a/subprojects/tests-preview/build.gradle b/subprojects/tests-preview/build.gradle
index 3426bf9259..3895e10878 100644
--- a/subprojects/tests-preview/build.gradle
+++ b/subprojects/tests-preview/build.gradle
@@ -24,7 +24,7 @@ plugins {
 
 dependencies {
     implementation rootProject
-    testImplementation project(':groovy-test')
+    testImplementation projects.groovyTest
 }
 
 tasks.withType(Test).configureEach {


[groovy] 04/08: Add .gitattributes

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.git

commit 659a4fa5066f6edcdc2b6b5797ec99aa9e9dfaa7
Author: Goooler <wa...@gmail.com>
AuthorDate: Sun Aug 14 01:15:45 2022 +0800

    Add .gitattributes
---
 .gitattributes | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..27fc7c2960
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+* text=auto eol=lf
+
+*.bat text eol=crlf
+*.jar binary
\ No newline at end of file


[groovy] 01/08: Remove aliyun maven repos

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.git

commit 3c712d1e5de7095347228ddac122afbe1aef5b10
Author: Goooler <wa...@gmail.com>
AuthorDate: Sun Aug 14 00:42:04 2022 +0800

    Remove aliyun maven repos
---
 build.gradle                                             | 4 ----
 buildSrc/src/main/groovy/org.apache.groovy-common.gradle | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/build.gradle b/build.gradle
index 42ec23aca3..304ea47d55 100644
--- a/build.gradle
+++ b/build.gradle
@@ -18,10 +18,6 @@
  */
 buildscript {
     repositories {
-        if (rootProject.hasProperty('buildInChina')) {
-            // Try to use Aliyun maven repository when building in China
-            maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
-        }
         mavenCentral()
 //        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
         maven {
diff --git a/buildSrc/src/main/groovy/org.apache.groovy-common.gradle b/buildSrc/src/main/groovy/org.apache.groovy-common.gradle
index cb9ceeb1c0..2db32283a2 100644
--- a/buildSrc/src/main/groovy/org.apache.groovy-common.gradle
+++ b/buildSrc/src/main/groovy/org.apache.groovy-common.gradle
@@ -42,10 +42,6 @@ group = 'org.apache.groovy'
 version = sharedConfiguration.groovyVersion.get()
 
 repositories {
-    if (rootProject.hasProperty('buildInChina')) {
-        // Try to use Aliyun maven repository when building in China
-        maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
-    }
     mavenCentral()
 }
 


[groovy] 05/08: Generate wrapper

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.git

commit 7965d1e8b60a094b211b49286d8af19a4fe19cdf
Author: Goooler <wa...@gmail.com>
AuthorDate: Sun Aug 14 08:43:13 2022 +0800

    Generate wrapper
---
 gradle/wrapper/gradle-wrapper.jar | Bin 59203 -> 59821 bytes
 gradlew                           | 257 +++++++++++++++++++++++---------------
 2 files changed, 153 insertions(+), 104 deletions(-)

diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index e708b1c023..41d9927a4d 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradlew b/gradlew
index 4f906e0c81..1b6c787337 100755
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
-#!/usr/bin/env sh
+#!/bin/sh
 
 #
-# Copyright 2015 the original author or authors.
+# 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.
@@ -17,67 +17,101 @@
 #
 
 ##############################################################################
-##
-##  Gradle start up script for UN*X
-##
+#
+#   Gradle 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 Gradle
+#
+#       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 GRADLE_OPTS) 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.
+#
+#       You can find Gradle at https://github.com/gradle/gradle/.
+#
 ##############################################################################
 
 # 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
+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
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
 
 APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
+APP_BASE_NAME=${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='"-Xmx64m" "-Xms64m"'
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
+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
-    ;;
-  MINGW* )
-    msys=true
-    ;;
-  NONSTOP* )
-    nonstop=true
-    ;;
+case "$( uname )" in                #(
+  CYGWIN* )         cygwin=true  ;; #(
+  Darwin* )         darwin=true  ;; #(
+  MSYS* | MINGW* )  msys=true    ;; #(
+  NONSTOP* )        nonstop=true ;;
 esac
 
 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
 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"
+        JAVACMD=$JAVA_HOME/jre/sh/java
     else
-        JAVACMD="$JAVA_HOME/bin/java"
+        JAVACMD=$JAVA_HOME/bin/java
     fi
     if [ ! -x "$JAVACMD" ] ; then
         die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
 location of your Java installation."
     fi
 else
-    JAVACMD="java"
+    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
@@ -106,80 +140,95 @@ 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
+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
 
-# 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
+# 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 GRADLE_OPTS environment variables.
 
 # 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
+if "$cygwin" || "$msys" ; then
+    APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+    JAVACMD=$( cygpath --unix "$JAVACMD" )
+
     # 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\""
+    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
-        i=`expr $i + 1`
+        # 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
-    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;
+#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS 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 -- \
+        "-Dorg.gradle.appname=$APP_BASE_NAME" \
+        -classpath "$CLASSPATH" \
+        org.gradle.wrapper.GradleWrapperMain \
+        "$@"
+
+# 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.
+#
 
-# 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"
+eval "set -- $(
+        printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+        xargs -n1 |
+        sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+        tr '\n' ' '
+    )" '"$@"'
 
 exec "$JAVACMD" "$@"