ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Basic question Javac ... (it is long !!!)
Date Thu, 03 May 2001 20:48:31 GMT
Whether to have build-files for each of your modules is a design decision.
If you go with just a single build-file at the top of the tree, and your
build process is complicated, then having everything in one file can tend
to get a bit unwieldy. On the other hand, if your process is fairly
straightforward, having a single build-file may be easier to maintain.

You can have targets in your build-file for each of your modules (assuming
you want to be able to build them individually) and, say, an "all" target
that either "depends" on all the targets needed to build everything, or,
if you need to override property values, does <antcall>'s to those targets
that need that. 

If you go with individual build-files, you can still have an "all" target
in your top-level build-file, but it would do <ant>'s to those other
build-files instead. One advantage of having individual build-files is
that you can have a default target for each of those, so that when you're
doing development, and you're down in some module sub-directory, you can
just use 'ant' to recompile (assuming your default target is to do
compiles) rather than having to specify the module's target in the
top-level file.

As an example of a single top-level build-file, you can look at the
build.xml file Ant itself (but be prepared -- it's pretty huge :)

As an example of a build-file that has sub-project build-files, see the
build.xml for Tomcat-4.0 at:
http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat-4.0/build.xml?rev=1.21&content-type=text/vnd.viewcvs-markup

Hope this helps,
Diane

--- Viraj Purang <viraj_purang@spincircuit.com> wrote:
> Hi,
>    I am new to the ANT scene, so a silly question.
> I have multiple modules in CVS each having its own src directory
> 
> 
> CVS Structure for module ...
> ---------------------------------------
> 
>     <module-name>
>         properties
>             com
>                 <company-name>
>                     <module-name>
>                         <module specific directory/property files as
> needed>
>                     <dir1>
>                         <sub-dir1>
>         images
>             <dir1>
>         public_html
>             <module-name>
>                 <dir1>
>                 <dir2>
>                 <dir3>
>         src
>             javabeans
>                 com
>                     <company-name>
>                         <module-name>
>                             <dir1>
>                             <dir2>
>                             <dir3>
>                             <dir4>
>             servlets
>                 com
>                     <company-name>
>                         <module-name>
>                             <dir1>
>                             <dir2>
> 
> SO do I need to have seperate hierarchy of build.xml files at each 
> directory level or only one at the topmost level to build.
> In case I need a hierarchy ...how do I code that ? PLease POint me some 
> examples if you can !!!
> 
> Regards,
> Viraj Purang
> 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Mime
View raw message