About Me

My photo
Author of Groovy modules: GBench, GProf, Co-author of a Java book パーフェクトJava, Game Developer at GREE

Friday, April 8, 2011

Gj, it is the simplest way to distribute your Groovy program

There are some build tools for Groovy. They may be great tools. But I'm very layzy. I don't want to learn big tools only for creating jar files.


So I wrote one Groovy script, named 'Gj'. By using Gj, you can create jar files very easily without pain. I'll show you the simplest example of using Gj. Let me assume that you have a Groovy source file, named Foo.groovy under srcdir directory and you want create an executable jar file, foo.jar with it. In this case, enter this:

> groovy Gj.groovy -s srcdir -m Foo foo.jar


Your program uses many libraries? No problem. You only need to add their directory to argument. Gj will merge them into the result jar file.

> groovy Gj.groovy -s srcdir -m Foo -l libdir1,libdir2,libdir3 foo.jar


If you need more help, please download Gj from here and enter this:

> groovy Gj.groovy -h