Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
116 lines (108 sloc) 4.1 KB
<project name="JCarder" default="dist" basedir=".">
<property name="version" value="1.0.1"/>
<property name="src" location="src"/>
<property name="3pp" location="3pp"/>
<property name="build" location="build/"/>
<property name="examples" location="examples"/>
<property name="dist" location="dist"/>
<property name="asm.jar" location="${3pp}/asm-all-2.2.2.jar"/>
<property name="easymock.jar" location="${3pp}/easymock-2.2.jar"/>
<property name="jarjar.jar" location="${3pp}/jarjar-0.7.jar"/>
<property name="jcip.jar" location="${3pp}/jcip-annotations-20070710.jar"/>
<property name="junit.jar" location="${3pp}/junit-4.1.jar"/>
<target name="check3pps">
<condition property="3pps_ok">
<and>
<available file="${asm.jar}"/>
<available file="${jarjar.jar}"/>
<available file="${easymock.jar}"/>
<available file="${jcip.jar}"/>
<available file="${junit.jar}"/>
</and>
</condition>
<fail unless="3pps_ok"
message="Please run script/download-3pps.py to download external dependencies!"/>
</target>
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile" depends="check3pps, init">
<javac srcdir="${src}"
destdir="${build}"
classpath="${asm.jar}:${jcip.jar}"
target="1.5"
debug="true"
debuglevel="lines,vars,source"/>
<javac srcdir="${examples}"
destdir="${examples}"
classpath="${examples}:${build}"
target="1.5"
debug="true"
debuglevel="lines,vars,source"/>
</target>
<target name="buildproperty">
<propertyfile comment="Build Information"
file="${src}/build.properties">
<entry key="build.timestamp"
type="date"
pattern="yyyy-MM-dd HH:mm:ss"
value="now"/>
<entry key="build.user.name" value="${user.name}"/>
<entry key="build.os.name" value="${os.name}"/>
<entry key="build.number" default="1" type="int" operation="+"/>
<entry key="build.version" value="${version}"/>
</propertyfile>
</target>
<target name="dist" depends="compile, buildproperty">
<taskdef name="jarjar"
classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${jarjar.jar}"/>
<jarjar jarfile="${dist}/jcarder.jar" manifest="${src}/MANIFEST.MF">
<fileset dir="${build}"/>
<fileset file="${src}/build.properties"/>
<zipfileset src="${jcip.jar}"/>
<zipfileset src="${asm.jar}"/>
<rule pattern="org.objectweb.**"
result="com.enea.jcarder.org.objectweb.@1"/>
</jarjar>
<jar destfile="${dist}/examples.jar" basedir="${examples}"/>
<tar destfile="${dist}/jcarder-${version}.tar.gz" compression="gzip">
<tarfileset dir="${dist}" includes="jcarder.jar, examples.jar"/>
<tarfileset dir="." includes="LICENSE.txt, README.txt, CHANGES.txt"/>
</tar>
<zip destfile="${dist}/jcarder-${version}.zip">
<zipfileset dir="${dist}" includes="jcarder.jar, examples.jar"/>
<zipfileset dir="." includes="LICENSE.txt, README.txt, CHANGES.txt"/>
</zip>
</target>
<target name="srcdist" depends="init">
<echo level="info" message="Building source zip: ${dist}/jcarder-src-${version}.zip"/>
<exec executable="hg">
<arg value="archive"/>
<arg value="-t"/>
<arg value="zip"/>
<arg value="${dist}/jcarder-src-${version}.zip"/>
</exec>
<echo level="info" message="Building source tar: ${dist}/jcarder-src-${version}.tar.gz"/>
<exec executable="hg">
<arg value="archive"/>
<arg value="-t"/>
<arg value="tgz"/>
<arg value="${dist}/jcarder-src-${version}.tar.gz"/>
</exec>
</target>
<target name="clean">
<delete dir="bin"/>
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete file="jcarder_contexts.db"/>
<delete file="jcarder_events.db"/>
<delete file="jcarder_result_0.dot"/>
<delete file="jcarder.log"/>
<delete>
<fileset dir="examples" includes="**/*.class"/>
</delete>
</target>
</project>