Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ant Wiki" for change 
notification.

The following page has been changed by MatthewSherian:
http://wiki.apache.org/ant/AntNewbies

------------------------------------------------------------------------------
  
  '''Answer #7''' - Use the <depend> task. It will handle most of what you 
want. 
  
+ 
+ ```Question#8``` How can I perform an if-then-else construct for building 
multiple JARs/WARs within a single build.xml
+ 
+ I am attempting to merge two disparate code bases, but keep them logically 
separate at run-time. The used to live in two different app servers. I have 
refactored them, but am running into problems getting them to assign to each 
jar. I presume that I want to have a condition such as...
+ {{{
+     <target name="jar" description="Determine what fileset goes to what jar.">
+         <property name="DESTINATION_JAR" value="" />
+         <condition property="${DESTINATION_JAR}" value="reporting.jar">
+             <or>
+             </or>
+         </condition>
+         <condition property="${DESTINATION_JAR}" value="reportsvr.jar">
+             <or>
+             </or>
+         </condition>
+     </target>
+ }}}
+ 
+ In the <or></or> block I'd  like to test if a certain set of filenames exist 
within a directory and if so populate a fileset that will be built into the jar.
+ 

Reply via email to