Trying to create a grails ant task that has other environments besides prod for the war task.
i've tried
<target name="war" depends="-init-grails" description="--> Creates a WAR of a Grails application">
<grails script="War" args="grails.env=${env} ${war.filename}"/>
</target>
and
<target name="war" depends="-init-grails" description="--> Creates a WAR of a Grails application">
<grails script="War" args="-Dgrails.env=${env} ${war.filename}"/>
</target>
Neither of these two work and always just run the production env. Note that I've also hard coded ${env} so it's not that it's missing
if you go in your project directory and run "grails --integrate-with -ant" it will create a build.xml which will automatically use ivy to download dependencies, and grails, and creates the macro def for you.
You can use the build.xml as a starting point for your project
I use a macrodef for this:
You can execute simple commands:
or more complex ones like your war task:
you might want to look at grails scripting to solve your problem
http://www.grails.org/Command+Line+Scripting
it has wrapped ANT so you can utilize ant tasks inside the scripts and I believe you have access to the environment and lots of other "groovy" stuff
i think you can also do this if you are set on using ant, although I havent tried it with grails scripts