ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Siri <as...@printcafe.com>
Subject RE: [VOTE] target-less build files
Date Sat, 20 Jul 2002 06:30:21 GMT
I hear you.  I guess I liked the clean
projects-contain-targets-and-targets-contain-tasks hierarchy.  I realize
that the <property> and <taskdef> tasks sort of broke that and since we are
allowing those tasks special treatment then why not just allow all tasks the
same treatment for consistency, right?  That makes sense.  But if you look
at it in a certain way, the <project> itself then becomes a sort of
super-target.  One that has its own tasks but also contains other targets.
Is that too far off the mark?  What if we extended that a little further by
making the three following changes:

1. <project> is a synonym for <target> (backwards compatibility).
2. targets can contain tasks and other targets.
3. A new optional attribute, "default", is added to targets that behave the
same as project's attribute of the same name.

(yes, I know more would probably have to change, the 3 items above will
hopefully clarify my idea.)

This means you would have files that look like:

<target/project name="project" default="all">
	<task1/>
	<task2/>
	<target name="subTarget1" default="subSubTarget1"/>
		<task1/>
		<task2/>
		<target name="subSubTarget1" depends="subSubTarget2">
			<task1/>
			<task2/>
		</target>
		<target name="subSubTarget2">
			<task1/>
			<task2/>
		</target>
	</target>
	<target name="all" default="subTarget1>
		<task1/>
		<task2/>
	</target>
</target>

There would be an implicit dependency on all parent targets.  So target
execution, say by running "ant subSubTarget1" would first run project's
tasks, then subTarget1's task, then subSubTarget1's dependencies, then
subSubTarget1's tasks, then subSubTarget1's default (of which there isn't
one in the example above).  This would allow one to group related,
inter-working targets under one umbrella target for clarity.

I think it would work - I haven't worked out all of the details (how do
properties propagate, etc.)  But it looks like it would be backwards
compatible, would be very consistent and it would address both the top-level
task request and the should-targets-no-longer-be-required debate (since the
entire thing is itself a target!)

Anyways, food for thought.  Just wonder what people thought of the idea.  If
this has already been suggested and vetoed then I apologize.

Hope everybody has a nice weekend.

-Aaron

> -----Original Message-----
> From: costinm@covalent.net [mailto:costinm@covalent.net]
> Sent: Friday, July 19, 2002 1:49 PM
> To: Ant Developers List
> Subject: RE: [VOTE] target-less build files
> 
> 
> On Fri, 19 Jul 2002, Aaron Siri wrote:
> 
> > 1. Do people want a build system or a scripting language?  
> Target-less files
> > and top-level tasks start to move Ant into the realm of 
> scripting language
> 
> I'm not sure I understand where do you find a relation 
> between top-level
> tasks and scripting language. Maybe they have some relation with the 
> global warming - but not scripting.
> 
> 
> > 2. I don't buy the "removing the target requirement makes 
> it easier for
> > newbies" argument.  Targets aren't too difficult to figure 
> out and are one
> > of the basic constructs within a build system (which, for 
> this argument, I'm
> > assuming Ant still is.)  You're not doing newbies any 
> favors by allowing
> > them to ignore targets.  There is nothing difficult about:
> 
> Actually, I don't buy this either - it makes it easier for everyone. 
> It seems most projects are using <property>, <typedef> at top level,
> this is a pretty common style. I find it more intuitive and easier 
> to read - and I'm not 'newbies'.
> 
> As allways, if you don't like it, don't use it - but please don't
> try to convince people who like it or need it that they shouldn't
> because you don't :-)
> 
> 
> > 3. Finally, maybe I missed something, but I don't see any 
> problems these
> > suggestions are solving.  Do we want to risk compromising 
> the integrity of
> > well-formed Ant build scripts to make a few fringe cases easier?
> 
> 
> - it simplifies the model and parsing.
> - it eliminates the special treatment of some tasks
> - well-formed ant scripts don't change in any way
> 
> 
> > I don't mean to upset anybody but Ant is very cool and, so 
> far, very clean
> > and focused.  I don't want to see it get mussed up with 
> unnecessary new
> > "features".  Perhaps I'm just being too rigorous.
> 
> There is no 'new' feature here - tasks were allowed at top level in
> previous versions. It just removes an arbitrary restriction.
> 
> Costin
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ant-dev-help@jakarta.apache.org>
> 

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


Mime
View raw message