├── samples ├── filesets │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── sub │ │ │ └── takeMe.md │ │ │ └── txt │ │ │ ├── takeme.txt │ │ │ └── notMe-staging.txt │ ├── README.md │ └── build.gradle ├── groovyVersions │ ├── README.md │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── Example.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── ExampleTest.java │ └── build.gradle ├── gradle.properties ├── settings.gradle ├── simpleGroovy │ ├── src │ │ ├── main │ │ │ └── groovy │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── Example.groovy │ │ └── test │ │ │ └── groovy │ │ │ └── com │ │ │ └── example │ │ │ └── ExampleTest.groovy │ ├── README.md │ └── build.gradle ├── junit │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── Example.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── ExampleTest.java │ ├── README.md │ └── build.gradle ├── multishell │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── Example.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── ExampleTest.java │ ├── README.md │ └── build.gradle ├── simple │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── Example.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── ExampleTest.java │ ├── README.md │ └── build.gradle ├── README.md ├── mongo │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── config │ │ │ │ ├── PersonRepository.java │ │ │ │ ├── Application.java │ │ │ │ ├── PersonService.java │ │ │ │ ├── Person.java │ │ │ │ └── FongoDatabaseConfig.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── config │ │ │ └── PersonServiceTest.java │ ├── build.gradle │ └── README.md ├── src │ └── test │ │ └── groovy │ │ └── com │ │ └── tkruse │ │ └── gradle │ │ └── groovysh │ │ ├── LauncherHelper.groovy │ │ ├── JUnitSpecification.groovy │ │ ├── MongoSpecification.groovy │ │ ├── SimpleGroovySpecification.groovy │ │ ├── FilesetsSpecification.groovy │ │ ├── GroovyVersionsSpecification.groovy │ │ ├── SimpleSpecification.groovy │ │ └── MultiShellSpecification.groovy ├── build.gradle └── config │ ├── gradle │ └── java-builds.gradle │ ├── codenarc │ └── rules.groovy │ └── checkstyle │ └── checkstyle.xml ├── settings.gradle ├── .gitignore ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle1.10 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew ├── gradle1.11 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew ├── gradle1.12 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew ├── gradle1.9 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ └── gradlew.bat ├── gradle2.0 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ └── gradlew.bat ├── gradle2.1 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ └── gradlew.bat ├── gradle2.10 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew ├── gradle2.13 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew ├── gradle2.14 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew ├── gradle2.3 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ └── gradlew.bat ├── gradle2.4 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ └── gradlew.bat ├── gradle2.5 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ └── gradlew.bat ├── gradle2.6 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ └── gradlew.bat ├── gradle2.7 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew ├── gradle2.8 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew ├── gradle2.9 │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew.bat │ └── gradlew └── gradle2.2.1 │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ └── gradlew.bat ├── src ├── main │ ├── resources │ │ ├── META-INF │ │ │ └── gradle-plugins │ │ │ │ └── com.github.tkruse.groovysh.properties │ │ └── com.tkruse.gradle.groovysh │ │ │ └── TaskHelper.properties │ └── groovy │ │ └── com │ │ └── tkruse │ │ └── gradle │ │ └── groovysh │ │ ├── ApplicationShellTaskExtension.groovy │ │ ├── BuildShellTaskExtension.groovy │ │ ├── BuildDevShellTaskExtension.groovy │ │ ├── GroovyshPluginExtension.groovy │ │ ├── ShellTaskExtension.groovy │ │ ├── GenerateMainTask.java │ │ ├── DynamicInvokeHelper.groovy │ │ ├── BuildDevShellTask.groovy │ │ ├── BuildShellTask.groovy │ │ ├── ApplicationShellTask.groovy │ │ ├── GroovyshPlugin.groovy │ │ └── AbstractShellTask.groovy └── test │ └── groovy │ └── com │ └── tkruse │ └── gradle │ └── groovysh │ ├── TestHelper.groovy │ ├── BuildDevShellTaskTest.groovy │ ├── GroovyshPluginTest.groovy │ └── BuildShellTaskTest.groovy ├── doc ├── BlogPost.md ├── Examples.md ├── Contributing.md ├── Groovysh.md ├── InstallBuildDevShellManually.md ├── TODO.md ├── InstallAppShellManually.md └── Configuration.md ├── .travis.yml ├── CHANGELOG.md ├── config └── codenarc │ └── rules.groovy ├── gradlew.bat └── gradlew /samples/filesets/src/main/resources/sub/takeMe.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/filesets/src/main/resources/txt/takeme.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/filesets/src/main/resources/txt/notMe-staging.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'gradle-groovysh-plugin' 2 | -------------------------------------------------------------------------------- /samples/groovyVersions/README.md: -------------------------------------------------------------------------------- 1 | # Integration Test with several Groovy versions 2 | -------------------------------------------------------------------------------- /samples/gradle.properties: -------------------------------------------------------------------------------- 1 | # org.gradle.daemon=true 2 | # org.gradle.jvmargs=-Xmx2048m 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build/ 3 | .gradle/ 4 | gradle/gradle1* 5 | *.iws 6 | *.ids 7 | *.iml 8 | *.ipr 9 | .idea 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/META-INF/gradle-plugins/com.github.tkruse.groovysh.properties: -------------------------------------------------------------------------------- 1 | implementation-class=com.tkruse.gradle.groovysh.GroovyshPlugin 2 | -------------------------------------------------------------------------------- /gradle/gradle1.10/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle1.10/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle1.11/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle1.11/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle1.12/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle1.12/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle1.9/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle1.9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.0/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.0/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.1/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.1/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.10/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.10/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.13/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.13/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.14/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.14/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.3/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.3/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.4/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.4/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.5/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.5/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.6/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.6/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.7/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.7/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.8/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.9/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/gradle2.2.1/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkruse/gradle-groovysh-plugin/HEAD/gradle/gradle2.2.1/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/settings.gradle: -------------------------------------------------------------------------------- 1 | include 'simple' 2 | include 'junit' 3 | include 'filesets' 4 | include 'simpleGroovy' 5 | include 'mongo' 6 | include 'multishell' 7 | include 'groovyVersions' 8 | -------------------------------------------------------------------------------- /samples/simpleGroovy/src/main/groovy/com/example/Example.groovy: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | /** 4 | * example 5 | */ 6 | class Example { 7 | String helloWorld() { 8 | return 'Hello World' 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/junit/src/main/java/com/example/Example.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | /** 4 | * example 5 | */ 6 | public class Example { 7 | public String helloWorld() { 8 | return "Hello World"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/multishell/src/main/java/com/example/Example.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | /** 4 | * example 5 | */ 6 | public class Example { 7 | public String helloWorld() { 8 | return "Hello World"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/simple/src/main/java/com/example/Example.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | /** 4 | * example 5 | */ 6 | public class Example { 7 | public String helloWorld() { 8 | return "Hello World"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/groovyVersions/src/main/java/com/example/Example.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | /** 4 | * example 5 | */ 6 | public class Example { 7 | public String helloWorld() { 8 | return "Hello World"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/ApplicationShellTaskExtension.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | /** 4 | * configuration options for ApplicationShellTask 5 | */ 6 | class ApplicationShellTaskExtension extends ShellTaskExtension { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jul 03 18:01:55 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip 7 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/BuildShellTaskExtension.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | /** 4 | * Options for the BuildShellTask 5 | */ 6 | class BuildShellTaskExtension extends ShellTaskExtension { 7 | 8 | String gradleVersion = '2.12' 9 | 10 | } 11 | -------------------------------------------------------------------------------- /gradle/gradle1.9/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu May 15 20:33:57 CEST 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.9-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.0/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jul 06 10:43:49 CEST 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.1/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jan 09 23:23:35 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.10/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Dec 24 15:09:38 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.3/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Mar 14 13:33:08 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.4/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jul 25 22:17:52 CEST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.5/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jul 25 22:26:41 CEST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.6/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 24 10:21:20 CEST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.7/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Dec 24 15:02:32 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.8/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Dec 24 14:59:10 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.9/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Dec 24 15:08:43 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle1.10/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu May 15 20:35:42 CEST 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.10-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle1.11/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu May 15 20:36:15 CEST 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.11-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle1.12/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun May 04 16:19:28 CEST 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.13/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jul 03 17:36:53 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.14/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jul 03 17:42:20 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip 7 | -------------------------------------------------------------------------------- /gradle/gradle2.2.1/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jan 09 23:25:29 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip 7 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/BuildDevShellTaskExtension.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | /** 4 | * options for the BuildDevShell Task 5 | */ 6 | @SuppressWarnings('EmptyClass') 7 | class BuildDevShellTaskExtension { 8 | 9 | // no extension yet, could have initial imports and commands easily. 10 | } 11 | -------------------------------------------------------------------------------- /samples/simpleGroovy/src/test/groovy/com/example/ExampleTest.groovy: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import org.junit.Test 4 | 5 | /** 6 | * example test 7 | */ 8 | class ExampleTest { 9 | 10 | @Test 11 | void testHelloWorld() { 12 | Example example = new Example() 13 | assert example.helloWorld() == 'Hello World' 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/GroovyshPluginExtension.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | /** 4 | * config for the plugin itself 5 | */ 6 | class GroovyshPluginExtension { 7 | 8 | boolean enableBuildDevShell = true 9 | boolean enableBuildShell = true 10 | boolean enableAppShell = true 11 | 12 | String groovyVersion = '2.4.4' 13 | } 14 | -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | # Sample projects for gradle groovysh plugins 2 | 3 | The projects in here serve both as tutorial examples as well as for integration tests. 4 | See the README files of the sample projects for examples of shell task usages. 5 | 6 | 7 | ### Why is this not a gradle subproject? 8 | 9 | This gradle project is intentionally separate from the plugin project to not influence builds when placed in 10 | buildSrc. 11 | -------------------------------------------------------------------------------- /samples/junit/src/test/java/com/example/ExampleTest.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * example test 9 | */ 10 | public class ExampleTest { 11 | 12 | @Test 13 | public void testHelloWorld() { 14 | final Example example = new Example(); 15 | assertEquals(example.helloWorld(), "Hello World"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /samples/simple/src/test/java/com/example/ExampleTest.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * example test 9 | */ 10 | public class ExampleTest { 11 | 12 | @Test 13 | public void testHelloWorld() { 14 | final Example example = new Example(); 15 | assertEquals(example.helloWorld(), "Hello World"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /samples/multishell/src/test/java/com/example/ExampleTest.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * example test 9 | */ 10 | public class ExampleTest { 11 | 12 | @Test 13 | public void testHelloWorld() { 14 | final Example example = new Example(); 15 | assertEquals(example.helloWorld(), "Hello World"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /samples/groovyVersions/src/test/java/com/example/ExampleTest.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * example test 9 | */ 10 | public class ExampleTest { 11 | 12 | @Test 13 | public void testHelloWorld() { 14 | final Example example = new Example(); 15 | assertEquals(example.helloWorld(), "Hello World"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /samples/simple/README.md: -------------------------------------------------------------------------------- 1 | # Example for simple POJO being used interactively. 2 | 3 | Session: 4 | 5 | ```Groovy 6 | $ gradle -q shell 7 | This is a gradle Application Shell. 8 | You can import your application classes and act on them. 9 | Groovy Shell (2.3.1, JVM: 1.7.0_55) 10 | Type ':help' or ':h' for help. 11 | groovy:000> import com.example.Example 12 | ===> com.example.Example 13 | groovy:000> new Example().helloWorld() 14 | ===> Hello World 15 | ``` 16 | -------------------------------------------------------------------------------- /samples/simpleGroovy/README.md: -------------------------------------------------------------------------------- 1 | # Example for simple POJO in Groovy being used interactively. 2 | 3 | Session: 4 | 5 | ```Groovy 6 | $ gradle -q shell 7 | This is a gradle Application Shell. 8 | You can import your application classes and act on them. 9 | Groovy Shell (2.3.1, JVM: 1.7.0_55) 10 | Type ':help' or ':h' for help. 11 | groovy:000> import com.example.Example 12 | ===> com.example.Example 13 | groovy:000> new Example().helloWorld() 14 | ===> Hello World 15 | ``` 16 | -------------------------------------------------------------------------------- /samples/mongo/src/main/java/com/example/config/PersonRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.config; 2 | 3 | import org.springframework.data.mongodb.repository.MongoRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * example repository 10 | */ 11 | @Repository 12 | public interface PersonRepository extends MongoRepository { 13 | 14 | List findByLastName(String name); 15 | 16 | Person findByPId(String personId); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /samples/simple/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | // if plugin groovysh not found, add project to samples/settings.gradle 3 | apply plugin: 'com.github.tkruse.groovysh' 4 | 5 | 6 | 7 | // For an independent project, you would need the lines below. in this case they are in the parent folder 8 | 9 | //buildscript { 10 | // repositories { 11 | // jcenter() 12 | // dependencies { 13 | // classpath 'com.tkruse.gradle:gradle-groovysh-plugin:' 14 | // } 15 | // } 16 | //} 17 | 18 | dependencies { 19 | testCompile("junit:junit-dep:4.11") { force = true } 20 | } 21 | 22 | 23 | test { 24 | testLogging { 25 | exceptionFormat 'full' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /doc/BlogPost.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Groovy to Java as Python to C++ 4 | JVM Languages 5 | 6 | Groovy: 7 | - Gradle 8 | - Spock 9 | - Geb 10 | - Grails 11 | - Griffon 12 | 13 | Shell, like Debugger and Automated testing allow interaction with a system from a developers point of view. 14 | 15 | Groovysh: Based onScript compiling, no eval 16 | 17 | ## Groovysh used: 18 | 19 | within intellij / eclipse / grails 20 | Alternative: beanshell GroovyConsole 21 | 22 | ## Use cases 23 | 24 | - Writing tutorials 25 | - Exploring API / library 26 | - teaching 27 | 28 | ## Demonstration 29 | 30 | - fibonacci or so 31 | - ratpack 32 | - spring boot 33 | - some REST API va sdk 34 | 35 | 36 | ## Tricks: 37 | 38 | Grapes 39 | Editor 40 | interpreter-mode 41 | -------------------------------------------------------------------------------- /samples/junit/README.md: -------------------------------------------------------------------------------- 1 | # Example for running tests interactively. 2 | 3 | Session: 4 | 5 | ```Groovy 6 | $ gradle -q shell 7 | This is a gradle Application Shell. 8 | You can import your application classes and act on them. 9 | Groovy Shell (2.3.1, JVM: 1.7.0_55) 10 | Type ':help' or ':h' for help. 11 | -------------------------------------------------- 12 | groovy:000> import org.junit.runner.JUnitCore 13 | ===> org.junit.runner.JUnitCore 14 | groovy:000> jCore = new JUnitCore() 15 | ===> org.junit.runner.JUnitCore@53daaf33 16 | groovy:000> import com.example.ExampleTest 17 | ===> org.junit.runner.JUnitCore, com.example.ExampleTest 18 | groovy:000> result = jCore.run(ExampleTest.class) 19 | ===> org.junit.runner.Result@42f8b48b 20 | groovy:000> result.getFailures() 21 | ===> [] 22 | ``` 23 | -------------------------------------------------------------------------------- /samples/junit/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | // if plugin groovysh not found, add project to samples/settings.gradle 3 | apply plugin: 'com.github.tkruse.groovysh' 4 | 5 | 6 | 7 | // For an independent project, you would need the lines below. in this case they are in the parent folder 8 | 9 | //buildscript { 10 | // repositories { 11 | // jcenter() 12 | // dependencies { 13 | // classpath 'com.tkruse.gradle:gradle-groovysh-plugin:' 14 | // } 15 | // } 16 | //} 17 | 18 | 19 | groovysh { 20 | shell { 21 | sourceSetName = 'test' 22 | } 23 | } 24 | 25 | 26 | dependencies { 27 | testCompile("junit:junit-dep:4.11") { force = true } 28 | } 29 | 30 | 31 | test { 32 | testLogging { 33 | exceptionFormat 'full' 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/ShellTaskExtension.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.api.file.FileCollection 4 | 5 | /** 6 | * common shell tasks configuration 7 | */ 8 | class ShellTaskExtension { 9 | 10 | String sourceSetName = 'main' 11 | FileCollection extraClasspath 12 | List jvmArgs 13 | List args 14 | File workingDir 15 | // following JavaExec properties provided just for completeness sake 16 | FileCollection bootstrapClasspath 17 | boolean enableAssertions = false 18 | Map environment 19 | OutputStream errorOutput 20 | String maxHeapSize 21 | InputStream standardInput = System.in 22 | OutputStream standardOutput 23 | Map systemProperties 24 | String gradleVersion 25 | 26 | } 27 | -------------------------------------------------------------------------------- /samples/groovyVersions/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | // if plugin groovysh not found, add project to samples/settings.gradle 3 | apply plugin: 'com.github.tkruse.groovysh' 4 | 5 | 6 | 7 | // For an independent project, you would need the lines below. in this case they are in the parent folder 8 | 9 | //buildscript { 10 | // repositories { 11 | // jcenter() 12 | // dependencies { 13 | // classpath 'com.tkruse.gradle:gradle-groovysh-plugin:' 14 | // } 15 | // } 16 | //} 17 | 18 | groovysh { 19 | groovyVersion = project.hasProperty('groovyVersion') ? project.getProperty('groovyVersion') : '2.4.4' 20 | } 21 | 22 | dependencies { 23 | testCompile("junit:junit-dep:4.11") { force = true } 24 | } 25 | 26 | 27 | test { 28 | testLogging { 29 | exceptionFormat 'full' 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/filesets/README.md: -------------------------------------------------------------------------------- 1 | # Example for introspecting the gradle build process 2 | 3 | Session: 4 | 5 | ```Groovy 6 | $ gradle -q clean buildDevShell 7 | groovysh: This is a gradle Build-Shell. The variable 'project' is bound to your project. 8 | groovysh: Run e.g. 'project.ext.properties' to inspect your project. 9 | Groovy Shell (1.8.6, JVM: 1.7.0_55) 10 | Type 'help' or '\h' for help. 11 | ----------------------------------------------------------------------- 12 | groovy:000> project.tasks.copyTask2.getInputs().getFiles().collect{it.name} 13 | ===> [] 14 | groovy:000> project.tasks.copyTask.getInputs().getFiles().collect{it.name} 15 | ===> [takeMe.md, notMe-staging.txt, takeme.txt] 16 | groovy:000> project.tasks.copyTask.execute() 17 | ===> null 18 | groovy:000> project.tasks.copyTask.getInputs().getFiles().collect{it.name} 19 | ===> [takeMe.md, notMe-staging.txt, takeme.txt] 20 | ``` 21 | -------------------------------------------------------------------------------- /samples/simpleGroovy/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | // if plugin groovysh not found, add project to samples/settings.gradle 3 | apply plugin: 'com.github.tkruse.groovysh' 4 | 5 | 6 | 7 | // For an independent project, you would need the lines below. in this case they are in the parent folder 8 | 9 | //buildscript { 10 | // repositories { 11 | // jcenter() 12 | // dependencies { 13 | // classpath 'com.tkruse.gradle:gradle-groovysh-plugin:' 14 | // } 15 | // } 16 | //} 17 | 18 | project.ext { 19 | groovyVersion = project.hasProperty('groovyVersion') ? project.getProperty('groovyVersion') : '2.3.9' 20 | } 21 | 22 | dependencies { 23 | compile "org.codehaus.groovy:groovy-all:$groovyVersion" 24 | testCompile("junit:junit-dep:4.11") { force = true } 25 | } 26 | 27 | 28 | test { 29 | testLogging { 30 | exceptionFormat 'full' 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/filesets/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | // if plugin groovysh not found, add project to samples/settings.gradle 3 | apply plugin: 'com.github.tkruse.groovysh' 4 | 5 | // For an independent project, you would need the lines below. in this case they are in the parent folder 6 | 7 | //buildscript { 8 | // repositories { 9 | // jcenter() 10 | // dependencies { 11 | // classpath 'com.tkruse.gradle:gradle-groovysh-plugin:' 12 | // } 13 | // } 14 | //} 15 | 16 | 17 | test { 18 | testLogging { 19 | exceptionFormat 'full' 20 | } 21 | } 22 | 23 | 24 | // Some nasty copy tasks specs below 25 | task copyTask(type: Copy) { 26 | from 'src/main/resources' 27 | into "$buildDir/result" 28 | } 29 | 30 | task copyTask2(type: Copy) { 31 | from copyTask 32 | into "$buildDir/result2" 33 | exclude '**/*staging*' 34 | include '**/*.md' 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: groovy 2 | sudo: false 3 | jdk: 4 | - oraclejdk7 5 | - oraclejdk8 6 | - openjdk7 7 | env: 8 | - TERM=dumb GRADLE=gradle/gradle1.12/gradlew 9 | - TERM=dumb GRADLE=gradle/gradle2.0/gradlew 10 | - TERM=dumb GRADLE=gradle/gradle2.2.1/gradlew 11 | - TERM=dumb GRADLE=gradle/gradle2.5/gradlew 12 | - TERM=dumb GRADLE=gradle/gradle2.6/gradlew 13 | - TERM=dumb GRADLE=gradle/gradle2.8/gradlew 14 | - TERM=dumb GRADLE=gradle/gradle2.9/gradlew 15 | - TERM=dumb GRADLE=gradle/gradle2.10/gradlew 16 | - TERM=dumb GRADLE=gradle/gradle2.13/gradlew 17 | - TERM=dumb GRADLE=gradle/gradle2.14/gradlew 18 | install: ./gradlew assemble --stacktrace 19 | script: 20 | - ./gradlew clean build --stacktrace && $GRADLE -p samples clean check -x codenarcMain -x codenarcTest && $GRADLE -p samples codenarcMain codenarcTest 21 | notifications: 22 | email: false 23 | branches: 24 | only: 25 | - master 26 | - develop 27 | -------------------------------------------------------------------------------- /samples/mongo/src/main/java/com/example/config/Application.java: -------------------------------------------------------------------------------- 1 | package com.example.config; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.annotation.ComponentScan; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; 8 | 9 | /** 10 | * Spring Application 11 | */ 12 | @Configuration 13 | @EnableMongoRepositories // scans this package by default 14 | @ComponentScan(basePackageClasses = Application.class) 15 | @SuppressWarnings("PMD") 16 | public class Application { 17 | 18 | public static void main(String[] args) { 19 | run(args); 20 | } 21 | 22 | public static ApplicationContext run(String[] args) { 23 | SpringApplicationBuilder applicationBuilder = new SpringApplicationBuilder(); 24 | return applicationBuilder.sources(Application.class).run(args); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/mongo/src/main/java/com/example/config/PersonService.java: -------------------------------------------------------------------------------- 1 | package com.example.config; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import org.springframework.util.StringUtils; 6 | 7 | /** 8 | * example spring service 9 | */ 10 | @Service 11 | public class PersonService { 12 | 13 | PersonRepository personRepository; 14 | 15 | @Autowired 16 | public PersonService(final PersonRepository personRepository) { 17 | this.personRepository = personRepository; 18 | } 19 | 20 | public void normalizeNames(final String personId) { 21 | final Person person = personRepository.findByPId(personId); 22 | savePerson(person); 23 | } 24 | 25 | private void savePerson(final Person person) { 26 | person.setFirstName(StringUtils.capitalize(person.getFirstName())); 27 | person.setLastName(StringUtils.capitalize(person.getLastName())); 28 | personRepository.save(person); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /samples/multishell/README.md: -------------------------------------------------------------------------------- 1 | # Example for multiple defined shell tasks 2 | 3 | Using tasks ```mainShell``` and ```testShell``` as examples. 4 | 5 | ```mainShell``` has defined initial commands: 6 | 7 | ```Groovy 8 | $ gradle -q mainShell 9 | This is a gradle Application Shell. 10 | You can import your application classes and act on them. 11 | import com.example.Example 12 | ===> com.example.Example 13 | e = new Example() 14 | ===> com.example.Example@3cbbe701 15 | Groovy Shell (2.3.1, JVM: 1.7.0_55) 16 | Type ':help' or ':h' for help. 17 | ------------------------------ 18 | groovy:000> e 19 | ===> com.example.Example@3cbbe701 20 | groovy:000> 21 | ``` 22 | 23 | ```testShell``` has the test classes on the classpath: 24 | 25 | ```Groovy 26 | $ gradle -q testShell 27 | This is a gradle Application Shell. 28 | You can import your application classes and act on them. 29 | Groovy Shell (2.3.1, JVM: 1.7.0_55) 30 | Type ':help' or ':h' for help. 31 | groovy:000> import com.example.ExampleTest 32 | ===> com.example.ExampleTest 33 | ``` 34 | -------------------------------------------------------------------------------- /samples/multishell/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | // if plugin groovysh not found, add project to samples/settings.gradle 3 | apply plugin: 'com.github.tkruse.groovysh' 4 | 5 | 6 | 7 | // For an independent project, you would need the lines below. in this case they are in the parent folder 8 | 9 | //buildscript { 10 | // repositories { 11 | // jcenter() 12 | // dependencies { 13 | // classpath 'com.tkruse.gradle:gradle-groovysh-plugin:' 14 | // } 15 | // } 16 | //} 17 | 18 | dependencies { 19 | testCompile("junit:junit-dep:4.11") { force = true } 20 | } 21 | 22 | 23 | task mainShell(type: com.tkruse.gradle.groovysh.ApplicationShellTask) { 24 | jvmArgs = ['-Xmx2048m', '-Xms2048m'] 25 | args = ['-e', 'import com.example.Example\ne = new Example()'] 26 | } 27 | 28 | task testShell(type: com.tkruse.gradle.groovysh.ApplicationShellTask) { 29 | sourceSetName = 'test' 30 | } 31 | 32 | test { 33 | testLogging { 34 | exceptionFormat = 'full' 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /samples/mongo/src/main/java/com/example/config/Person.java: -------------------------------------------------------------------------------- 1 | package com.example.config; 2 | 3 | import lombok.EqualsAndHashCode; 4 | import lombok.ToString; 5 | import org.springframework.data.annotation.Id; 6 | 7 | /** 8 | * example bean 9 | */ 10 | @ToString 11 | @EqualsAndHashCode 12 | public class Person { 13 | 14 | @Id 15 | private String pId; 16 | 17 | private String firstName; 18 | private String lastName; 19 | 20 | public Person(final String firstName, final String lastName) { 21 | this.firstName = firstName; 22 | this.lastName = lastName; 23 | } 24 | 25 | public String getPId() { 26 | return pId; 27 | } 28 | 29 | public String getFirstName() { 30 | return firstName; 31 | } 32 | 33 | public void setFirstName(final String firstName) { 34 | this.firstName = firstName; 35 | } 36 | 37 | public String getLastName() { 38 | return lastName; 39 | } 40 | 41 | public void setLastName(final String lastName) { 42 | this.lastName = lastName; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /samples/src/test/groovy/com/tkruse/gradle/groovysh/LauncherHelper.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import groovy.transform.TypeChecked 4 | import org.gradle.tooling.BuildLauncher 5 | import org.gradle.tooling.GradleConnector 6 | import org.gradle.tooling.ProjectConnection 7 | 8 | /** 9 | * Helper utils for tests 10 | */ 11 | @TypeChecked 12 | class LauncherHelper { 13 | 14 | static BuildLauncher getLauncherForProject(final String projectName, 15 | String[] tasks = ['clean', 'shell'], 16 | String[] args = ['-q', 17 | '-PgroovyshPluginIgnoreNullConsole=true']) { 18 | GradleConnector connector = GradleConnector.newConnector() 19 | connector.forProjectDirectory(new File(projectName)) 20 | ProjectConnection connection = connector.connect() 21 | BuildLauncher launcher = connection.newBuild() 22 | launcher.forTasks(tasks) 23 | launcher.withArguments(args) 24 | return launcher 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /doc/Examples.md: -------------------------------------------------------------------------------- 1 | ## Github API 2 | 3 | code: 4 | 5 | apply plugin: 'java' 6 | apply plugin: 'com.github.tkruse.groovysh' 7 | 8 | ... 9 | 10 | dependencies { 11 | runtime("org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5") 12 | } 13 | 14 | Session: 15 | 16 | $ gradle -q shell 17 | This is a gradle Application Shell. 18 | You can import your application classes and act on them. 19 | Groovy Shell (2.3.1, JVM: 1.7.0_55) 20 | Type ':help' or ':h' for help. 21 | ------------------------------------------------------------ 22 | groovy:000> import org.eclipse.egit.github.core.service.* 23 | ===> org.eclipse.egit.github.core.client.*, org.eclipse.egit.github.core.*, org.eclipse.egit.github.core.service.* 24 | groovy:000> service = new RepositoryService(); 25 | ===> org.eclipse.egit.github.core.service.RepositoryService@1943dd11 26 | groovy:000> service.getRepositories("tkruse").each{println it.name} 27 | ackg 28 | adream_stage 29 | bloom 30 | buildfarm 31 | catkin 32 | catkin-sphinx 33 | catkinize 34 | ... 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/test/groovy/com/tkruse/gradle/groovysh/TestHelper.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.api.Plugin 4 | import org.gradle.api.Project 5 | import org.gradle.testfixtures.ProjectBuilder 6 | 7 | /** 8 | * Helper for tests 9 | */ 10 | class TestHelper { 11 | 12 | static Project createProjectWithPluginAndJava() { 13 | Project project = createProjectWithPlugin() 14 | project.apply(plugin:'java') 15 | return project 16 | } 17 | 18 | static Project createProjectWithPlugin() { 19 | Project project = ProjectBuilder.builder().build() 20 | project.apply(plugin:GroovyshPlugin.PLUGIN_ID) 21 | // not good for people behind proxies, do not put this in plugin class 22 | project.repositories.jcenter() 23 | 24 | return project 25 | } 26 | 27 | static void setupTasks(final Project project) { 28 | Plugin plugin = project.plugins.getPlugin(GroovyshPlugin.PLUGIN_ID) 29 | assert plugin.class == GroovyshPlugin 30 | // simulate AfterEvaluate 31 | ((GroovyshPlugin) plugin).setupTasks(project) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /doc/Contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to the gradle groovysh plugin 2 | 3 | All contributions are welcome: ideas, bug reports, patches. 4 | 5 | ## Using the sample subfolder 6 | 7 | You can add a project to the samples subfolder. Just copy & paste the ```simple``` folder, and add it to 8 | ```samples/settings.gradle```. You need to run ```gradle jar``` in the ```gradle-groovysh-plugin``` folder after each 9 | change to the main plugin, though. 10 | 11 | This would be a great way to report errors, if you can create a pull request adding a project or modiying 12 | an existing one, 13 | 14 | ## Setting up a development environment of a project of your own 15 | 16 | If you play around with groovysh in an existing project, you can try out ideas by using groovysh from 17 | the buildSrc folder. 18 | 19 | Clone this repository as ```buildSrc``` subfolder of a gradle root project. 20 | 21 | Bring some patience for the unit tests and checks, or disable them by uncommenting the section in ```build.gradle```. 22 | 23 | If you want to play around with many different plugins from source in one of your projects, read this tip: 24 | http://forums.gradle.org/gradle/topics/multiple_plugins_from_source_into_buildsrc 25 | -------------------------------------------------------------------------------- /samples/mongo/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | dependencies { 6 | // For an independent project, you would need the lines below. in this case they are in the parent folder 7 | // classpath 'com.tkruse.gradle:gradle-groovysh-plugin:' 8 | classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.1.RELEASE") 9 | } 10 | } 11 | 12 | apply plugin: 'java' 13 | apply plugin: 'spring-boot' 14 | // if plugin groovysh not found, add project to samples/settings.gradle 15 | apply plugin: 'com.github.tkruse.groovysh' 16 | 17 | 18 | jar { 19 | baseName = 'gs-accessing-mongodb-data-rest' 20 | version = '0.1.0' 21 | } 22 | 23 | repositories { 24 | jcenter() 25 | } 26 | 27 | dependencies { 28 | compile("org.springframework.boot:spring-boot-starter:1.2.1.RELEASE") 29 | compile("org.springframework.data:spring-data-mongodb:1.6.2.RELEASE") 30 | compile('com.github.fakemongo:fongo:1.6.0') 31 | compile("org.projectlombok:lombok:1.16.0") 32 | testCompile("junit:junit-dep:4.11") 33 | testCompile("org.mockito:mockito-all:1.10.19") 34 | } 35 | 36 | test { 37 | testLogging { 38 | exceptionFormat 'full' 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /samples/mongo/src/test/java/com/example/config/PersonServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.example.config; 2 | 3 | import org.junit.Test; 4 | import org.mockito.ArgumentCaptor; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | import static org.mockito.Mockito.mock; 8 | import static org.mockito.Mockito.when; 9 | import static org.mockito.Mockito.spy; 10 | import static org.mockito.Mockito.times; 11 | import static org.mockito.Mockito.verify; 12 | 13 | /** 14 | * example test 15 | */ 16 | public class PersonServiceTest { 17 | 18 | @Test 19 | public void testNormalizeNames() { 20 | final PersonRepository mockRepo = mock(PersonRepository.class); 21 | final Person person = spy(new Person("testfn", "testln")); 22 | when(person.getPId()).thenReturn("1234"); 23 | when(mockRepo.findByPId("1234")).thenReturn(person); 24 | final PersonService personService = new PersonService(mockRepo); 25 | 26 | personService.normalizeNames("1234"); 27 | 28 | final ArgumentCaptor argument = ArgumentCaptor.forClass(Person.class); 29 | verify(mockRepo, times(1)).save(argument.capture()); 30 | assertEquals("Testfn", argument.getValue().getFirstName()); 31 | assertEquals("Testln", argument.getValue().getLastName()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/com.tkruse.gradle.groovysh/TaskHelper.properties: -------------------------------------------------------------------------------- 1 | mainTemplate=\ 2 | package org.codehaus.groovy.tools.shell;\n\ 3 | import groovy.lang.Binding;\n\ 4 | import org.codehaus.groovy.tools.shell.Groovysh;\n\ 5 | import org.codehaus.groovy.tools.shell.IO;\n\ 6 | import org.fusesource.jansi.AnsiConsole;\n\ 7 | // workaround for jAnsi problems, (backspace and arrow keys not working)\n\ 8 | public class PatchedMain {\n\ 9 | public static void main(String[] args) {\n\ 10 | AnsiConsole.systemUninstall();\n\ 11 | Binding binding = new Binding();\n\ 12 | Groovysh groovysh = new Groovysh(binding, new IO());\n\ 13 | // Evaluate -e argument, java6 style\n\ 14 | if (args != null) {\n\ 15 | for (int i = 0; i < args.length; i++) {\n\ 16 | if ("-e".equals(args[i]) && args.length >= i + 1) {\n\ 17 | String[] lines = args[i + 1].split("\\r?\\n");\n\ 18 | for (int j = 0; j < lines.length; j++) {\n\ 19 | System.out.println(lines[j]); // verbose, but useful.\n\ 20 | groovysh.execute(lines[j]);\n\ 21 | }\n\ 22 | }\n\ 23 | i++;\n\ 24 | }\n\ 25 | }\n\ 26 | groovysh.run((String) null);\n\ 27 | }\n\ 28 | } 29 | -------------------------------------------------------------------------------- /doc/Groovysh.md: -------------------------------------------------------------------------------- 1 | # Using Grapes with Groovysh 2 | 3 | groovy:000> import groovy.grape.Grape 4 | ===> [import groovy.grape.Grape] 5 | groovy:000> Grape.grab(group:'example', module:'example', version:'0.1.0') 6 | ===> null 7 | 8 | 9 | # policy file to start tomcat / spring boot 10 | 11 | See the sample for how to start a Spring Application and get a handle to the ApplicationContext. 12 | Starting tomcat can cause a Exception like this: 13 | 14 | java.security.AccessControlException: access denied (javax.management.MBeanTrustPermission register) 15 | 16 | There are several ways to solve this, here is just one. 17 | Place a file called e.g. allowjmx.policy in your project Dir, with this content: 18 | 19 | grant { 20 | permission javax.management.MBeanTrustPermission "register"; 21 | }; 22 | 23 | In your ```build.gradle```, use: 24 | 25 | ```Groovy 26 | groovysh { 27 | shell { 28 | jvmArgs = ['-noverify', "-Djava.security.policy=$projectDir/allowjmx.policy"] 29 | } 30 | } 31 | ``` 32 | 33 | # :edit command for lengthy code-blocks 34 | 35 | When writing classes of lengthy methods, line by line-editing can quickly become tiring. 36 | Use the :edit command to start your favorite quick-starting editor to edit the current buffer. 37 | 38 | # Gradle BuildLauncher Arguments 39 | 40 | ``` 41 | $gradle -Pfoo=123 42 | ``` 43 | 44 | is equivalent to 45 | ``` 46 | ``` 47 | -------------------------------------------------------------------------------- /samples/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | apply plugin: 'com.github.tkruse.groovysh' 3 | 4 | 5 | description = 'Contains samples for integration testing and as showcases.' 6 | 7 | buildscript { 8 | repositories { 9 | flatDir { 10 | // build result in plugin main folder (one up from here), 11 | // must run 'gradle jar' *there* to use unreleased versions 12 | dirs "$rootDir/../build/libs" 13 | } 14 | } 15 | dependencies { 16 | classpath 'com.tkruse.gradle:gradle-groovysh-plugin:1.0.9-SNAPSHOT' 17 | } 18 | 19 | } 20 | 21 | allprojects { 22 | apply from: "$rootDir/config/gradle/java-builds.gradle" 23 | 24 | group = 'com.tkruse.gradle' 25 | 26 | def compatibilityVersion = 1.7 27 | sourceCompatibility = compatibilityVersion 28 | targetCompatibility = compatibilityVersion 29 | 30 | repositories { 31 | jcenter() 32 | } 33 | 34 | tasks.withType(CodeNarc) { codeNarcTask -> 35 | codeNarcTask.ignoreFailures = true 36 | } 37 | } 38 | 39 | dependencies { 40 | // mandatory dependencies for using Spock 41 | testCompile "org.codehaus.groovy:groovy-all:2.4.4" 42 | testCompile "org.spockframework:spock-core:1.0-groovy-2.4" 43 | testCompile 'org.gradle:gradle-tooling-api:2.12' 44 | } 45 | 46 | 47 | test { 48 | testLogging { 49 | exceptionFormat 'full' 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /doc/InstallBuildDevShellManually.md: -------------------------------------------------------------------------------- 1 | # Installing a Build Shell manually 2 | 3 | In case you do not wish to depend on the gradle-groovysh-plugin for any reason, here is how you can obtain 4 | the same results: 5 | 6 | ```Groovy 7 | configurations { 8 | // for gradle shell experiment 9 | addToClassLoader {extendsFrom compile} 10 | } 11 | 12 | dependencies { 13 | // for gradle shell experiment 14 | addToClassLoader "jline:jline:1.0" 15 | } 16 | 17 | /** Gradle shell experiment */ 18 | 19 | URLClassLoader loader = GroovyObject.class.classLoader 20 | configurations.addToClassLoader.each {File file -> 21 | loader.addURL(file.toURL()) 22 | } 23 | 24 | task('buildShell') { 25 | // This task is useful for learning gradle and making changes to the gradle files 26 | group 'help' 27 | description 'Runs an interactive shell for gradle. Experimental.' 28 | doFirst { 29 | if (getProperty('org.gradle.daemon') == 'true') { 30 | throw new IllegalStateException('Do not run shell with gradle daemon, it will eat your arrow keys.') 31 | } 32 | } 33 | doLast { 34 | def shell = new org.codehaus.groovy.tools.shell.Groovysh() 35 | shell.interp.context.variables.put("project", this) 36 | shell.run() 37 | } 38 | } 39 | ``` 40 | 41 | Remember that this will give you a shell for the Groovy version of Gradle (e.g. Groovy 1.8.6 for Gradle 1.12), which is 42 | much less usable than the latest Groovy shell. 43 | -------------------------------------------------------------------------------- /samples/src/test/groovy/com/tkruse/gradle/groovysh/JUnitSpecification.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.tooling.BuildLauncher 4 | import spock.lang.Specification 5 | 6 | /** 7 | * Tests the gradle API on the junit sample project 8 | */ 9 | class JUnitSpecification extends Specification { 10 | 11 | void testRunTests() { 12 | setup: 13 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('junit') 14 | 15 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 16 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 17 | String input = '''\ 18 | import org.junit.runner.JUnitCore 19 | import com.example.ExampleTest 20 | 21 | jCore = new JUnitCore() 22 | result = jCore.run(ExampleTest.class) 23 | println \'runs:\' + result.getRunCount() 24 | ''' 25 | ByteArrayInputStream bytesIn = new ByteArrayInputStream(input.bytes) 26 | 27 | launcher.standardOutput = bytesOut 28 | launcher.standardError = bytesOut 29 | launcher.standardInput = bytesIn 30 | 31 | when: 32 | launcher.run() 33 | 34 | then: 35 | assert bytesErr.toString() == '' 36 | assert bytesOut.toString() =~ ('Groovy Shell') 37 | assert bytesOut.toString().contains('com.example.ExampleTest') 38 | assert bytesOut.toString().contains('runs:1') 39 | assert !bytesOut.toString().contains('Exception') 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/GenerateMainTask.java: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh; 2 | 3 | import groovy.lang.Closure; 4 | import org.gradle.api.Project; 5 | import org.gradle.api.DefaultTask; 6 | import org.gradle.api.tasks.TaskAction; 7 | 8 | import java.io.File; 9 | 10 | /** 11 | * JavaCompile Task specialized to compile java generated into build space 12 | */ 13 | // NOTE: This is written as java file because else the plugin would not be gradle1.x gradle2.x compatible 14 | public class GenerateMainTask extends DefaultTask { 15 | 16 | static final String NAME = "compileGroovyshPatchedMain"; 17 | public static final String PATCH_CLASS_NAME = "PatchedMain"; 18 | public static final String PATCH_CLASS_CAN_NAME = "org.codehaus.groovy.tools.shell." + PATCH_CLASS_NAME; 19 | public static final String CONFIGURATION_NAME = "appShellCompileMainConf"; 20 | 21 | public GenerateMainTask() { 22 | this.setGroup("help"); 23 | this.getOutputs().upToDateWhen(new Closure(this) { 24 | @Override 25 | public Object call() { 26 | return false; 27 | } 28 | 29 | @Override 30 | public Object call(Object arguments) { 31 | return false; 32 | } 33 | }); 34 | } 35 | 36 | 37 | @TaskAction 38 | public void apply() { 39 | Project project = getProject(); 40 | TaskHelper.generatePatchedMain(project, PATCH_CLASS_NAME); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /samples/src/test/groovy/com/tkruse/gradle/groovysh/MongoSpecification.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.tooling.BuildLauncher 4 | import spock.lang.Specification 5 | 6 | /** 7 | * Tests the gradle API on the mongo sample project 8 | */ 9 | class MongoSpecification extends Specification { 10 | 11 | void testMongoDbRepoAndService() { 12 | setup: 13 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('mongo') 14 | 15 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 16 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 17 | String input = '''\ 18 | import com.example.config.* 19 | 20 | ctx = Application.run() 21 | repo = ctx.getBean(PersonRepository) 22 | service = ctx.getBean(PersonService) 23 | repo.save(new Person('jane', 'dane')) 24 | repo.findAll() 25 | service.normalizeNames(repo.findByLastName('dane')[0].pId) 26 | repo.findAll() 27 | repo.deleteAll() 28 | ''' 29 | ByteArrayInputStream bytesIn = new ByteArrayInputStream(input.bytes) 30 | 31 | launcher.standardOutput = bytesOut 32 | launcher.standardError = bytesOut 33 | launcher.standardInput = bytesIn 34 | 35 | when: 36 | launcher.run() 37 | 38 | then: 39 | assert bytesErr.toString() == '' 40 | assert bytesOut.toString() =~ ('Groovy Shell') 41 | assert bytesOut.toString().contains('firstName=jane') 42 | assert bytesOut.toString().contains('lastName=dane)') 43 | assert bytesOut.toString().contains('firstName=Jane') 44 | assert bytesOut.toString().contains('lastName=Dane)') 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /samples/mongo/README.md: -------------------------------------------------------------------------------- 1 | # Example for a Spring Boot backend with MongoDB being used interactively. 2 | 3 | Session: 4 | 5 | ```Groovy 6 | $ gradle -q shell 7 | This is a gradle Application Shell. 8 | You can import your application classes and act on them. 9 | Groovy Shell (2.3.1, JVM: 1.7.0_55) 10 | Type ':help' or ':h' for help. 11 | ----------------------------------------------- 12 | groovy:000> import com.example.config.* 13 | ===> com.example.config.* 14 | groovy:000> ctx = Application.run() 15 | 16 | . ____ _ __ _ _ 17 | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ 18 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 19 | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) 20 | ' |____| .__|_| |_|_| |_\__, | / / / / 21 | =========|_|==============|___/=/_/_/_/ 22 | :: Spring Boot :: (v1.0.2.RELEASE) 23 | 24 | ===> org.springframework.context.annotation.AnnotationConfigApplicationContext@4c898c2d: startup date [Fri May 23 22:32:11 CEST 2014]; root of context hierarchy 25 | groovy:000> repo = ctx.getBean(PersonRepository) 26 | ===> org.springframework.data.mongodb.repository.support.SimpleMongoRepository@3957edeb 27 | groovy:000> service = ctx.getBean(PersonService) 28 | ===> com.example.config.PersonService@68de760 29 | groovy:000> repo.save(new Person('jane', 'dane')) 30 | ===> Person(id=537fb05744aea2eac0931e73, firstName=jane, lastName=dane) 31 | groovy:000> repo.findAll() 32 | ===> [Person(id=537fb05744aea2eac0931e73, firstName=jane, lastName=dane)] 33 | groovy:000> service.normalizeNames(repo.findByLastName('dane')[0].id) 34 | ===> null 35 | groovy:000> repo.findAll() 36 | ===> [Person(id=537fb05744aea2eac0931e73, firstName=Jane, lastName=Dane)] 37 | groovy:000> 38 | ``` 39 | -------------------------------------------------------------------------------- /src/test/groovy/com/tkruse/gradle/groovysh/BuildDevShellTaskTest.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.api.Project 4 | import org.junit.Test 5 | 6 | /** 7 | * Tests task setup. Stronger execution tests are in samples subfolder. 8 | */ 9 | class BuildDevShellTaskTest { 10 | 11 | @Test 12 | void testConfigureMain() { 13 | Project project = TestHelper.createProjectWithPluginAndJava() 14 | TestHelper.setupTasks(project) 15 | BuildDevShellTask buildDevShellTask = (BuildDevShellTask) project.tasks.findByName(BuildDevShellTask.NAME) 16 | assert buildDevShellTask != null 17 | checkDependencies(project.gradle.gradleVersion, project) 18 | } 19 | 20 | private static void checkDependencies(String gradleVersion, Project project) { 21 | List dependencyVersions = 22 | project.configurations.buildDevShellConf 23 | .dependencies.asList().collect { it.name + it.version } 24 | if (gradleVersion.startsWith('1')) { 25 | assert dependencyVersions.contains('jline1.0') 26 | } else { 27 | assert dependencyVersions.contains('jline2.11') 28 | } 29 | } 30 | 31 | @Test 32 | void testConfigureMainWithGradleVersion() { 33 | Project project = TestHelper.createProjectWithPluginAndJava() 34 | 35 | project.groovysh.buildShell.gradleVersion = '2.12' 36 | 37 | TestHelper.setupTasks(project) 38 | BuildDevShellTask buildDevShellTask = (BuildDevShellTask) project.tasks.findByName(BuildDevShellTask.NAME) 39 | assert buildDevShellTask != null 40 | checkDependencies(project.gradle.gradleVersion, project) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /samples/src/test/groovy/com/tkruse/gradle/groovysh/SimpleGroovySpecification.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.tooling.BuildLauncher 4 | import spock.lang.Specification 5 | 6 | /** 7 | * Tests the gradle API on the simpleGroovy sample project 8 | */ 9 | class SimpleGroovySpecification extends Specification { 10 | 11 | void testImportCustomclass() { 12 | setup: 13 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('simpleGroovy', 14 | ['clean', 'shell'] as String[], 15 | ["-PgroovyVersion=$groovyVersion", 16 | '-PgroovyshPluginIgnoreNullConsole=true', 17 | '-q'] as String[]) 18 | 19 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 20 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 21 | ByteArrayInputStream bytesIn = new ByteArrayInputStream( 22 | 'import com.example.Example\ne = new Example()'.bytes) 23 | 24 | launcher.standardOutput = bytesOut 25 | launcher.standardError = bytesOut 26 | launcher.standardInput = bytesIn 27 | 28 | when: 29 | launcher.run() 30 | 31 | then: 32 | assert bytesErr.toString() == '' 33 | assert bytesOut.toString() =~ ('Groovy Shell') 34 | assert bytesOut.toString().contains('com.example.Example') 35 | assert !bytesOut.toString().contains('Exception') 36 | 37 | where: 38 | groovyVersion << ['2.0.0', '2.0.8', 39 | '2.1.0', '2.1.9', 40 | '2.2.0', '2.2.2', 41 | '2.3.0', '2.3.9', 42 | '2.4.0', '2.4.4'] 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /doc/TODO.md: -------------------------------------------------------------------------------- 1 | # Wishlist / Brainstorming / TODOs 2 | 3 | - Check project with ASM dependency 4 | - Clarify whether to use Groovy indy jar 5 | - Run without building classes for Groovy classpath? 6 | - Groovysh Tips and tricks 7 | - Fix declared vs inferred version checking 8 | - check for invalid keys in extension (typos) 9 | - Tutorials / Examples / sampleProjects 10 | - hibernate 11 | - running unit tests without creating fixture again? 12 | - JMX / MBeans 13 | - REST call HTML / JSON processing 14 | - FileSets 15 | - Unit tests repeat 16 | - gradle tooling API 17 | - Check shell on Windows / MacOS 18 | - Automatically go quiet 19 | - Print gradle info on task execution keeping the grooovysh prompt below that, somehow. 20 | - Support for class reloading when application sources changes 21 | - Support for class reloading when gradle sources changes 22 | - Support for running tasks multiple times forcefully 23 | - Maven groovysh plugin (GMavenPLus has a buildShell) 24 | - Promote to standard gradle plugin 25 | 26 | 27 | ## Done 28 | 29 | - Prepopulate Variables for buildShell connection 30 | - Define ApplicationShell initial commands or imports 31 | - Run a ```shell``` task with application classes 32 | - Run a ```buildShell``` task with gradle on the classpath 33 | - Run a ```buildDevShell``` task where the ```project``` variable is the same as in ```build.gradle``` file 34 | - ```shell``` task: Configure SourceSet (test or main) 35 | - ```shell``` task uses independent configuration (extends runtime or testRuntime) 36 | - ```shell``` task: Configure Task JavaExec params 37 | - Configure ```shell``` and ```buildShell``` Tasks Groovy Version 38 | - Checks whether Daemon or Parallel mode is on 39 | - Tasks can be disabled 40 | - Custom tasks can be defined by extending the Task classes 41 | -------------------------------------------------------------------------------- /samples/src/test/groovy/com/tkruse/gradle/groovysh/FilesetsSpecification.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.tooling.BuildLauncher 4 | import spock.lang.Specification 5 | 6 | /** 7 | * Tests the gradle API on the filesets sample project 8 | */ 9 | class FilesetsSpecification extends Specification { 10 | 11 | void testBuildDevShell() { 12 | setup: 13 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('filesets', 14 | ['clean', 'buildDevShell'] as String[], 15 | ['-q', '-PgroovyshPluginIgnoreNullConsole=true'] as String[]) 16 | 17 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 18 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 19 | String input = '''\ 20 | println '1:' + project.tasks.copyTask2.getInputs().getFiles().collect({it.name}).sort() 21 | println '2:' + project.tasks.copyTask.getInputs().getFiles().collect({it.name}).sort() 22 | project.tasks.copyTask.execute() 23 | println '3:' + project.tasks.copyTask2.getInputs().getFiles().collect({it.name}).sort() 24 | ''' 25 | ByteArrayInputStream bytesIn = new ByteArrayInputStream(input.bytes) 26 | 27 | launcher.standardOutput = bytesOut 28 | launcher.standardError = bytesOut 29 | launcher.standardInput = bytesIn 30 | 31 | when: 32 | launcher.run() 33 | 34 | then: 35 | assert bytesErr.toString() == '' 36 | assert bytesOut.toString() =~ ('Groovy Shell') 37 | assert bytesOut.toString().contains('1:[]') 38 | assert bytesOut.toString().contains('2:[notMe-staging.txt, takeMe.md, takeme.txt]') 39 | assert bytesOut.toString().contains('3:[takeMe.md]') 40 | assert !bytesOut.toString().contains('Exception') 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /samples/src/test/groovy/com/tkruse/gradle/groovysh/GroovyVersionsSpecification.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.tooling.BuildLauncher 4 | import spock.lang.Specification 5 | 6 | /** 7 | * Tests the gradle API on the groovyVersions sample project 8 | */ 9 | class GroovyVersionsSpecification extends Specification { 10 | 11 | void testGroovyshVersion(String groovyVersion) { 12 | setup: 13 | BuildLauncher launcher = LauncherHelper.getLauncherForProject( 14 | 'groovyVersions', 15 | ['clean', 'shell'] as String[], 16 | ["-PgroovyVersion=$groovyVersion", 17 | '-PgroovyshPluginIgnoreNullConsole=true', 18 | '-q'] as String[]) 19 | 20 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 21 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 22 | ByteArrayInputStream bytesIn = new ByteArrayInputStream( 23 | 'import com.example.Example\ne = new Example()'.bytes) 24 | 25 | launcher.standardOutput = bytesOut 26 | launcher.standardError = bytesOut 27 | launcher.standardInput = bytesIn 28 | 29 | when: 30 | launcher.run() 31 | 32 | then: 33 | assert bytesErr.toString() == '' 34 | assert bytesOut.toString() =~ ('Groovy Shell') 35 | assert bytesOut.toString().contains(groovyVersion) 36 | assert bytesOut.toString().contains('com.example.Example') 37 | assert !bytesOut.toString().contains('Exception') 38 | 39 | where: 40 | groovyVersion << ['2.0.0', '2.0.8', 41 | '2.1.0', '2.1.9', 42 | '2.2.0', '2.2.2', 43 | '2.3.0', '2.3.9', 44 | '2.4.0', '2.4.4'] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/DynamicInvokeHelper.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.api.Project 4 | import org.gradle.api.plugins.ExtensionAware 5 | import org.gradle.api.plugins.ExtensionContainer 6 | 7 | /** 8 | * wraps the ugliest Casting operations needed to make Gradle's dynamic API typeCheckable 9 | */ 10 | class DynamicInvokeHelper { 11 | 12 | static GroovyshPluginExtension getPluginExtension(Project project) { 13 | return (GroovyshPluginExtension) project.extensions.findByName(GroovyshPlugin.NAME) 14 | } 15 | 16 | static ExtensionContainer getPluginExtensionContainer(Project project) { 17 | return ((ExtensionAware) getPluginExtension(project)).extensions 18 | } 19 | 20 | static BuildDevShellTaskExtension getBuildDevShellExtension(Project project) { 21 | return (BuildDevShellTaskExtension) getPluginExtensionContainer(project).findByName(BuildDevShellTask.NAME) 22 | } 23 | 24 | static BuildShellTaskExtension getBuildShellExtension(Project project) { 25 | return (BuildShellTaskExtension) getPluginExtensionContainer(project) 26 | .findByName(BuildShellTask.NAME) 27 | } 28 | 29 | static ApplicationShellTaskExtension getApplicationShellExtension(Project project) { 30 | return (ApplicationShellTaskExtension) getPluginExtensionContainer(project) 31 | .findByName(ApplicationShellTask.NAME) 32 | } 33 | 34 | static void addGroovyshExtentions(Project project) { 35 | project.extensions.create(GroovyshPlugin.NAME, GroovyshPluginExtension) 36 | // not sure how to create nested extentions else... 37 | getPluginExtensionContainer(project).create(BuildDevShellTask.NAME, BuildDevShellTaskExtension) 38 | getPluginExtensionContainer(project).create(BuildShellTask.NAME, BuildShellTaskExtension) 39 | getPluginExtensionContainer(project).create(ApplicationShellTask.NAME, ApplicationShellTaskExtension) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /samples/config/gradle/java-builds.gradle: -------------------------------------------------------------------------------- 1 | /** 2 | * By extracting this to a separate script rather than using allprojects / subprojects, 3 | * the gradle builds become decoupled (hopefully), allowing some parallel work (hopefully) 4 | */ 5 | 6 | apply plugin: 'java' 7 | apply plugin: 'pmd' 8 | apply plugin: 'checkstyle' 9 | apply plugin: 'codenarc' 10 | 11 | /** CODE QUALITY CHECKS */ 12 | 13 | pmd { 14 | sourceSets = [sourceSets.main] 15 | ruleSets = ['java-basic', 16 | 'java-braces', 17 | 'java-clone', 18 | 'java-codesize', 19 | //'java-comments', 20 | //'java-controversial', 21 | // 'java-coupling', 22 | 'java-design', 23 | 'java-empty', 24 | 'java-finalizers', 25 | 'java-imports', 26 | //'java-junit', 27 | //'java-logging', 28 | 'java-naming', 29 | 'java-optimizations', 30 | 'java-strictexception', 31 | 'java-strings', 32 | 'java-sunsecure', 33 | 'java-typeresolution', 34 | 'java-unnecessary', 35 | 'java-unusedcode' 36 | ] 37 | toolVersion = '5.1.2' 38 | } 39 | 40 | checkstyleMain { 41 | configProperties = ['baseDir': "$rootDir"] 42 | ignoreFailures = true 43 | configFile = new File(rootDir, 'config/checkstyle/checkstyle.xml') 44 | } 45 | 46 | checkstyleTest { 47 | configProperties = ['baseDir': "$rootDir"] 48 | ignoreFailures = true 49 | configFile = new File(rootDir, 'config/checkstyle/checkstyle.xml') 50 | } 51 | 52 | codenarc { 53 | configFile = new File(rootDir, 'config/codenarc/rules.groovy') 54 | toolVersion = 0.24 55 | } 56 | 57 | //force compile tasks to use utf-8 58 | tasks.withType(JavaCompile) { 59 | options.encoding = 'UTF-8' 60 | options.compilerArgs << '-Xlint:unchecked' 61 | options.compilerArgs << '-Xlint:deprecation' 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/test/groovy/com/tkruse/gradle/groovysh/GroovyshPluginTest.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.api.Plugin 4 | import org.gradle.api.Project 5 | import org.junit.Test 6 | 7 | /** 8 | * plugin test 9 | * tests plugin setup. Stronger execution tests are in samples subfolder. 10 | */ 11 | class GroovyshPluginTest { 12 | 13 | @Test 14 | void testApplyNoJava() { 15 | Project project = TestHelper.createProjectWithPlugin() 16 | Plugin plugin = project.plugins.getPlugin(GroovyshPlugin.PLUGIN_ID) 17 | assert plugin instanceof GroovyshPlugin 18 | assert project.tasks.findByName(BuildDevShellTask.NAME) == null 19 | assert project.tasks.findByName(ApplicationShellTask.NAME) == null 20 | 21 | project.groovysh.enableBuildDevShell = true 22 | project.groovysh.enableAppShell = true 23 | // simulate AfterEvaluate 24 | ((GroovyshPlugin) plugin).setupTasks(project) 25 | 26 | assert project.tasks.findByName(BuildDevShellTask.NAME) != null 27 | assert project.tasks.findByName(ApplicationShellTask.NAME) == null 28 | assert project.tasks.buildDevShell instanceof BuildDevShellTask 29 | //assert project.tasks.shell instanceof ApplicationShellTask 30 | } 31 | 32 | @Test 33 | void testApplyJava() { 34 | Project project = TestHelper.createProjectWithPluginAndJava() 35 | TestHelper.setupTasks(project) 36 | assert project.tasks.findByName(BuildDevShellTask.NAME) != null 37 | assert project.tasks.findByName(ApplicationShellTask.NAME) != null 38 | assert project.tasks.buildDevShell instanceof BuildDevShellTask 39 | assert project.tasks.buildShell instanceof BuildShellTask 40 | assert project.tasks.shell instanceof ApplicationShellTask 41 | 42 | assert project.configurations.appShellConf_shell != null 43 | assert project.configurations.buildShellConf_buildShell != null 44 | assert project.configurations.buildDevShellConf != null 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/BuildDevShellTask.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.codehaus.groovy.tools.shell.Groovysh 4 | import org.gradle.api.DefaultTask 5 | import org.gradle.api.tasks.TaskAction 6 | 7 | /** 8 | * a task that starts the groovysh shell in the current gradle process, useful for debugging gradle builds. 9 | */ 10 | class BuildDevShellTask extends DefaultTask { 11 | 12 | static final String NAME = 'buildDevShell' 13 | static final String CONFIGURATION_NAME = 'buildDevShellConf' 14 | 15 | BuildDevShellTask() { 16 | this.group = 'help' 17 | this.description = 'starts a groovysh shell to introspect the gradle setup itself' 18 | this.outputs.upToDateWhen { false } 19 | } 20 | 21 | @TaskAction 22 | void exec() { 23 | TaskHelper.checkDaemon(project) 24 | TaskHelper.checkQuiet(project) 25 | TaskHelper.checkParallel(project) 26 | 27 | println("$GroovyshPlugin.NAME: This is a gradle Build-Shell. The variable 'project' is bound to your project.") 28 | println("$GroovyshPlugin.NAME: Run e.g. 'project.ext.properties' to inspect your project.") 29 | 30 | Groovysh shell = new Groovysh() 31 | // this hacks into Groovysh internal API and may break in the future. 32 | shell.interp.context.variables.put('project', project) 33 | 34 | // convenience access 35 | for (String varname in ['ant', 36 | 'artifacts', 37 | 'buildDir', 38 | 'configurations', 39 | 'components', 40 | 'dependecies', 41 | 'extensions', 42 | 'gradle', 43 | 'repositories', 44 | 'rootDir', 45 | 'rootProject']) { 46 | shell.interp.context.variables.put(varname, project.getProperties().get(varname)) 47 | } 48 | 49 | shell.run((String) null) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /samples/mongo/src/main/java/com/example/config/FongoDatabaseConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.config; 2 | 3 | import com.github.fakemongo.Fongo; 4 | import com.mongodb.Mongo; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.data.mongodb.MongoDbFactory; 8 | import org.springframework.data.mongodb.config.AbstractMongoConfiguration; 9 | import org.springframework.data.mongodb.core.MongoTemplate; 10 | import org.springframework.data.mongodb.core.SimpleMongoDbFactory; 11 | import org.springframework.data.mongodb.repository.support.MongoRepositoryFactory; 12 | 13 | /** 14 | * In-memory DB config 15 | */ 16 | @Configuration 17 | public class FongoDatabaseConfig extends AbstractMongoConfiguration { 18 | 19 | private static final String DB_NAME = "example"; 20 | 21 | private final Mongo mongoInst; 22 | 23 | private final MongoDbFactory dbFactory; 24 | 25 | public FongoDatabaseConfig() { 26 | mongoInst = new Fongo("fongo").getMongo(); 27 | dbFactory = new SimpleMongoDbFactory(mongoInst, DB_NAME); 28 | } 29 | 30 | @Bean 31 | @Override 32 | public MongoDbFactory mongoDbFactory() { 33 | return dbFactory; 34 | } 35 | 36 | @Override 37 | protected String getDatabaseName() { 38 | return DB_NAME; 39 | } 40 | 41 | @Override 42 | public Mongo mongo() { 43 | return mongoInst; 44 | } 45 | 46 | @Bean 47 | @Override 48 | @SuppressWarnings("PMD.AvoidCatchingGenericException") 49 | public MongoTemplate mongoTemplate() { 50 | try { 51 | return new MongoTemplate(dbFactory, mappingMongoConverter()); 52 | } catch (final Exception exc) { 53 | throw new WrappedFongoException(exc); 54 | } 55 | } 56 | 57 | @Bean 58 | public MongoRepositoryFactory mongoRepositoryFactory() { 59 | return new MongoRepositoryFactory(mongoTemplate()); 60 | } 61 | 62 | 63 | private static final class WrappedFongoException extends RuntimeException { 64 | public WrappedFongoException(final Exception exc) { 65 | super(exc); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /samples/src/test/groovy/com/tkruse/gradle/groovysh/SimpleSpecification.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.tooling.BuildLauncher 4 | import spock.lang.Specification 5 | 6 | /** 7 | * Tests the gradle API on the simple sample project 8 | */ 9 | class SimpleSpecification extends Specification { 10 | 11 | void testImportCustomClass() { 12 | setup: 13 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('simple') 14 | 15 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 16 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 17 | ByteArrayInputStream bytesIn = new ByteArrayInputStream( 18 | 'import com.example.Example\ne = new Example()'.bytes) 19 | 20 | launcher.standardOutput = bytesOut 21 | launcher.standardError = bytesOut 22 | launcher.standardInput = bytesIn 23 | 24 | when: 25 | launcher.run() 26 | 27 | then: 28 | assert bytesErr.toString() == '' 29 | assert bytesOut.toString() =~ ('Groovy Shell') 30 | assert bytesOut.toString().contains('com.example.Example') 31 | assert !bytesOut.toString().contains('Exception') 32 | 33 | } 34 | 35 | void testBuildshell() { 36 | setup: 37 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('simple', ['clean', 'buildShell'] as String[]) 38 | 39 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 40 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 41 | ByteArrayInputStream bytesIn = new ByteArrayInputStream( 42 | 'connector.getClass()\n'.bytes) 43 | 44 | launcher.standardOutput = bytesOut 45 | launcher.standardError = bytesOut 46 | launcher.standardInput = bytesIn 47 | 48 | when: 49 | launcher.run() 50 | 51 | then: 52 | assert bytesErr.toString() == '' 53 | assert bytesOut.toString() =~ ('Groovy Shell') 54 | assert bytesOut.toString().contains('class org.gradle.tooling.internal.consumer.DefaultGradleConnector') 55 | assert !bytesOut.toString().contains('Exception') 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /doc/InstallAppShellManually.md: -------------------------------------------------------------------------------- 1 | # Installing an Application Shell manually 2 | 3 | In case you do not wish to depend on the gradle-groovysh-plugin for any reason, here is how you can obtain 4 | the same results: 5 | 6 | In your ```build.gradle```: 7 | 8 | ```Groovy 9 | apply plugin: 'java' 10 | 11 | dependencies { 12 | compile('org.codehaus.groovy:groovy-all:2.4.4') { force = true } 13 | compile('commons-cli:commons-cli:1.2') 14 | // when using groovy < 2.2 above: 15 | // "jline:jline:1.0" 16 | // Groovy >= 2.2 17 | compile("jline:jline:2.11") { 18 | exclude(group: 'junit', module: 'junit') 19 | } 20 | } 21 | 22 | task shell(dependsOn: 'testClasses', type: JavaExec) { 23 | group = 'help' 24 | description 'Runs an interactive shell with all runtime dependencies. "Use with gradle -q shell".' 25 | doFirst { 26 | if (getProperty('org.gradle.daemon') == 'true') { 27 | throw new IllegalStateException('Do not run shell with gradle daemon, it will eat your arrow keys.') 28 | } 29 | } 30 | standardInput = System.in 31 | main = 'shell.ShellMain' 32 | // using Main directly has ansi issues (some keyboard keys not working) 33 | // main = 'org.codehaus.groovy.tools.shell.Main' 34 | classpath = sourceSets.main.runtimeClasspath 35 | jvmArgs = [] 36 | // workingDir = 37 | // standardOutput = System.out 38 | // stops after eval, not useful now (maybe will change with Groovy >= 2.3.2) 39 | // args = ["load $rootDir/integration-test/src/main/groovy/GroovyshStartup.groovy"] 40 | 41 | } 42 | ``` 43 | 44 | Also create the file shell.ShellMain.java (or whatever you want to call it, used as ```main = ...``` in task ```shell```): 45 | 46 | ```Java 47 | package shell; 48 | 49 | import org.codehaus.groovy.tools.shell.Main; 50 | import org.fusesource.jansi.AnsiConsole; 51 | 52 | class ShellMain { 53 | public static void main(String[] args) { 54 | // workaround for jAnsi problems, (backspace and arrow keys not working) 55 | AnsiConsole.systemUninstall(); 56 | Main.main(args); 57 | } 58 | } 59 | ``` 60 | 61 | You can also use a Groovy Class, of course. 62 | 63 | Note that in some cases, when running ```./gradlew shell```, the shell prompt can get messed up. Pass the option 64 | ```--console plain``` to fix this: 65 | 66 | ``` 67 | ./gradlew --console plain shell 68 | ``` 69 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | Version 1.0.8 *(2015-08-27)* 5 | ---------------------------- 6 | 7 | Improved daemon detection 8 | 9 | Version 1.0.7 *(2015-08-22)* 10 | ---------------------------- 11 | 12 | Relax startup guard, shell still starts if daemon is activated in properties, with warning message 13 | Similar warning message for starting with jvmargs, as this causes the same problem 14 | 15 | Version 1.0.6 *(2015-08-09)* 16 | ---------------------------- 17 | 18 | Maintenance release. Update dependency version, default Groovy is 2.4.4 19 | Made Compatible with gradle 2.5 20 | 21 | Version 1.0.5 *(2015-03-14)* 22 | ---------------------------- 23 | 24 | Maintenance release. Update dependency version, default Groovy is 2.4.1 25 | Refactored code, more type-checkable 26 | 27 | Version 1.0.4 *(2015-02-08)* 28 | ---------------------------- 29 | 30 | Maintenance release. Update dependency version, default Groovy is 2.4.0 31 | 32 | Version 1.0.3 *(2015-01-09)* 33 | ---------------------------- 34 | 35 | Maintenance release. Update dependency version, default Groovy is 2.3.9 36 | 37 | Version 1.0.2 *(2014-08-30)* 38 | ---------------------------- 39 | 40 | * fix #6 plugin should not add jcenter repo to project 41 | 42 | Version 1.0.1 *(2014-08-24)* 43 | ---------------------------- 44 | 45 | * fix no error when running without -q 46 | * groovy 2.3.6 as default 47 | 48 | Version 1.0.0 *(2014-06-13)* 49 | ---------------------------- 50 | 51 | * gradle 2.0 compatibility 52 | * qualified plugin Id (to comply with gradle portal) 53 | * groovy 2.3.4 as default 54 | 55 | 56 | Version 0.4.0 *(2014-05-25)* 57 | ---------------------------- 58 | 59 | * fix #4 issues with old groovy version and special keys 60 | * default groovy 2.3.3 61 | 62 | Version 0.3.0 *(2014-05-25)* 63 | ---------------------------- 64 | 65 | * default groovy 2.3.2 66 | * Allow groovy versions < 2.2.1 67 | 68 | Version 0.2.0 *(2014-05-25)* 69 | ---------------------------- 70 | 71 | * Allow initial commands to start the shell with 72 | * Allow using classes for custom tasks 73 | * integration tests, samples 74 | * fix conflicting groovysh Groovy version and project compile groovy version 75 | * build shell initialized with connector 76 | 77 | Version 0.1.0 *(2014-05-04)* 78 | ---------------------------- 79 | 80 | * First version with simple shells working as desired on Linux 81 | 82 | Version 0.0.1 *(2014-05-04)* 83 | ---------------------------- 84 | 85 | * Initial version 86 | 87 | -------------------------------------------------------------------------------- /samples/config/codenarc/rules.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | ruleset { 17 | description 'Rules For Gradle Groovysh Plugin Project' 18 | ruleset('rulesets/basic.xml') 19 | ruleset('rulesets/braces.xml') 20 | ruleset('rulesets/concurrency.xml') 21 | ruleset('rulesets/convention.xml') 22 | ruleset('rulesets/design.xml') 23 | ruleset('rulesets/dry.xml') { 24 | DuplicateListLiteral 25 | DuplicateMapLiteral 26 | DuplicateNumberLiteral 27 | DuplicateStringLiteral(enabled: false) // too much hassle 28 | } 29 | ruleset('rulesets/exceptions.xml') 30 | ruleset('rulesets/formatting.xml') 31 | // generic rules need to be configured to be active and useful 32 | //ruleset('rulesets/generic.xml') 33 | IllegalRegex { 34 | name = 'TODO' 35 | priority = 2 36 | regex = /TODO/ 37 | description = 'TODOs should not be commited' 38 | } 39 | 40 | // ruleset('rulesets/grails.xml') 41 | ruleset('rulesets/groovyism.xml') { 42 | GetterMethodCouldBeProperty(enabled: false) 43 | } 44 | ruleset('rulesets/imports.xml') 45 | //ruleset('rulesets/jdbc.xml') 46 | ruleset('rulesets/junit.xml') 47 | ruleset('rulesets/logging.xml') { 48 | Println(enabled: false) // logging a hassle for a plugin that needs QUIET logLevel 49 | } 50 | ruleset('rulesets/naming.xml') { 51 | FactoryMethodName(enabled: false) 52 | } 53 | ruleset('rulesets/security.xml') { 54 | JavaIoPackageAccess(enabled: false) // gradle uses Java.io.File 55 | } 56 | ruleset('rulesets/serialization.xml') 57 | ruleset('rulesets/size.xml') { 58 | CrapMetric(enabled: false) 59 | } 60 | ruleset('rulesets/unnecessary.xml') { 61 | UnnecessaryGetter(enabled: false) 62 | UnnecessaryReturnKeyword(enabled: false) 63 | } 64 | ruleset('rulesets/unused.xml') 65 | } 66 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/BuildShellTask.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import static com.tkruse.gradle.groovysh.DynamicInvokeHelper.getBuildShellExtension 4 | 5 | import org.gradle.api.artifacts.Dependency 6 | import org.gradle.api.file.FileCollection 7 | 8 | /** 9 | * A task that starts a groovysh shell with the gradle tooling api onthe classpath 10 | */ 11 | class BuildShellTask extends AbstractShellTask { 12 | 13 | static final String NAME = 'buildShell' 14 | static final String CONFIGURATION_NAME_PREFIX = 'buildShellConf_' 15 | static final List FIXEDARGS = ['-e', '''\ 16 | import org.gradle.tooling.* 17 | import org.gradle.tooling.model.* 18 | 19 | connector = GradleConnector.newConnector() 20 | '''] 21 | 22 | @Override 23 | ShellTaskExtension getTaskExtension() { 24 | return getBuildShellExtension(project) 25 | } 26 | 27 | BuildShellTask() { 28 | super() 29 | this.description = 'starts a groovysh shell with the with a gradleConnector connected to the Project' 30 | } 31 | 32 | @Override 33 | String getConfigurationName() { 34 | return CONFIGURATION_NAME_PREFIX + getName() 35 | } 36 | 37 | void addGradleDependencies() { 38 | List deps = project.configurations.getByName(getConfigurationName()).allDependencies 39 | .collect { Dependency it -> it } 40 | TaskHelper.addIfMissing(project, getConfigurationName(), 41 | deps, 'org.gradle', 'gradle-tooling-api', taskExtension.gradleVersion, null) 42 | TaskHelper.addIfMissing(project, getConfigurationName(), deps, 'org.slf4j', 'slf4j-simple', '1.7.12') 43 | } 44 | 45 | void setupClasspath() { 46 | FileCollection shellClasspath = project.configurations.getByName(getConfigurationName()).asFileTree 47 | this.classpath = shellClasspath 48 | 49 | FileCollection extraClasspath = getTaskExtension().extraClasspath 50 | if (extraClasspath != null) { 51 | this.classpath = this.classpath + extraClasspath 52 | } 53 | } 54 | 55 | @Override 56 | void exec() { 57 | addGradleDependencies() 58 | setupClasspath() 59 | this.args = FIXEDARGS + this.args 60 | 61 | println('''\ 62 | This is a gradle Build Shell. 63 | It has a connector variable prepared for you. Connect to projects like this: 64 | connector.forProjectDirectory(new File(".")) 65 | connection = connector.connect() 66 | project = connection.getModel(GradleProject) 67 | launcher = connection.newBuild() 68 | ''') 69 | super.exec() 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /config/codenarc/rules.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | ruleset { 17 | description 'Rules For Gradle Groovysh Plugin Project' 18 | ruleset('rulesets/basic.xml') 19 | ruleset('rulesets/braces.xml') 20 | ruleset('rulesets/concurrency.xml') 21 | ruleset('rulesets/convention.xml') { 22 | TrailingComma(enabled: false) 23 | } 24 | ruleset('rulesets/design.xml') { 25 | NestedForLoop(enabled: false) 26 | } 27 | ruleset('rulesets/dry.xml') { 28 | DuplicateListLiteral 29 | DuplicateMapLiteral 30 | DuplicateNumberLiteral 31 | DuplicateStringLiteral(enabled: false) // too much hassle 32 | } 33 | ruleset('rulesets/exceptions.xml') 34 | ruleset('rulesets/formatting.xml') 35 | // generic rules need to be configured to be active and useful 36 | //ruleset('rulesets/generic.xml') 37 | IllegalRegex { 38 | name = 'TODO' 39 | priority = 2 40 | regex = /TODO/ 41 | description = 'TODOs should not be commited' 42 | } 43 | 44 | // ruleset('rulesets/grails.xml') 45 | ruleset('rulesets/groovyism.xml') { 46 | GetterMethodCouldBeProperty(enabled: false) 47 | } 48 | ruleset('rulesets/imports.xml') 49 | //ruleset('rulesets/jdbc.xml') 50 | ruleset('rulesets/junit.xml') 51 | ruleset('rulesets/logging.xml') { 52 | Println(enabled: false) // logging a hassle for a plugin that needs QUIET logLevel 53 | } 54 | ruleset('rulesets/naming.xml') { 55 | FactoryMethodName(enabled: false) 56 | } 57 | ruleset('rulesets/security.xml') { 58 | JavaIoPackageAccess(enabled: false) // gradle uses Java.io.File 59 | } 60 | ruleset('rulesets/serialization.xml') 61 | ruleset('rulesets/size.xml') { 62 | CrapMetric(enabled: false) 63 | ParameterCount(enabled: false) 64 | } 65 | ruleset('rulesets/unnecessary.xml') { 66 | UnnecessaryGetter(enabled: false) 67 | UnnecessaryReturnKeyword(enabled: false) 68 | } 69 | ruleset('rulesets/unused.xml') 70 | } 71 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle1.9/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.0/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.1/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.3/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.4/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.5/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.6/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.7/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.8/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.9/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle1.10/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle1.11/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle1.12/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.10/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.13/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.14/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradle/gradle2.2.1/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /doc/Configuration.md: -------------------------------------------------------------------------------- 1 | # Plugin Configuration 2 | 3 | No configuration is required. To change the defaults, use a configuration block as below. All parts are optional. 4 | 5 | ```Groovy 6 | groovysh { 7 | 8 | 9 | // false to disable the shell task 10 | enableAppShell = true 11 | // false to disable the shell task 12 | enableBuildShell = true 13 | // false to disable the buildDevShell task 14 | enablebuildDevShell = true 15 | 16 | // groovyVersion determines the features of the shell and buildShell tasks 17 | // groovyVersion = '2.4.4' 18 | 19 | shell { 20 | // default is 'main' 21 | sourceSetName = 'test' 22 | extraClasspath = configurations.runtime.asFileTree 23 | workingDir = file('src/main/webapp') 24 | jvmArgs = ['-Xmx1024m'] 25 | /* arguments to groovysh */ 26 | // args = ['--terminal=none'] 27 | /* ... the other params of gradle JavaExec can also be used */ 28 | } 29 | 30 | buildShell { 31 | 32 | // gradle version determines version of connector in tooling API, 33 | // but connector can use other gradle version to build project via 34 | // connector.useGradleVersion('1.18') 35 | // gradleVersion = '2.12' 36 | 37 | /* ... params of gradle JavaExec can also be used */ 38 | } 39 | 40 | buildDevShell { 41 | } 42 | } 43 | ``` 44 | 45 | Disabling tasks mainly keeps your project environment a bit cleaner, but 46 | just having them enable should not have any measurable impact on performance. 47 | This is mostly provided in case one of the tasks fails to configure, but you 48 | want to run another. 49 | 50 | Groovy versions <= 2.2.1 are currently not supported by the ```shell`` and 51 | ```buildShell``` task due to mysterious Classpath problems. The ```buildDevShell``` 52 | task always runs with the Groovy version gradle ships with ( 1.8.6 **(;_;)** ). 53 | 54 | ## Custom task configuration 55 | 56 | If you want to define multiple different tasks, such as a special task for a shell with the unit 57 | test dependencies in the classpath, you can extend The ApplicationShell task: 58 | 59 | ```Groovy 60 | task testShell(type: com.tkruse.gradle.groovysh.ApplicationShellTask) { 61 | sourceSetName = 'test' 62 | } 63 | ``` 64 | 65 | ## Initial commands 66 | 67 | In order to speed up your daily work with a shell, you can run some commands to import frequently used 68 | packages, create Instances, or even load groovy files. Note that the load command of Groovysh changed 69 | from ```load``` to ```:load``` between versions. 70 | 71 | ```Groovy 72 | groovysh { 73 | shell { 74 | args = ['-e', 'import com.example.Example\ne = new Example()'] 75 | } 76 | } 77 | ``` 78 | 79 | or 80 | 81 | ```Groovy 82 | task testShell(type: com.tkruse.gradle.groovysh.ApplicationShellTask) { 83 | args = ['-e', 'import com.example.Example\ne = new Example()'] 84 | } 85 | ``` 86 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/ApplicationShellTask.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import static com.tkruse.gradle.groovysh.DynamicInvokeHelper.getApplicationShellExtension 4 | 5 | import org.gradle.api.artifacts.Configuration 6 | import org.gradle.api.file.FileCollection 7 | import org.gradle.api.tasks.SourceSetContainer 8 | 9 | /** 10 | * A task that starts a groovy shell with the application runtime classpath configured 11 | */ 12 | class ApplicationShellTask extends AbstractShellTask { 13 | 14 | static final String NAME = 'shell' 15 | static final String CONFIGURATION_NAME_PREFIX = 'appShellConf_' 16 | 17 | String sourceSetName 18 | FileCollection extraClasspath 19 | 20 | ApplicationShellTask() { 21 | super() 22 | this.description = 'starts a groovysh shell with the classpath set as runtime configuration output' 23 | String defaultSourceSet = getTaskExtension().sourceSetName 24 | if (defaultSourceSet == null) { 25 | defaultSourceSet = 'main' 26 | } 27 | setSourceSetName(defaultSourceSet) 28 | } 29 | 30 | @Override 31 | ShellTaskExtension getTaskExtension() { 32 | return getApplicationShellExtension(project) 33 | } 34 | 35 | void setSourceSetName(String newVal) { 36 | assert newVal != null 37 | this.sourceSetName = newVal 38 | 39 | /* 40 | * Would be nicer to use a Gradle JavaPlugin API here... but conventions should be stable 41 | */ 42 | 43 | SourceSetContainer sourceSets = project.sourceSets 44 | 45 | String classTaskDependency = 'classes' 46 | 47 | if (sourceSetName != 'main') { 48 | classTaskDependency = "${sourceSetName}Classes" 49 | } 50 | 51 | //println("using sourceSet $sourceSetName") 52 | this.dependsOn(classTaskDependency) 53 | 54 | String extendedRuntime = 'runtime' 55 | if (sourceSetName != 'main') { 56 | extendedRuntime = "${sourceSetName}Runtime" 57 | } 58 | project.configurations.getByName(getConfigurationName()) 59 | { Configuration config -> config.extendsFrom(project.configurations.findByName(extendedRuntime)) } 60 | 61 | FileCollection appClasspath = sourceSets.getByName(sourceSetName).runtimeClasspath 62 | FileCollection shellClasspath = project.configurations.getByName(getConfigurationName()).asFileTree 63 | this.classpath = appClasspath + shellClasspath 64 | FileCollection extraClasspath = getTaskExtension().extraClasspath 65 | if (extraClasspath != null) { 66 | this.classpath = this.classpath + extraClasspath 67 | } 68 | } 69 | 70 | @Override 71 | String getConfigurationName() { 72 | return CONFIGURATION_NAME_PREFIX + getName() 73 | } 74 | 75 | @Override 76 | void exec() { 77 | 78 | println('This is a gradle Application Shell.') 79 | println('You can import your application classes and act on them.') 80 | super.exec() 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /samples/src/test/groovy/com/tkruse/gradle/groovysh/MultiShellSpecification.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.tooling.BuildLauncher 4 | import spock.lang.Specification 5 | 6 | /** 7 | * Tests the gradle API on the multishell sample project 8 | */ 9 | class MultiShellSpecification extends Specification { 10 | 11 | void testImportCustomClass() { 12 | setup: 13 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('simple') 14 | 15 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 16 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 17 | ByteArrayInputStream bytesIn = new ByteArrayInputStream( 18 | 'import com.example.Example\ne = new Example()'.bytes) 19 | 20 | launcher.standardOutput = bytesOut 21 | launcher.standardError = bytesOut 22 | launcher.standardInput = bytesIn 23 | 24 | when: 25 | launcher.run() 26 | 27 | then: 28 | assert bytesErr.toString() == '' 29 | assert bytesOut.toString() =~ ('Groovy Shell') 30 | assert bytesOut.toString().contains('com.example.Example') 31 | assert !bytesOut.toString().contains('Exception') 32 | 33 | } 34 | 35 | void testImportCustomClassStartupFromCustomTask() { 36 | setup: 37 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('multishell', ['clean', 'mainShell'] as String[]) 38 | 39 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 40 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 41 | ByteArrayInputStream bytesIn = new ByteArrayInputStream() 42 | 43 | launcher.standardOutput = bytesOut 44 | launcher.standardError = bytesOut 45 | launcher.standardInput = bytesIn 46 | 47 | when: 48 | launcher.run() 49 | 50 | then: 51 | assert bytesErr.toString() == '' 52 | assert bytesOut.toString() =~ ('Groovy Shell') 53 | assert bytesOut.toString().contains('com.example.Example') 54 | assert bytesOut.toString().contains('e = new Example()') 55 | assert !bytesOut.toString().contains('Exception') 56 | } 57 | 58 | void testImportCustomClassTestTask() { 59 | setup: 60 | BuildLauncher launcher = LauncherHelper.getLauncherForProject('multishell', ['clean', 'testShell'] as String[]) 61 | 62 | ByteArrayOutputStream bytesOut = new ByteArrayOutputStream() 63 | ByteArrayOutputStream bytesErr = new ByteArrayOutputStream() 64 | ByteArrayInputStream bytesIn = new ByteArrayInputStream( 65 | 'import com.example.ExampleTest\ne = new ExampleTest()'.bytes) 66 | 67 | launcher.standardOutput = bytesOut 68 | launcher.standardError = bytesOut 69 | launcher.standardInput = bytesIn 70 | 71 | when: 72 | launcher.run() 73 | 74 | then: 75 | assert bytesErr.toString() == '' 76 | assert bytesOut.toString() =~ ('Groovy Shell') 77 | assert bytesOut.toString().contains('com.example.ExampleTest') 78 | assert !bytesOut.toString().contains('Exception') 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /samples/config/checkstyle/checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/GroovyshPlugin.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import static com.tkruse.gradle.groovysh.DynamicInvokeHelper.addGroovyshExtentions 4 | import static com.tkruse.gradle.groovysh.DynamicInvokeHelper.getPluginExtension 5 | 6 | import org.gradle.api.GradleScriptException 7 | import org.gradle.api.InvalidUserDataException 8 | import org.gradle.api.Plugin 9 | import org.gradle.api.Project 10 | 11 | /** 12 | * Plugin main class 13 | */ 14 | class GroovyshPlugin implements Plugin { 15 | 16 | public static final String PLUGIN_ID = 'com.github.tkruse.groovysh' 17 | public static final String NAME = 'groovysh' 18 | 19 | @Override 20 | void apply( final Project project ) { 21 | addGroovyshExtentions(project) 22 | 23 | // need to have extensions read 24 | project.afterEvaluate { 25 | setupTasks(project) 26 | } 27 | } 28 | 29 | static void setupTasks(final Project project) { 30 | if (getPluginExtension(project).enableBuildDevShell) { 31 | project.configurations.create(BuildDevShellTask.CONFIGURATION_NAME) 32 | 33 | try { 34 | project.tasks.create(BuildDevShellTask.NAME, BuildDevShellTask) 35 | } catch (InvalidUserDataException e) { 36 | // task already exists, not 100 lines of stacktrace needed to understand 37 | throw new GradleScriptException("$NAME: Cannot create task ${BuildDevShellTask.NAME}", e) 38 | } 39 | URLClassLoader loader = (URLClassLoader) GroovyObject.classLoader 40 | 41 | if (project.gradle.gradleVersion.startsWith('1')) { 42 | // gradle < 2.0 runs with groovy 1.8.6, groovysh needs jline 1.0 43 | project.dependencies.add(BuildDevShellTask.CONFIGURATION_NAME, 'jline:jline:1.0') 44 | } else { 45 | // gradle 2.0 runs with groovy 2.3.3, groovysh needs jline 2.11 46 | project.dependencies.add(BuildDevShellTask.CONFIGURATION_NAME, 'jline:jline:2.11') 47 | } 48 | 49 | project.configurations.getByName(BuildDevShellTask.CONFIGURATION_NAME).each { File file -> 50 | loader.addURL(file.toURL()) 51 | } 52 | } 53 | if (getPluginExtension(project).enableBuildShell) { 54 | try { 55 | project.tasks.create(BuildShellTask.NAME, BuildShellTask) 56 | } catch (InvalidUserDataException e) { 57 | // task already exists, not 100 lines of stacktrace needed to understand 58 | throw new GradleScriptException("$NAME: Cannot create task ${BuildShellTask.NAME}", e) 59 | } 60 | } 61 | if (getPluginExtension(project).enableAppShell) { 62 | if (project.configurations.names.contains('runtime')) { 63 | try { 64 | project.tasks.create(ApplicationShellTask.NAME, ApplicationShellTask) 65 | } catch (InvalidUserDataException e) { 66 | // task already exists, not 100 lines of stacktrace needed to understand 67 | throw new GradleScriptException("$NAME: Cannot create task ${ApplicationShellTask.NAME}", e) 68 | } 69 | } 70 | } 71 | if (getPluginExtension(project).enableAppShell || getPluginExtension(project).enableBuildShell) { 72 | TaskHelper.configureProjectForAppShell(project) 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/groovy/com/tkruse/gradle/groovysh/AbstractShellTask.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import static com.tkruse.gradle.groovysh.DynamicInvokeHelper.getPluginExtension 4 | 5 | import org.gradle.api.file.FileCollection 6 | import org.gradle.api.tasks.JavaExec 7 | 8 | /** 9 | * Superclass of shell tasks 10 | */ 11 | abstract class AbstractShellTask extends JavaExec { 12 | 13 | abstract ShellTaskExtension getTaskExtension() 14 | 15 | protected AbstractShellTask() { 16 | this.group = 'help' 17 | this.outputs.upToDateWhen { false } 18 | this.dependsOn(GenerateMainTask.NAME) 19 | // use an independent configuration for the task dependencies, so that application compile is not influenced 20 | project.configurations.create(getConfigurationName()) 21 | 22 | List jvmArgs = taskExtension.jvmArgs 23 | if (jvmArgs != null && jvmArgs.size() > 0) { 24 | this.jvmArgs = jvmArgs 25 | } 26 | List args = taskExtension.args 27 | if (args != null && args.size() > 0) { 28 | this.args = args 29 | } 30 | File workingDir = taskExtension.workingDir 31 | if (workingDir != null) { 32 | this.workingDir = workingDir 33 | } 34 | 35 | FileCollection bootstrapClasspath = taskExtension.bootstrapClasspath 36 | if (bootstrapClasspath != null) { 37 | this.bootstrapClasspath = bootstrapClasspath 38 | } 39 | 40 | this.enableAssertions = taskExtension.enableAssertions 41 | 42 | Map environment = taskExtension.environment 43 | if (environment != null) { 44 | this.environment = environment 45 | } 46 | OutputStream errorOutput = taskExtension.errorOutput 47 | if (errorOutput != null) { 48 | this.errorOutput = errorOutput 49 | } 50 | String maxHeapSize = taskExtension.maxHeapSize 51 | if (maxHeapSize != null) { 52 | this.maxHeapSize = maxHeapSize 53 | } 54 | InputStream standardInput = taskExtension.standardInput 55 | if (standardInput != null) { 56 | this.standardInput = standardInput 57 | } 58 | OutputStream standardOutput = taskExtension.standardOutput 59 | if (standardOutput != null) { 60 | this.standardOutput = standardOutput 61 | } 62 | Map systemProperties = taskExtension.systemProperties 63 | if (systemProperties != null) { 64 | this.systemProperties = systemProperties 65 | } 66 | 67 | //this.main = 'org.codehaus.groovy.tools.shell.Main' 68 | this.main = GenerateMainTask.PATCH_CLASS_CAN_NAME 69 | } 70 | 71 | protected void addGroovyDependencies() { 72 | String taskConfigurationName = getConfigurationName() 73 | TaskHelper.addGroovyDependencies(project, taskConfigurationName, getPluginExtension(project).groovyVersion) 74 | } 75 | 76 | abstract String getConfigurationName() 77 | 78 | @Override 79 | @SuppressWarnings('CatchException') 80 | void exec() { 81 | addGroovyDependencies() 82 | TaskHelper.checkDaemon(project) 83 | TaskHelper.checkQuiet(project) 84 | TaskHelper.checkParallel(project) 85 | this.classpath = this.classpath + project.files(new File(project.buildDir, 'groovyshClasses')) 86 | try { 87 | super.exec() 88 | } catch (Exception e) { 89 | logger.error('Invoking JavaExec for groovysh failed, classpath ' + this.classpath.asPath, e) 90 | throw e 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/test/groovy/com/tkruse/gradle/groovysh/BuildShellTaskTest.groovy: -------------------------------------------------------------------------------- 1 | package com.tkruse.gradle.groovysh 2 | 3 | import org.gradle.api.Project 4 | import org.junit.Test 5 | 6 | /** 7 | * Tests task setup. Stronger execution tests are in samples subfolder. 8 | */ 9 | class BuildShellTaskTest { 10 | 11 | @Test 12 | void testConfigureMain() { 13 | Project project = TestHelper.createProjectWithPluginAndJava() 14 | project.dependencies.add('compile', 'org.slf4j:slf4j-api:1.7.12') 15 | project.dependencies.add('testCompile', 'junit:junit-dep:4.11') 16 | TestHelper.setupTasks(project) 17 | BuildShellTask buildShellTask = (BuildShellTask) project.tasks.findByName(BuildShellTask.NAME) 18 | buildShellTask.addGroovyDependencies() 19 | buildShellTask.addGradleDependencies() 20 | buildShellTask.setupClasspath() 21 | List dependencyVersions = 22 | project.configurations.buildShellConf_buildShell 23 | .dependencies.asList().collect { it.name + it.version } 24 | assert !buildShellTask.dependsOn.contains('classes') 25 | 26 | assert buildShellTask.classpath.asPath.contains('groovy') 27 | assert buildShellTask.classpath.asPath.contains('slf4j') 28 | assert !buildShellTask.classpath.asPath.contains('junit') 29 | assert dependencyVersions.contains('gradle-tooling-api2.12') 30 | } 31 | 32 | @Test 33 | void testGroovyVersions() { 34 | for (String version in ['2.2.1', '2.2.2', '2.3.0', '2.3.9', '2.4.4']) { 35 | for (String gradleVersion in ['1.12', '2.0', '2.1', '2.2.1', '2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9', '2.13', '2.14']) { 36 | Project project = TestHelper.createProjectWithPluginAndJava() 37 | project.dependencies.add('testCompile', 'junit:junit-dep:4.11') 38 | 39 | project.groovysh.groovyVersion = version 40 | project.groovysh.buildShell.gradleVersion = gradleVersion 41 | TestHelper.setupTasks(project) 42 | BuildShellTask buildShellTask = (BuildShellTask) project.tasks.findByName(BuildShellTask.NAME) 43 | buildShellTask.addGroovyDependencies() 44 | buildShellTask.addGradleDependencies() 45 | List dependencyVersions = 46 | project.configurations.buildShellConf_buildShell 47 | .dependencies.asList().collect { it.name + it.version } 48 | assert dependencyVersions.contains('jline2.11') 49 | assert dependencyVersions.contains('commons-cli1.2') 50 | assert dependencyVersions.contains('groovy-all' + version) 51 | assert dependencyVersions.contains('gradle-tooling-api' + gradleVersion) 52 | } 53 | } 54 | } 55 | 56 | @Test 57 | void testConfigureMainWithGradleVersion() { 58 | Project project = TestHelper.createProjectWithPluginAndJava() 59 | 60 | project.groovysh.buildShell.gradleVersion = '2.12' 61 | 62 | TestHelper.setupTasks(project) 63 | BuildShellTask buildShellTask = (BuildShellTask) project.tasks.findByName(BuildShellTask.NAME) 64 | buildShellTask.addGroovyDependencies() 65 | buildShellTask.addGradleDependencies() 66 | buildShellTask.setupClasspath() 67 | assert buildShellTask != null 68 | List dependencyVersions = 69 | project.configurations.buildShellConf_buildShell.dependencies.asList().collect { it.name + it.version } 70 | assert dependencyVersions.contains('jline2.11') 71 | assert dependencyVersions.contains('commons-cli1.2') 72 | assert dependencyVersions.contains('groovy-all2.4.4') 73 | assert dependencyVersions.contains('gradle-tooling-api2.12') 74 | 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /gradle/gradle2.7/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >&- 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >&- 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradle/gradle2.10/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradle/gradle2.8/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradle/gradle2.9/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradle/gradle2.13/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradle/gradle2.14/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradle/gradle1.10/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradle/gradle1.11/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradle/gradle1.12/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | --------------------------------------------------------------------------------