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: AW: Command line arguements..
Date Wed, 11 Dec 2002 11:02:03 GMT
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:krish_j2ee@yahoo.co.in]
> 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
>    
>  --- Jan.Materne@rzf.fin-nrw.de 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: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
> > > 
> >  
> 
> ______________________________________________________________
> __________
> Missed your favourite TV serial last night? Try the new, Yahoo! TV.
>        visit http://in.tv.yahoo.com
> 
> --
> To unsubscribe, e-mail:   
<mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

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