<?xml version="1.0"?>
<project name="p4vcs" default="main" basedir=".">
<property file="p4vcs_${os.name}.properties"/>
<property name="out.dir" value="built"/>
<property name="deploy.dir" value="${out.dir}/deploy"/>
<property name="build.classes" value="${out.dir}/classes"/>
<property name="lib.dir" value="${deploy.dir}/lib"/>
<property name="src.dir" value="src"/>
<property name="dist.dir" value="dist"/>
<property name="p4package.dir" value="../p4package"/>
<property name="p4vcs.manifest" value="src/resources/Manifest.mf"/>
<property name="build.compiler" value="modern"/>
<property name="zip.dist" value="${dist.dir}/p4vcs.zip"/>
<property name="zip.file" value="${dist.dir}/p4vcsplugin.zip"/>
<target name="prepare">
<echo message="build.compiler = ${build.compiler}"/>
<echo message="java.home = ${java.home}"/>
<echo message="os.name = ${os.name}"/>
<echo message="together.home = ${together.home}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${deploy.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${deploy.dir}/modules/com/togethersoft/modules/p4vcs"/>
<tstamp/>
</target>
<target name="main" depends="prepare">
<javac srcdir="${src.dir}/java" destdir="${build.classes}" debug="on" deprecation="on" optimize="off">
<include name="**"/>
<classpath>
<pathelement path="${together.home}/lib/openapi.jar"/>
<pathelement path="${p4package.dir}/dist/p4.jar"/>
</classpath>
</javac>
<copy todir="${deploy.dir}/config">
<fileset dir="${src.dir}/config">
<patternset id="config.sources">
<include name="*.config*"/>
</patternset>
</fileset>
</copy>
<copy todir="${deploy.dir}/modules/com/togethersoft/modules/p4vcs">
<fileset dir="${p4package.dir}/dist">
<patternset id="p4.jars">
<include name="*.jar"/>
</patternset>
</fileset>
</copy>
<jar jarfile="${deploy.dir}/modules/com/togethersoft/modules/p4vcs/p4vcs.jar" basedir="${build.classes}" manifest="${p4vcs.manifest}"/>
</target>
<target name="deploy" depends="main">
<copydir src="${deploy.dir}/modules" dest="${together.home}"/>
</target>
<target name="clean">
<delete dir="${out.dir}/classes"/>
<delete dir="${out.dir}/deploy"/>
<delete file="${basedir}/${zip.file}"/>
<delete file="${basedir}/${zip.dist}"/>
</target>
<target name="zip" depends="main">
<zip zipfile="${zip.file}" basedir="${deploy.dir}" includes="**"/>
</target>
<target name="dist-zip" depends="zip">
<zip zipfile="${zip.dist}" basedir="${basedir}" includes="${zip.file}"/>
</target>
<target name="install" depends="zip">
<unzip src="${basedir}/${zip.file}" dest="${together.home}"/>
</target>
</project>