An idea is not to reference the files instead of "including" them:
file ./includes.qa:
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
file1.qa
file2.qa
file3.qa
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
file ./includes.staging
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
file*.staging
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
file ./includes...
<property name="selected" value="qa" description="Default is doing QA"/>
<copy todir="some/dir">
<fileset dir="properties" includesfile="includes.${selected}"/>
</copy>
$ant -Dselected=qa
Jan
>-----Ursprüngliche Nachricht-----
>Von: Rez P [mailto:[email protected]]
>Gesendet: Freitag, 30. Oktober 2009 05:46
>An: Ant
>Betreff: Help With Condition Task
>
>
>Hi
>
>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,prod.uk,prod.us,prod.nz} 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 -Dext1=prod.uk 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 -Dext1=prod.uk -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.
>
>Thanks
>
>Rez
>
>_________________________________________________________________
>Windows 7: It works the way you want. Learn more.
>http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PI
D24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:102009
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]