<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
> 

Reply via email to