86 lines
3.2 KiB
XML
Executable file
86 lines
3.2 KiB
XML
Executable file
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project name="Zallery" >
|
|
|
|
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
|
|
|
<!--common properties-->
|
|
<property name="gitRoot" value="." />
|
|
<property name="srcDir" value="${gitRoot}/src" />
|
|
<property name="libDir" value="${gitRoot}/lib" />
|
|
<property name="libExpDir" value="${gitRoot}/WebContent/WEB-INF/lib" />
|
|
<property name="outputRoot" value="${gitRoot}/build" />
|
|
<property name="buildDir" value="${outputRoot}/production" />
|
|
<property name="releaseDir" value="${outputRoot}/release" />
|
|
|
|
<!-- Deployment properties -->
|
|
<property name="tomcat.url" value="http://localhost:8080/manager/text" />
|
|
<property name="tomcat.user" value="" />
|
|
<property name="tomcat.pass" value="" />
|
|
<property name="catalina.home" value="/usr/share/tomcat7"/>
|
|
|
|
<!--define standard arguments for javac-->
|
|
<presetdef name="javac">
|
|
<javac includeantruntime="false" />
|
|
</presetdef>
|
|
|
|
<!-- ________________________ CLASSPATHS ________________________ -->
|
|
|
|
<!--classpath included when building-->
|
|
<path id="classpath.build">
|
|
<fileset dir="${libDir}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
<fileset dir="${libExpDir}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
<pathelement location="${buildDir}" />
|
|
</path>
|
|
|
|
<!-- ________________________ EXECUTION TARGETS ________________________ -->
|
|
|
|
|
|
|
|
<!-- ________________________ BUILD TARGETS ________________________ -->
|
|
|
|
<!--clean all build paths-->
|
|
<target name="clean">
|
|
<delete includeemptydirs="true" failonerror="false">
|
|
<fileset dir="${outputRoot}" includes="**/*" />
|
|
</delete>
|
|
</target>
|
|
|
|
<!--build product code-->
|
|
<target name="build">
|
|
<mkdir dir="${buildDir}" />
|
|
<get src="http://ci.koc.se/jenkins/job/Zutil/lastSuccessfulBuild/artifact/build/release/Zutil.jar" dest="${libExpDir}" verbose="true" usetimestamp="true"/>
|
|
<javac target="1.7" srcdir="${srcDir}" destdir="${buildDir}" debug="yes" debugLevel="lines,vars,source">
|
|
<classpath refid="classpath.build" />
|
|
<include name="**/*.java" />
|
|
</javac>
|
|
</target>
|
|
|
|
<target name="package" depends="build">
|
|
<war destfile="${releaseDir}/Zallery.war" webxml="WebContent/WEB-INF/web.xml">
|
|
<fileset dir="WebContent" />
|
|
<!-- <fileset dir="${srcDir}"/> -->
|
|
<lib dir="WebContent/WEB-INF/lib" />
|
|
<classes dir="${buildDir}" />
|
|
</war>
|
|
</target>
|
|
|
|
|
|
<import file="${catalina.home}/bin/catalina-tasks.xml" optional="true"/>
|
|
<target name="deploy" depends="package">
|
|
<deploy url="${tomcat.url}"
|
|
username="${tomcat.user}"
|
|
password="${tomcat.pass}"
|
|
path="/Zallery"
|
|
update="true"
|
|
war="file:${releaseDir}/Zallery.war" />
|
|
|
|
<!-- Workaround as tomcat deletes the webapp context file from conf dir -->
|
|
<copy file="/var/lib/tomcat7/conf/Catalina/localhost/Zallery.xml_orig"
|
|
toFile="/var/lib/tomcat7/conf/Catalina/localhost/Zallery.xml" />
|
|
</target>
|
|
|
|
</project>
|