ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Newbie question about if/then/else
Date Sat, 20 Apr 2002 03:29:28 GMT

     This is what I want to do.

Assuming I 've a properties file as follows.


     I want to supply two values in the command line parameter, like ant
-DVIEW=system_TM_1.0_integration -DCOMP=COMP_TM, and based on that I want
to do the following

<target name="jar" >
     <jar jarfile="/view/${VIEW}/${ROOT_DIR}/${COMP}/${COMP}.jar">
     <fileset dir="/view/${VIEW}/${ROOT_DIR}/${COMP}">
     <include name="**/*.class"/>

     Here, I need to copy a file from a directory using each variable defined in the properties
file. Out of these variables one variable is used in
the above target "jar"
and I  want to copy from a different path for that variable alone but the rest from the path
which has similar pattern. I want to check for the jar
file created in the "jar" target
above and copy that jar for that varibale alone and for the rest copy the files as instructed

For example, in this case,

     <copy file="${system_TM_1.0_integration}/file" todir="
${CODE_BASE}../"/> --------------> I don't want to copy here and skip this
     <copy file="${system_SHARED_1.0_integration}/file" todir="
     <copy file="${system_CF_1.0_integration}/file" todir="

One thing I thought of is using the <available> to check for the jar file
created in jar target and call some three targets to do the copy, by
skipping the one I want to. But, something tells me there might be a easy
way. Infact, I 've some 6 variables which are used in this copy business.
I guess, what I need here is something like,

     <fileavailable >
and do this for every copy task, I have.

I would appreciate any help with this. If this is not a good idea, I am
open for any suggestion. If I didn't make this clear, please let me know. I
will try to explain better.

Thanks in advance.


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

View raw message