I'm trying to add an exclusion list to my ant build script. I have a property (it is called build.exclusions) which looks like this:
build.excludes = MyApp, AnotherApp
My build script IFame if I have the following:
for list <$ {appsList} "delimiter =" "trim =" true "param =" currentApp "maintenance =" yes "& gt; ; & Lt; sequential & gt; if & gt; & lt;! - Check that my existing build item is in the build.excludes list - & gt; & lt; then & gt; & lt ;! - a project Is produced here -> gt; & gt; then & gt; & lt; / if & gt; & lt; / sequential & gt; Lt; / For & gt;
The only way I can think of doing this is to have a loop for the recurrence of my creation. (But I do not know where to put it for loop ... maybe in macro?).
Thanks!
EDIT: Ant 1.6.5 and not upgrade
It looks like you're using to work
If
supports elements similar to ant function, which is long enough in version 1.6.5.
Here's an example:
& lt; Property Name = "build.excludes" value = "MyApp, AnotherApp" /> & Lt; Property Name = "appsList" value = "MyApp, ExtraApp" /> & Lt; List = "$ {appsList}" seamankita = "," trim = "true" param = "current app" = "yes" & gt; & Lt; Sequential & gt; & Lt; Echo Message = "Checking @ {currentApp}" /> & Lt; If & gt; & Lt; & Gt; No; & Lt; String = ", $ {build.excludes}," substring = ", @ {currentApp}," /> Are included; & Lt; Not / & gt; & Lt; Then & gt; & Lt; Echo message = "building @ {currentApp}" /> & Lt; / Then & gt; & Lt; Rest & gt; & Lt; Echo message = "building not @ {currentApp} - deprecated" /> & Lt; / Left & gt; & Lt; / If & gt; & Lt; / Sequential & gt; & Lt; For / & gt; [Echo] Checking MyApp [echo] No MyApp Build - Excluded [Echo] Checking ExtraApp [echo] Building ExtraAp
< / Div>
Comments
Post a Comment