The buildfile does the same as the batch file. But while you can give targets to the batchfile like build.bat Project1 build deploy this can´t be done in buildfile, because there is not target 'build'. That is defined in project1.xml. If your subproject have both 'build' and 'deploy' targets you can make them accessible via the masterbuildfile with <ant>. So ant project2.build would call the target 'build' on project2.xml. But you have to write that <ant>-calls for all targets for all subprojects. Because thats too much, you can generate.
But I think the batch solution is the better one. Jan Matčrne > -----Ursprüngliche Nachricht----- > Von: Ram Krish [mailto:[EMAIL PROTECTED]] > Gesendet am: Mittwoch, 11. Dezember 2002 11:49 > An: Ant Users List > Betreff: Re: AW: Command line arguements.. > > Hi Jan Materne, > i successfully built my project using the BT batch > file whatever you said.However i dont understand how > to do same thing with the XML buildfile.Please explain > me in detail.. > > Thanks, > Ram > > --- [EMAIL PROTECTED] wrote: > <project > name="master"> > > <target name="Project1"> > > <ant antfile="project1.xml" /> > > </target> > > <target name="Project2"> > > <ant antfile="project2.xml" /> > > </target> > > <target name="project2.build"> > > <!-- You can invoke targets of your > > subproject by this master build > > file --> > > <!-- But you have to write (generate) this > > targets for all of your > > sub-targets --> > > <ant antfile="project2.xml" target="build" > > /> > > </target> > > ... > > </project> > > > > > > > > But faster would be shell script / batch file: > > > > > > NT-Batchfile: > > > --8-<----8-<-----8-<-----8-<-----8-<-----8-<-----8-<-----8-<--- > > @echo off > > if "%1%=="Project1" goto project1 > > if "%1%=="Project2" goto project2 > > goto end > > > > :project1 > > rem You cannot pass %* because the first parameter > > is only used for > > selecting the right buildfile > > ant -buildfile project1.xml %2 %3 %4 %5 %6 %7 %8 %9 > > goto end > > > > :project2 > > ant -buildfile project1.xml %2 %3 %4 %5 %6 %7 %8 %9 > > goto end > > > > :end > > > --8-<----8-<-----8-<-----8-<-----8-<-----8-<-----8-<-----8-<--- > > (not tested) > > > > > > Jan Matčrne > > > > > -----Ursprüngliche Nachricht----- > > > Von: Ram Krish [mailto:[EMAIL PROTECTED]] > > > Gesendet am: Dienstag, 10. Dezember 2002 11:49 > > > An: [EMAIL PROTECTED] > > > Betreff: Command line arguements.. > > > > > > > > > Hi, > > > > > > I want to build my project based on the argument > > passed from > > > the commnad line > > > > > > i.e Ant Project1 or Ant Project2.. > > > > > > how to determine this?. any help would be > > appreciated.. > > > > > > thanks, > > > > > > Krish > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Catch all the cricket action. Download Yahoo! > > Score tracker > > > > > > > ______________________________________________________________ > __________ > Missed your favourite TV serial last night? Try the new, Yahoo! TV. > visit http://in.tv.yahoo.com > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>