ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barrie Treloar <Barrie.Trel...@camtech.com.au>
Subject Re: Including other antfiles
Date Thu, 10 Aug 2000 01:43:10 GMT
On Wed, 9 Aug 2000, Dino Valente wrote:

> >Where the dependencies of TargetA do not exist in the same make file, but
> >in one of the included files.
[del]
> This ability to include other ant files is really crucial in order for me
> to use ant. Othersize, I will be typing in the same stuff for all my
> projects (I have 20 projects). People have suggested to use the following
> method:
> 
> <project name="fooproject" basedir=".">
>       <ant antfile="X" dir=" ... " target="TargetX.B"> 
> 		<property name="name" value="foo" />
> 	</ant>
> </project>
> 
> where X is the general file. This doesn't work for me since you would have
> to define all the rules again the build file and propagate the action to
> the general build file (e.g I have separate rules for building the jar
> file, cleaning the .class files and generating javadocs). Maintanence is a
> nightmare.
> 
> Ant is a very good product. I was hooked. However, I was very disappointed
> on its ability to not handle complex projects. Basically, I wanted the
> ability build each project separately and the ability to build all my
> projects in an efficient way. With make, it is a no brainer except for
> compiling java files. This is why I like ant so much is that it takes care
> of this aspect for me. I was also disappointed on how Ant handles property
> values (you can only set it once and can never override them). I'm still
> hoping someone will post an example that will convince me that Ant is the
> answer to my problem (so far no one has). 

I can't speak for the commiters or ant, this is what I have surmaised
over a few weeks on being on the list.

The separation of the rules to the use of rules is one of the
confusing aspects of make.  As a developer (and lets assume I dont
know make) I write a makefile with some "magical" targets that are
defined in the configuration management plan.  These targets will
compile, jar, clean etc my project automatically for me. 

If I need to do something a different from the magical targets I need
to make modifications myself but I need to override the magical
targets and now I need to know how make works in order to do so.

In Ant I have all my targets and tasks in the build file.  It does
mean that you can end up with a large build file if you are doing
complex things.  But since there is a file for each project I can make
changes to my specific file and I know I wont break other existing
projects. 

Remember that you only have 20 projects.  So you really only need to
set up Ant for one project, parameterize the file so its easy to make
changes, and copy to 19 other projects.  You can then use this "Ant
Template" for any new projects that start.  It starts to become a
maintenance nightmare if you need to make the same change to all the
build files.

You need to ask this question:

        "Does the effort of creating a shared template file outweigh
        the time it takes to make the modifications to a copy?"

Unfortunately the answer in most case is no.  
Which is a shame, sometimes automatiting causes more work than it
saves.

Barrie
--
Barrie Treloar
____________________________________________________________________

  Barrie Treloar                      Phone: +61 8 8303 3300
  Senior Analyst/Programmer           Fax:   +61 8 8303 4403 
  Electronic Commerce Division        Email: barrie@camtech.com.au
  Camtech (SA) Pty Ltd                http://www.camtech.com.au
 --- Level 8, 10 Pulteney Street, Adelaide SA 5000, Australia. ---
____________________________________________________________________



Mime
View raw message