ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: [Bug 28444] - Import: Target Handling Bug
Date Fri, 13 May 2005 10:21:15 GMT
On Fri, 13 May 2005, Phil Weighill Smith
<phil.weighill-smith@volantis.com> wrote:
> On Fri, 2005-05-13 at 09:00 +0200, Stefan Bodewig wrote:
> 
>> > But say the importER explicitly depends on bar.foo .  Isn't this
>> > still going to pollute the log in the opposite way my
>> > implementation would? :) i.e.
>> > 
>> > [foo]:
>> > 
>> > [bar.foo]:
>> 
>> Yes.  But this is less likely than having the importer depend on
>> "foo" IMHO.  So in the normal case everything would look the same
>> as today and in border cases we'll get an additional empty target.
> 
> If I understand what you're saying correctly, you don't expect
> importer build scripts to depend explicitly on the renamed imported
> targets.

No.  I fully expect importers to do so now.  And if they do they must
have overridden the target themselves, so what Matt descibes doesn't
happen.

Let's take your example and add a target.

> I'd disagree: we commonly "augment" the standard targets like this:
> 
> standard.xml:
> 
> <project name="standard">
>     <target name="compile">...</target>
      <target name="new-target"/>
> </project>
> 
> build.xml:
> 
> <project name="my-build" basedir="." default="compile">
>     <import file="${standard.dir}/standard.xml"/>
> 
>     <target name="compile" depends="standard.compile">...</target>
> </project>

Today your build.xml can't use a target that depends on
"standard.new-target" as this target doesn't exist.

Peter's approach would create a copy of "new-target" with the name
"standard.new-target".

Matt's approach would implicitly add a new target

  <target name="new-target" depends="standard.new-target"/>

to build.xml (which also renames the "new-target" in standard.xml to
"standard.new-target").  Now if you run

$ ant new-target

the output will be

,----
| standard.new-target:
| 
| new-target:
`----

and you see that new-target has been imported from standard.

My approach would adds

  <target name="standard.new-target" depends="new-target"/>

to build.xml.  "ant new-target" still looks the same as it would if we
don't add a target at all.  But now if you use

$ ant standard.new-target

the output will be

,----
| new-target:
| 
| standard.new-target:
`----

So in either case you get to see an implementation detail - the empty
target that either Matt or I wanted to introduce.  I simply claimed
that Matt's case was more likely to happen than mine since you can't
depend on "standard.new-target" or invoke "ant standard.new-target" at
all today.

Stefan

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


Mime
View raw message