ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Help With Condition Task
Date Fri, 30 Oct 2009 05:53:24 GMT
An idea is not to reference the files instead of "including" them:

file ./

file ./includes.staging

file ./includes...

<property name="selected" value="qa" description="Default is doing QA"/>
<copy todir="some/dir">
  <fileset dir="properties" includesfile="includes.${selected}"/>

$ant -Dselected=qa


>-----Urspr√ľngliche Nachricht-----
>Von: Rez P [] 
>Gesendet: Freitag, 30. Oktober 2009 05:46
>An: Ant
>Betreff: Help With Condition Task
>I need help for what I need to do and not sure how to do it.  
>I have bunch of property files with different extensions, 
>file1.{qa,staging,,,} and 
>file2.{qa,staging,prod} and file3.{qa,staging,prod}.
>I need to have the copy task copy the correct respective 
>environmental file to certain directories before I do my compile.
>Here's a sample of my copy
>target init
><copy file="properties/file1.${ext1}" todir="some/dir" />
><copy file="properties/file2.${ext1}" todir="some/dir" />
><copy file="properties/file3.${ext1}" todir="some/dir" />
>c:\project>ant -Dext1=qa init
>since all 3 files have qa & staging in common, it runs 
>successfully but not sure how I can declare ext1 to be 2 
>things at the same time, meaning "ant init" 
>will fail because the other 2 files have no such extensions 
>and adversely "ant -Dext1=prod init" will fail because not all 
>files have prod extension.
>I would like to try something like 
>c:\project>ant -Dext2=prod init
>and maybe set up a condition in the ant file in target init if 
>ext1 or ext2 equal certain value do this or do this other 
>thing.  I am reading the help page on Apache Ant and I don't 
>see any thorough or detailed examples and the page doesn't 
>really cover much of a description.
>Windows 7: It works the way you want. Learn more.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message