ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <stev...@iseran.com>
Subject Re: [PATCH] Support for default ProjectHelper to expand properties in attributes to project/target tags
Date Mon, 05 Jan 2004 13:06:35 GMT
Kenneth Olving wrote:
> Hoping that I've managed to navigate all the etiquette for posting a patch, here goes:
> 
> Change made in brief:
> The default ProjectHelper (ProjectHelper2.java) has had two lines changed so when parsing
> attributes for the project/target tags, values will be passed through Project.replacePropeties().
> 
> Rationale:
> Given a build.xml like this:
>   <project default="${foo}">
>     <target name="bar">
>       <echo message="Hello world!"/>
>     </target>
>   </project>
> it allows for running this using something like this:
>   ant -Dfoo=bar
> and get the expected result. This type of usage isn't very useful of course; my desire
for this functionality
> comes from that I'm using Ant embedded in my tool and that tool makes sure there are
appropriate properties set.
> 
> Patch (cvs diff -u ...) follows at the bottom.
> 
> Thank you,
> 

I see Jose doesnt like this, but its consistency does appeal mildly, and 
it is not as scary as adding property checking in the dependency graph.


You can of course do the same thing with a named target

<target name="redirect">
<antcall target="${foo}"/>
</target>

and have the project point to the 'redirect' target.

-steve


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


Mime
View raw message