<!--
Ant build file, mostly to avoid using Eclipse.
-->
<project name="p4polarion" default="zip" basedir=".">
<description>
P4Polarion
</description>
<property name="src" location="src"/>
<property name="bin" location="bin"/>
<property name="build" location="build"/>
<target name="init">
<mkdir dir="${bin}"/>
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init" description="compile the code">
<javac srcdir="${src}" destdir="${bin}" includeantruntime="false">
<classpath>
<pathelement path="lib/p4java-2015.2.1312871.jar"/>
<!-- must use the 1.x log4j API -->
<pathelement path="/opt/apache-log4j-1.2.17/log4j-1.2.17.jar"/>
<!-- without Eclipse, need to set the classpath the hard way... -->
<pathelement path="/opt/polarion/maven/repository/com/polarion/maven/plugins-provided/3.17.2/plugins-provided-3.17.2.jar"/>
<pathelement path="/opt/polarion/polarion/plugins/com.polarion.core.util_3.17.2/lib/validation-api-1.0.0.GA.jar"/>
<pathelement path="/opt/polarion/maven/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar"/>
<pathelement path="/opt/polarion/maven/repository/com/polarion/maven/plugins-shared/3.17.2/plugins-shared-3.17.2.jar"/>
<pathelement path="/opt/polarion/polarion/plugins/com.polarion.platform.repository_3.17.2/platform-repository.jar"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile" description="generate the jar">
<jar jarfile="platform-repository-p4.jar">
<fileset dir="META-INF"/>
<fileset file="plugin.xml"/>
<fileset dir="webapp"/>
<fileset file="lib/p4java-2015.2.1312871.jar"/>
<fileset dir="META-INF"/>
<fileset dir="META-INF"/>
</jar>
</target>
<target name="zip" depends="jar" description="produce the final zip">
<zip destfile="${build}/plugin.zip">
<zipfileset fullpath="plugins/com.perforce.polarion_3.7.3.jar" file="platform-repository-p4.jar"/>
</zip>
</target>
<target name="clean" description="clean up">
<delete>
<fileset dir="${bin}" includes="**/*.class"/>
<fileset file="platform-repository-p4.jar"/>
</delete>
</target>
</project>