Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Groovy] Ant Scripting

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thought I would bump this up in case it got lost in the shuffle.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic