ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy Lambert <anto...@gmx.de>
Subject Re: Adding if/unless conditions on commandline args
Date Fri, 03 May 2013 08:01:12 GMT
I wonder whether we could not add if an unless on all nested elements in the framework ?


Regards,

Antoine
On May 3, 2013, at 2:57 AM, Jean-Louis Boudart wrote:

> Hi,
> 
> It's currently difficult to make reusable script when using <exec> task or
> any other task using commandline args.
> We oftenly need some "dynamic arguments" and this can be complicated.
> 
> Therefor, i suggest to introduce if/unless conditions on comand line args :
> 
> <exec executable="git">
>   <arg value="commit"/>
>   <arg line="-a" if="${commit.all.files}"/>
>   <arg value="-m"/>
>   <arg value="${commit.message}"/>
> </exec>
> 
> I have a working implementation  with related tests and documentation.
> Commandline.Arg class now extends ProjectComponent, and expose accessors
> for if/unless condition, and rely on PropertyHelper to check conditions.
> 
> Is this sufficient ? From what i have seen, it doesn't break backward
> compatibility at least all tests are green :p.
> 
> The setProject(Project p) method should be invoked "automatically" by
> ProjectHelper isn't it ?
> 
> If ant is used in pure java and we ommited invoking setProject(Project p)
> method, it should also works as PropertyHelper seems null safe.
> 
> If there is no objection i will commit this this week end.


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


Mime
View raw message