Reputation: 1
My ant files are already present and I am not allowed to change those for various reasons.
I have created a batch file and I am writing all those ant commands in that batch file just to automate the process.
The code looks something like this
1. cd abc
2. ant realclean && ant
3. cd..
4. cd pqr
5. ant realclean && ant
6. cd..
However now I have to check if the build fired on line 2 is successful then only goto line 3 otherwise exit.
I googled a bit and found %errorlevel%
as one option but it is not working in my case.
Any suggestions?
Thanks in advance.
Upvotes: 0
Views: 937
Reputation: 328754
How about adding another ANT file which contains the tasks to execute the existing ANT files?
That would give you error handling without doing anything, you could reuse that file on different OSs and your CI server and the syntax would be saner than batch...
You can have ANT execute, say project.xml
, with ant -f project.xml
[EDIT] You don't even have to change the existing projects: Just create a new project, assign paths to the old projects to properties in the new build.xml
and then you can build the old projects from the new one.
This gives you:
[*]: Compared to DOS...
Upvotes: 1