ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Properties getting unset with <import>?
Date Mon, 06 Dec 2004 15:38:36 GMT
--- Martin Cooper <mfncooper@gmail.com> wrote:
[SNIP]
> So, I guess I'm stuck with doing things the clunky
> way. Sigh.

Okay, now, let's back up.  You want to be able, as
advertised, to enhance blah blah blah tasks called
before or after... and so on.  Okay...

parent.xml:
<project name="parent">
  <target name="foo">
    <echo>foo</echo>
  </target>
  <target name="bar" depends="foo">
    <echo>bar</echo>
  </target>
</project>

child.xml:
<project name="child">
  <import file="parent.xml" />
  <target name="foo" depends="prefoo,parent.foo">
    <echo>after &lt;echo&gt;foo&lt;/echo&gt;</echo>
  </target>
  <target name="prefoo">
    <echo>before &lt;echo&gt;foo&lt;/echo&gt;</echo>
  </target>
</project>
  
There you have it.  No big deal and not that
complicated.  The key is that while extending target
foo seems like no big deal, the payoff is in the foo
dependency of target bar.  Now whenever you execute
the bar target it will do what it would have done in
the parent buildfile with foo augmented as necessary
for the child build.

HTH,
Matt


		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

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


Mime
View raw message