ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Command line arguements..
Date Tue, 10 Dec 2002 11:04:00 GMT
<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:krish_j2ee@yahoo.co.in]
> Gesendet am: Dienstag, 10. Dezember 2002 11:49
> An: ant-user@jakarta.apache.org
> 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
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message