Running multiple ant sequentially from a batch file

I'm trying to find a way to execute multiple Ant builds in sequence from the command line. I have no way to directly edit the assembly files. Here's what I have:

@echo off
cd c:\my\first\buildfile\dir
ant -buildfile build1.xml target1 target2
cd c:\my\second\buildfile\dir
ant -buildfile build2.xml target1 target2 target3

      

I want to use something similar for multiple projects. However, it currently only starts the first build (it seems to create both targets), but then stops and doesn't move on to the next. I'm sure the solution to this is probably obvious, but this is the first time I've used Ant from the command line. I usually run it from Eclipse. How can I run multiple Ant builds from just one batch file if possible?

+3


source to share


1 answer


You can try this:



@echo off
cd c:\my\first\buildfile\dir
call ant -buildfile build1.xml target1 target2
cd c:\my\second\buildfile\dir
call ant -buildfile build2.xml target1 target2 target3

      

+11


source







All Articles