You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jose Alberto Fernandez <j_...@yahoo.com> on 2001/11/06 05:11:20 UTC

[ANT2] To or not to

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



Re: [ANT2] To or not to

Posted by Jose Alberto Fernandez <j_...@yahoo.com>.
From: "Peter Donald" <do...@apache.org>

> The original purpose of projectref (and import before that) was to allow one 
> project file to refer to another so that cross build file DAGs could be 
> built. The case we were given as an example was allowing catalina to refer to 
> jasper and make sure it was up to date.
> 
True. The question I am raising is whether this cross referencing and DAG style
will make for more "easy to understand" build files (as one of the requirements 
for ANT2 states) or not. Will general users, be tempted to produce spaggetti
builds because of the features set we would be offering?

I think these are valid questions to ask. Or at least to put on the table so that
we can examine any unintended consequences of the decisions that are made.

> The idea of a templating language in the core of ant has been -1'ed already 
> if you recall so something like you describe will never make it except as a 
> preprocessing stage while building project from ProjectBuilder. Even then it 
> will not be hosted at Apache.
> 
What I am putting on the table is as much a template as Java classes are templates
due to inheritance. Yes, all object oriented programming concepts can be construed 
as a form of templating. Thanks god for that or we would still be writing in COBOL.

In any case, I am aware that these ideas have been rejected in the past, but
it may be worth revisiting some of the features that such a construct may be
able to bring. Is it as eveil as some people have position it? Or would it really
simplify and make more understandable the writing of complex projects
without requiring users to learn and be confortable with XSTL or Velocity
or some other template system.

I do not claim it to be a panacea, but ...

Jose Alberto



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [ANT2] To or not to

Posted by Peter Donald <do...@apache.org>.
On Tue, 6 Nov 2001 15:11, Jose Alberto Fernandez wrote:
> 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).

err ... it was actually defined close to a year ago. You just went and 
redefined it to mean a dynamic templating system. IIRC you even thought it 
was a good idea to make build files self-modifying.

The original purpose of projectref (and import before that) was to allow one 
project file to refer to another so that cross build file DAGs could be 
built. The case we were given as an example was allowing catalina to refer to 
jasper and make sure it was up to date.

The idea of a templating language in the core of ant has been -1'ed already 
if you recall so something like you describe will never make it except as a 
preprocessing stage while building project from ProjectBuilder. Even then it 
will not be hosted at Apache.

-- 
Cheers,

Pete

----------------------------------
   "Don't play dumb with me. 
I happen to be an expert at that" 
           - Maxwell Smart
----------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>