ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Betin" <ABe...@futuretrade.com>
Subject RE: How to break up file-build.xml and execute them together as optional
Date Thu, 21 Nov 2002 18:41:27 GMT
back to your original question if you
want to be able to invoke each project's build.xml
separately from global.xml,
what you could do is to put each <ant> call
into a separate target, e.g.

<target name="inventory" depends="init">
	<ant dir="${inventory.home}/src" target="core" />
</target>

<target name="shoppingcart" depends="init">
	<ant dir="${shoppingcart.home}/src" target="core" />
</target>

<target name="buildall" depends="inventory, shoppingcart, ...">
</target>

then you can invoke Ant as:
ant inventory
ant shoppingcart

or

ant buildall

(of course you can make buildall default target etc.)

~Alexei

> -----Original Message-----
> From: Alexei Betin 
> Sent: Thursday, November 21, 2002 10:25 AM
> To: Ant Users List
> Subject: RE: How to break up file-build.xml and execute them 
> together as
> optional
> 
> 
> see comments:
> 
> > -----Original Message-----
> > From: ravi appala [mailto:appala12@yahoo.com]
> > Sent: Wednesday, November 20, 2002 6:55 PM
> > To: Ant Users List
> > Subject: RE: How to break up file-build.xml and execute them 
> > together as
> > optional
> > 
> > 
> > I have seen a build processs used in petstore
> > example,could not understand.You may easily understood
> > and help me in this regard.
> > 
> > Qtn1. see below example. What is %1,2,3,4? what it is
> > invoking?
> > 
> > @echo off
> > set ANT_HOME=../lib/ant
> > set ANT_CLASSPATH=%JAVA_HOME%/lib/tools.jar
> > set
> > ANT_CLASSPATH=%ANT_HOME%/lib/ant.jar;%ANT_HOME%/lib/xml.jar;%A
> > NT_CLASSPATH%
> > set
> > ANT_CLASSPATH=%J2EE_HOME%/lib/j2ee.jar;%ANT_CLASSPATH%
> > %JAVA_HOME%\bin\java -classpath "%ANT_CLASSPATH%"
> > -Dant.home=%ANT_HOME% -Dj2ee.home=%J2EE_HOME%
> > org.apache.tools.ant.Main %1 %2 %3 %4
> > 
> 
> Apparently %1 %2 %3 %4 are whatever arguments you specify
> on command line to invoke the above script,
> up to 4 of them will be passed on to Ant's main() methods.
> 
> So you got some custom script to invoke Ant, 
> I suggest you use the one comes with Ant distribution
> (ant.bat or ant.sh depending on your platform) instead
> of the one above.
> 
> > Qtn2.
> > How do we invoke targets if the build.xml has more
> > than one Target with default as "core"? for example
> > <target name="core" depends="compile_util_classes,
> > compile_classes, customerejbjar" />
> > <target name="all" depends="compile_util_classes,
> > compile_classes, customerejbjar, javadocs" />
> > <target name="clientjar" dpends= "compile,
> > compile_classes"/>
> > 
> 
> read about Running Ant in Ant documentation here:
> http://jakarta.apache.org/ant/manual/index.html
> 
> > Qtn3. if we make ant call, does it expand the
> > build.xml file with including other files or does it
> > execute each ant file for each ant file? for example
> > <target name="core" depends="init">
> > <ant antfile="${tracer.home}/src/build.xml" 
> > dir="${tracer.home}/src" target="core" />
> > <ant antfile="${customer.home}/src/build.xml"
> > dir="${customer.home}/src" target="core" />
> > <ant antfile="${personalization.home}/src/build.xml"
> > dir="${personalization.home}/src" target="core" />
> >     <ant antfile="${inventory.home}/src/build.xml"
> > dir="${inventory.home}/src" target="core" />
> >     <ant antfile="${signon.home}/src/build.xml"
> > dir="${signon.home}/src" target="core"/>
> >     <ant antfile="${shoppingcart.home}/src/build.xml"
> > dir="${shoppingcart.home}/src" target="core" />
> >     <ant antfile="${mail.home}/src/build.xml"
> > dir="${mail.home}/src" target="core" />
> >   </target>
> > 
> 
> Not sure I understand the question completely, but I guess
> the latter is true, basically it's a new Ant invocation
> each time, as if you manually went to each {xxx.home}
> directory and ran Ant there, the only difference is
> that all properties of the "global" build.xml by default
> are inherited (become visible) in each individual build.xml
> 
> 
> > Qtn4. How to enable the properties using ant in your
> > solution
> > 
> 
> not sure what you mean by "enable", to set a property
> use <property> task, to set a property based on some
> condition look at <condition> & <available> tasks
> 
> normally you do something like:
> 
> <target name="dowork" depends="check-conditions,dowork-internal" />
> 
> <target name="check-conditions" >
> 	<!-- here you set (or not) dowork.enabled property
> 	     based on whatever conditions you want,
> 	     you may use <condition>, <available>,
> 	     and <uptodate> tasks -->
> </target>
> 
> <target name="dowork-internal" if="dowork.enabled" >
> 	<!-- this is only executed if dowork.enabled was set -->
> </target>
> 
> > I am sorry if I am asking more questions,but it is
> > kind of bothering me and I am not
> > understanding,thought you would help me.
> > 
> > Thanks,
> > ravi
> > --- Alexei Betin <ABetin@futuretrade.com> wrote:
> > > in my approach I use 2 kinds of "global" files:
> > > 
> > > one category is for shared properties and targets,
> > > these files contain the real smarts of your build,
> > > - such files are included by individual project
> > > build.xml files using normal XML ENTITY include,
> > > so the build.xml's are dumb - just a bunch of
> > > <property> sets & includes,
> > > 
> > > then there are global "drivers" - buildfiles
> > > which are used to invoke a series of individual
> > > build.xml's,
> > > these usually also dumb - just a bunch of <ant>
> > > calls
> > > 
> > > dynamically chosing what to run is done
> > > with setting (or not) a property and then 
> > > putting a condition on a target ( 
> > > <target name="dowork" if="dowork.enabled" ... /> )
> > > 
> > > hope it helps,
> > > ~Alexei
> > > 
> > > > -----Original Message-----
> > > > From: ravi appala [mailto:appala12@yahoo.com]
> > > > Sent: Wednesday, November 20, 2002 4:30 PM
> > > > To: Ant Users List
> > > > Subject: How to break up file-build.xml and
> > > execute them together as
> > > > optional
> > > > 
> > > > 
> > > > I would like to know the way to compile pieces
> > > with
> > > > individual (pices of)build.xml  and also all of
> > > them
> > > > together with option by selecting them
> > > dynamically.
> > > > 
> > > > I am using Ant to build and deploy for our
> > > system.We
> > > > are expanding our Web App Server to run with 20
> > > java
> > > > applications.
> > > > I would like to create a build.xml for each
> > > > application and one global.xml with choosing each
> > > > build.xml of each application as demand and run
> > > it.How
> > > > could I do this?
> > > > 
> > > > Thanks,
> > > > ravi 
> > > > 
> > > > =====
> > > > Thanks,
> > > > RAVI KUMAR APPALA
> > > > 
> > > > __________________________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Web Hosting - Let the expert host your site
> > > > http://webhosting.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>
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:  
> > > <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:ant-user-help@jakarta.apache.org>
> > > 
> > 
> > 
> > =====
> > Thanks,
> > RAVI KUMAR APPALA
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.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>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message