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
Thanks Nagai!
ReplyDeleteMy pleasure, toonx :-)
ReplyDelete