ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject EasyAnt <use>/<extends> vs <import>
Date Wed, 05 Nov 2008 15:59:53 GMT
Hi,

Jean-Louis or Xavier may correct me if I'm wrong.

IIUC EasyAnt solits the two use-cases found for <import> into two
logical tasks.

* you never want to override a target, you just want to reuse them:
  <use>

* you may want to override some/most targets: <extends>

Technically <extends> is what <import> is today.  <import>ed targets
that haven't been overwritten in the main build are known under two
names (prefixed and not prefixed) and the depends lists of the targets
in the <extends>-imported file are not rewritten.

Targets coming from a <use>d file only exist in their prefixed form
and their dependencies are rewritten to include prefixes as well.
I.e. you can not override the <use>d target's dependencies.

There has been some confusion from time to time on the user list as to
how you can ensure you get "your" target and not an overwritten one in
an imported file, so I think <use> is useful outside of EasyAnt as
well.

EasyAnt also adds an as-attribute to <use> where the writer of the
importing build file can control the prefix of the <use>d targets and
overrules the <use>d project's name.  This makes sense IMHO.

I'm not totally sure whether the as-attribute would make sense for
<extends> as well, EasyAnt currently silently ignores it in that case.

Changes would be required to the import task as well as to
ProjectHelper2 (the specific patch also patches AntXMLContext and
ProjectHelper, but that may turn out to be not necessary.  It's an
implementation detail).

Opinions?

Stefan

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


Mime
View raw message