File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Groovy and the fly likes [Groovy] Ant Scripting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "[Groovy] Ant Scripting" Watch "[Groovy] Ant Scripting" New topic
Author

[Groovy] Ant Scripting

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I was reading my copy of GinA this evening and looking at the builders section and Ant Scripting. I like how logic in build files are really concise using groovy so I am working on converting a few of my build scripts from XML to groovy to see how it goes.

I'm curious on a coupld of aspects during the conversion. One being properties. What is the best practice in this regard? Should we do as GinA did:

CLASSES_DIR = 'classes'
ETC_DIR = 'etc'

Or is there a different, more AntBuilder way?

Also, is there a way that I can execute my groovy ant script and call a specific task? My initial thought was to grab an argument and determine a method in a Build class. But not sure about best practice here.

And lastly, for now, what is the best way to read in a properties file and make these properties available to the rest of the script? The current ANT way would be something like:



And now all my tomcat.properties are available via ANT's EL.

Thanks.


GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Thought I would bump this up in case it got lost in the shuffle.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Groovy] Ant Scripting