ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S Page <>
Subject current task property (like Make's $@)?
Date Tue, 05 Jun 2001 06:40:56 GMT
Is there a property that holds the current target?  In make, $@ contains the target you're
building.  "Built-in Properties" in indicates
there isn't an ant equivalent.

It would be somewhat useful to know the current target in commands within a target.  For example,

<target name="dreamweaver" depends="init" >
	<!-- "dreamweaver" below is the same as target name -->
	<mkdir dir="products/dreamweaver"/>
	<!-- ... more tasks containing the string "dreamweaver" -->

<!-- same rules as above -->
<target name="flash" depends="init" >
	<!-- "flash" below is the same as target name -->
	<mkdir dir="products/flash"/>
	<!-- ... more tasks containing the string "flash" -->

I'd like to use <mkdir dir="products/${ant.current_target}"/>  so similar tasks have
the same code.

Or am I not grokking the ant philosophy?  Should I instead write a generic task, and use antcall
to call it with different parameters?  Or should I write a custom mapper that fabricates targets
for a given file?  Or... ?  If the documentation contained snippets of build files that show
ant features working together, it would be more obvious.

Thanks indeed.
=S Page  a site engineer 

View raw message