Newer
Older
<project name="Worker" default="build-all" basedir=".">
<property name="common-monitoring.dir" value="../common-monitoring"/>
<property name="build.dir" value="build"/>
<property name="jar.dir" value="dist"/>
<property name="test.reports" value="reports"/>
<property name="test.src" value="test"/>
<target name="build-all" depends="clean,jar,test" description="Compiles and packages the Worker Jar">
</target>
<target name="clean" description="Removes artifacts from previous builds">
<delete dir="${build.dir}" includeemptydirs="true" />
<delete dir="${jar.dir}" includeemptydirs="true" />
<delete dir="${reports.dir}" includeemptydirs="true" />
</target>
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/explorviz-worker.jar">
<manifest>
<attribute name="Main-Class" value="explorviz.live_trace_processing.main.WorkerStarter"/>
<attribute name="Class-Path" value="."/>
<attribute name="Can-Redefine-Classes" value="true"/>
</manifest>
<fileset dir="${build.dir}" excludes="*common*.jar" />
<fileset dir="lib" includes="*LICENSE*" />
<zipfileset excludes="META-INF/*.SF" src="lib/disruptor-3.2.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${build.dir}/explorviz-common.jar"/>
<mkdir dir="${jar.dir}/META-INF"/>
<copy todir="${jar.dir}/META-INF">
<fileset dir="src/META-INF" includes="**"/>
</copy>
<target name="compile" depends="build-all-common">
<mkdir dir="${build.dir}" />
<copy todir="${build.dir}">
<fileset dir="${common-monitoring.dir}/dist"/>
</copy>
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="classpath" includeantruntime="false" debug="true" />
</target>
<target name="build-all-common" unless="isJenkins">
<ant antfile="${common-monitoring.dir}/build.xml" dir="${common-monitoring.dir}" />
</target>
<path id="classpath">
<fileset dir=".">
<include name="build/*.jar"/>
<include name="lib/*.jar"/>
</fileset>
</path>
<!-- TEST JOBS -->
<target name="test" depends="compile-tests" description="JUnit-Tests">
<mkdir dir="${test.reports}" />
<junit printsummary="yes" fork="yes" haltonfailure="no">
<classpath>
<path refid="testclasspath"/>
</classpath>
<formatter type="xml" />
<batchtest todir="${test.reports}">
<fileset dir="${test.src}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<javac srcdir="${test.src}" destdir="${build.dir}" classpathref="testclasspath" includeantruntime="false" debug="true" />
</target>
<path id="testclasspath">
<pathelement path="${build.dir}" />
<fileset dir=".">
<include name="build/*.jar"/>
<include name="lib/*.jar"/>
</fileset>