aboutsummaryrefslogtreecommitdiff
path: root/samples/Groovy
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2012-07-23 15:52:49 -0500
committerJoshua Peek <josh@joshpeek.com>2012-07-23 15:52:49 -0500
commit7b6caa0f6c7603aabb5e6ed657e24aaddbeafc78 (patch)
treeec0522eae75bb04ae73d28ae3f599682a2bfdaeb /samples/Groovy
parent314f0e485227915931db361be14d308a210bedea (diff)
Rename samples subdirectories
Diffstat (limited to 'samples/Groovy')
-rw-r--r--samples/Groovy/build.gradle17
-rwxr-xr-xsamples/Groovy/script.groovy2
2 files changed, 19 insertions, 0 deletions
diff --git a/samples/Groovy/build.gradle b/samples/Groovy/build.gradle
new file mode 100644
index 0000000..c1ac812
--- /dev/null
+++ b/samples/Groovy/build.gradle
@@ -0,0 +1,17 @@
+task echoDirListViaAntBuilder() {
+ description = 'Uses the built-in AntBuilder instance to echo and list files'
+ //Docs: http://ant.apache.org/manual/Types/fileset.html
+
+ //Echo the Gradle project name via the ant echo plugin
+ ant.echo(message: project.name)
+ ant.echo(path)
+ ant.echo("${projectDir}/samples")
+
+ //Gather list of files in a subdirectory
+ ant.fileScanner{
+ fileset(dir:"samples")
+ }.each{
+ //Print each file to screen with the CWD (projectDir) path removed.
+ println it.toString() - "${projectDir}"
+ }
+}
diff --git a/samples/Groovy/script.groovy b/samples/Groovy/script.groovy
new file mode 100755
index 0000000..1ee357a
--- /dev/null
+++ b/samples/Groovy/script.groovy
@@ -0,0 +1,2 @@
+#!/usr/bin/env groovy
+println "Groovy!"