ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject RE: if and unless attributes for all Tasks
Date Thu, 17 May 2001 09:49:09 GMT
> From: Tim Vernum [mailto:Tim.Vernum@macquarie.com.au]
>
> I used GNU make because it offers more features.
> But I happen to make the greatest use of those features which
> allow for modularity.
>
> The greatest addition *ever* to make (and it's not just GNU that
> does it) is includes.
>

Agreed. That is why something of the sort is being considered for ANT.
As I said you can mimic that today with external entities, but it wouldn't
look as nice as a well defined <include> directive.

My question to you is: Should we do like make and see inclusion as just
an inplace macro expansion (just more text in the XML stream) or should
we see <include> as loading some structures piece of XML something like
a <projectmodule/> entity. In other words have some well defined concept
of what is being included, with well defined visibility and name space
rules.

> The ability to automate dependencies, and store them outside
> of the makefile is a huge win for C/C++ projects.
> Make doesn't do my dependency generation, I have a shell script
> which wraps around gcc to do that, but it is the fact that make
> allows me to move that task into a separate tool that allows
> make to be more useful.
>
> The other (GNU)make features I use heavily:
>
>    * wildcard and foreach, BUT only because make needs to know about
>      all my files.
>      I use wildcard as a fileset, and the only reason I need the
>      foreach is because make wants to know my list of object files
>      and I only want to specify my source code.
>

I think we have cover this relatively well, with the only thing left is
whether to adopt some generic <foreach> over filesets, which has been
offered.

>    * Some variable manipulations (like +=) but they are mostly a
>      result of the way make works. I do think that I have the
>      potential to run into the same requirements in Ant, but I
>      haven't yet.
>

This is what I am concerned about.
Make requires this things not because of a need for generic mutable
variables, but because of includes and the fact that there is no way to pass
parameters into an include. So you need to say things like "Oh, by the way,
add this additional files to the C_SOURCES variable defined in the include".
And it works correctly because in MAKE variables are reevaluated on each
usage, while in ANT we have static evaluation.
So in make, if you have:

	A = 1 2 3
	B = $A
	A += 4 5 6
	C = $B

C and B contains "1 2 3 4 5 6". Of course MAKE needs another asigment to
avoid recursive definitions and you just keep pilling more andd more and
more hacks to make the whole thing work properly.

So, going back to my question before, if we were to have some module
abstraction, should we require passing explicit parameters, instead of
requiring mutability of global properties? Something like:

	<includemodule file="....." >
	  <param name="sources" value="${mysources}" />
	</includemodule>

where sources is the variable being used in your <projectmodule/>.

Jose Alberto



Mime
View raw message