Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running multiple ant builds sequentially from batch file

I'm trying to find a way to run multiple Ant builds sequentially from the command line. I do not have the ability to edit the build files directly. Here is 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 be able to use something similar to this for multiple projects. However, it currently only runs the first build (it seems to build both targets) but then stops, and doesn't continue 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 inside Eclipse. How would I go about running multiple ant builds from within just one batch file, if it's even possible?

like image 557
DerStrom8 Avatar asked Dec 12 '22 02:12

DerStrom8


1 Answers

You can try the following:

@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
like image 198
M A Avatar answered Jan 05 '23 01:01

M A