summaryrefslogtreecommitdiffstats
path: root/src/org.gluster.storage.management.gateway/build/glustermg.ant
diff options
context:
space:
mode:
Diffstat (limited to 'src/org.gluster.storage.management.gateway/build/glustermg.ant')
-rw-r--r--src/org.gluster.storage.management.gateway/build/glustermg.ant73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/org.gluster.storage.management.gateway/build/glustermg.ant b/src/org.gluster.storage.management.gateway/build/glustermg.ant
new file mode 100644
index 0000000..ac15e1b
--- /dev/null
+++ b/src/org.gluster.storage.management.gateway/build/glustermg.ant
@@ -0,0 +1,73 @@
+<project name="org.gluster.storage.management.gateway" basedir="." default="archive">
+ <property name="WEB-INF" value="${basedir}/WebContent/WEB-INF" />
+ <property name="OUT" value="${buckminster.output}/glusterserver/" />
+ <property name="WAR_FILE_NAME" value="glustermg.war" />
+ <property name="TEMP" value="${buckminster.output}/temp" />
+
+ <target name="help">
+ <echo>
+ --------------------------------------------------
+ compile - Compile
+ archive - Generate WAR file
+ --------------------------------------------------
+ </echo>
+ </target>
+
+ <target name="init">
+ <delete dir="${WEB-INF}/classes" />
+ <mkdir dir="${WEB-INF}/classes" />
+ <mkdir dir="${WEB-INF}/classes/spring" />
+ <mkdir dir="${WEB-INF}/classes/META-INF" />
+ </target>
+
+ <target name="compile" depends="init">
+ <!-- flatten=true means ignore directory structure and copy files directly to destination -->
+ <copy todir="${WEB-INF}/lib" flatten="true">
+ <fileset dir="${buckminster.output}/.." casesensitive="yes">
+ <include name="**/*.jar" />
+ </fileset>
+ </copy>
+ <copy todir="${WEB-INF}/classes/spring">
+ <fileset dir="${basedir}/src/spring" casesensitive="yes">
+ <include name="**/*.xml" />
+ </fileset>
+ </copy>
+ <copy todir="${WEB-INF}/classes/META-INF">
+ <fileset dir="${basedir}/src/META-INF" casesensitive="yes">
+ <include name="**/*.xml" />
+ </fileset>
+ </copy>
+ <copy todir="${WEB-INF}/classes">
+ <fileset dir="${basedir}/src" casesensitive="yes">
+ <include name="log4j.properties" />
+ </fileset>
+ </copy>
+ <!-- TODO: make debug option configurable in jenkins -->
+ <javac srcdir="${basedir}/src" destdir="${WEB-INF}/classes" classpathref="libs" debug="true" debuglevel="lines,vars,source"/>
+ </target>
+
+ <target name="archive" depends="compile">
+ <delete dir="${OUT}" />
+ <mkdir dir="${OUT}" />
+ <delete dir="${TEMP}" />
+ <mkdir dir="${TEMP}" />
+ <copy todir="${TEMP}">
+ <fileset dir="${basedir}/WebContent">
+ <!-- servlet-api.jar is required during compilation. At runtime, it is picked from tomcat lib directory -->
+ <exclude name="**/servlet-api.jar" />
+ </fileset>
+ </copy>
+
+ <!-- Update product version in xml files -->
+ <replace file="${TEMP}/WEB-INF/web.xml" token="@VERSION@" value="${product.version}" />
+ <replace file="${TEMP}/WEB-INF/classes/spring/gluster-server-base.xml" token="@VERSION@" value="${product.version}" />
+
+ <war destfile="${OUT}/${WAR_FILE_NAME}" basedir="${TEMP}" compress="true" webxml="${TEMP}/WEB-INF/web.xml" />
+ <delete dir="${TEMP}" />
+ </target>
+
+ <path id="libs">
+ <fileset includes="*.jar" dir="${WEB-INF}/lib" />
+ </path>
+
+</project>