ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Georg, Dale" <DGE...@indcon.com>
Subject Conditional Building of JAR/WAR Files
Date Tue, 24 Sep 2002 16:59:18 GMT

I have in my build file a target which builds a WAR file by jarring up the
contents of several filesets.  To speed the day-to-day development process,
though, I'd really like to be able to skip the building of the WAR file if
none of the contents have changed since the last time it was built.  I have
that working, using the targets shown below:


<target name="war-web-client" 
        depends="compile, copy-properties, check-war-files"
        unless="warfilebuild.notrequired">
   <war warfile="${dir.temp}/MyWar.war" 
        webxml="${dir.source}/xml/WEB-INF/web.xml" update="true">
      <fileset refid="fileset.docroot"/>
      <classes refid="fileset.client"/>
      <classes refid="fileset.webclasses"/>
   </war>
</target>

<target name="check-war-files">
   <uptodate property="warfilebuild.notrequired" 
           targetfile="${dir.temp}/MyWar.war">
       <srcfiles refid="fileset.docroot"/>
       <srcfiles refid="fileset.client"/>
       <srcfiles refid="fileset.webclasses"/>
   </uptodate>
</target>


This works great, but it has the disadvantage that 2 targets each have
independent references to the 3 filesets that comprise the WAR file.  If I
later had to add a fourth fileset to the WAR file, I'd need to know (and
remember!) to update both targets in the code.

Does anyone have anysuggestions as to how to improve what I'm doing above?

Thanks,
Dale



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message