ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rez P <>
Subject Help With Condition Task
Date Fri, 30 Oct 2009 04:46:03 GMT

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.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message