Count lines
Howto count all lines from stdin or a file in groovy.
(more…)
List directory contents with AntBuilder
This shows how to list the content of a directory with AntBuilder.
(more…)
Run Groovy in AntBuilder
This is a nonsense example of how to run groovy code with the groovy task in AntBuilder.
(more…)
Logging with groovy
Logging with groovy is as simple as this.
(more…)
Creating a Zipfile with AntBuilder
This is an example of the groovy antbuilder to create a zipfile.
(more…)
Printf in groovy
This shows you how to use the printf function in groovy to print a tic tac toe field like this:
| x | o ---+---+--- | x | ---+---+--- o | |
in stdout
Determine the size of a file
The lengt function prints out the size of a file.
Create random integers in a specific range
For example you would like to create 10 pseudo random numbers between 0 and 10.
(more…)
Using Ant build.xml and Antbuilder
This show how to combine the Ant build.xml and the groovy AntBuilder.
(more…)
Loop over Calendar
This is an example with a GregorianCalendar.
(more…)