awips2/edexOsgi/build.edex/deploy-common/deploy-web.xml
Bryan Kowal eca1d3d525 Issue #708 - build and developer deployment changes required for transitioning to the AWIPS II Common Baseline Repository.
Former-commit-id: 5e80c45a03 [formerly dcc5675564] [formerly 5e80c45a03 [formerly dcc5675564] [formerly c0aaac4a07 [formerly 3fb013680e1c49b1e0921ad57d59104c5ec2cbfc]]]
Former-commit-id: c0aaac4a07
Former-commit-id: a9c2cf4fae [formerly c608fc959c]
Former-commit-id: 720a152a45
2012-06-14 11:35:15 -05:00

57 lines
No EOL
2.1 KiB
XML

<!--
Ideally, we will be able to transition the web projects to Eclipse WPT
projects and then will will no longer need to manually package and
deploy a war file.
-->
<project>
<!-- =================================================================== -->
<!-- Generic macro to build and deploy any web application. -->
<!-- =================================================================== -->
<macrodef name="deploy.war">
<attribute name="web.project.dir" />
<attribute name="war.name" />
<sequential>
<property name="webapps.dir"
value="${edex.root.directory}/webapps" />
<!-- find the web "project" -->
<var name="project.dir" value="" />
<for list="${basedirectories}" param="directory"
delimiter=";" trim="true">
<sequential>
<if>
<available file="@{directory}/@{web.project.dir}"
type="dir" />
<then>
<var name="project.dir"
value="@{directory}/@{web.project.dir}" />
</then>
</if>
</sequential>
</for>
<var name="war.file" value="@{war.name}.war" />
<!-- delete old war file -->
<delete dir="${webapps.dir}/@{war.name}" />
<delete file="${webapps.dir}/${war.file}" />
<mkdir dir="${webapps.dir}" />
<!-- build and deploy new war -->
<echo message="Building and deploying war file" />
<war destfile="${webapps.dir}/${war.file}"
webxml="${project.dir}/web/WEB-INF/web.xml">
<fileset dir="${project.dir}/web"
excludes="**/WEB-INF/" />
<classes dir="${project.dir}/web/WEB-INF/classes" />
<!-- general -->
<webinf file="${project.dir}/web/WEB-INF/dwr.xml" />
</war>
<unzip src="${webapps.dir}/${war.file}"
dest="${webapps.dir}/@{war.name}" />
<delete file="${webapps.dir}/${war.file}" />
</sequential>
</macrodef>
</project>