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 [ANT2] To <projectref> or not to <projectref>
Date Tue, 06 Nov 2001 04:11:20 GMT
Hi guys,

Here I am again questiioning things we have discussed in the past. ;-)

I have been thinking about the usage patterns in ANT2 and I am doubting  the clarity of the
pattern produced by <projectref> as we defined it in the previous discussion (some months
ago).

Do not take me wrong, I was one pushing for something like <projectref>, but I am now
thinking we may be 
producing some sort of pattern similar to "Multiple Inheritance". And that make me think whether
do we really
want that or a more simple "Single Inheritance" pattern may produce more maintainable build
files (which is
the whole point for these patterns). As with the debate between C++ and Java have demonstrated
there are
no clear answers in that regard, so I am just trying to bring this issues to the front.

The original reason for something like <projectref> was to be able to define something
like a project template
containing common parts of a shop's build process and then instantiate the specifics of a
particular project.
Keeping this narrow basic requirement in mind, what do you think of the following construct:

    <project name="subproject" extends="superbuild.xml" >

        <target name="overloaded" depends="a,b,super:overloaded,d" >
            ....
        </target>
    </project>

The idea here is that, as with Java code, one can define projects that can overload the definition
of targets
and call its original implementation either in the dependencies or via <antcall>.

What looks exiting here is that there is less chance for complex cross-references between
buildfiles. As we have envisioned <projectref> up to now, there is a lot of chance to
define interrelated buildfiles that call things on each other
all over the place. The question is does such capability will produce less legible buildfiles.

There are other issues we would have to define in order for this to work correctly, in particular
<property>
resolution. How and when properties defined in "subproject" override definitions in the project
being extended? 

So, what do you think. Are there any major problems or short commings that you can see?
At this point I am only exploring the power of this type of construct, nothing else.

Jose Alberto



Mime
View raw message