Currently i’m using a shell script to do the following:
cd myproject1/
ant
cd ..
if grep 'sucessful' myproject/buil.log then move myproject ../backup/today/
And so on for myproject2, myproject3.
If some error happens, the project stay in the current dir to be reprocessed but the whole process continues.
I want to migrate this process to an ant build script but i have no clue on how to do this.
I have looked at ant and subant tasks. Ant looks more suitable to the job but i can’t find a way to loop through a directory list using ant and move task togheter, checking if the ant task completes or not.
Thank you.
Checkout this answer:
running specific target in different ant scripts in different directories
I recommend that your submodule builds should throw an error rather than try and duplicate the log parsing logic.
Update
If this is designed to support deployment, perhaps you should consider a groovy script?
Would better support exception conditions:
Groovy has excellent ANT integration and can also be embedded within your ANT build: