Files
getdown/build.xml
T
Michael Bayne 6c5918b3c2 Include stub versions of the Java->JavaScript bridge interface so that we
compile properly and we'll link against the real deal at runtime.
2006-12-15 02:57:13 +00:00

130 lines
5.0 KiB
XML

<!-- build configuration -->
<project name="getdown" default="compile" basedir=".">
<!-- various basic settings -->
<property name="app.name" value="getdown"/>
<property name="src.dir" value="src/java"/>
<property name="deploy.dir" value="dist"/>
<property name="libs.dir" value="lib"/>
<import file="libs-incl.xml"/>
<!-- these are only used if we're going to sign things -->
<property file="build.properties"/>
<property file="${cert_dir}/certificate.properties"/>
<!-- used when generating javadocs -->
<property name="javadoc.dir" value="${deploy.dir}/docs"/>
<property name="doc.packages" value="com.threerings.getdown.*"/>
<property name="doc.overview" value="com/threerings/getdown/overview.html"/>
<property name="copy.pre" value="Copyright &#169; 2004"/>
<property name="copyright.holder" value="Three Rings Design, Inc."/>
<property name="copy.post" value="All Rights Reserved."/>
<!-- declare our classpath -->
<path id="clazzpath">
<pathelement location="${deploy.dir}/classes"/>
<fileset dir="${deploy.dir}/lib" includes="*.jar"/>
</path>
<!-- checks the availability of certain libraries -->
<target name="check-available" depends="prepare">
<available property="snark.present"
classname="org.klomp.snark.Snark" classpathref="clazzpath"/>
<echo message="Have Snark: ${snark.present}"/>
<condition property="build.torrent">
<isset property="snark.present"/>
</condition>
</target>
<!-- prepares the application directories -->
<target name="prepare">
<mkdir dir="${deploy.dir}/lib"/>
<mkdir dir="${deploy.dir}/classes"/>
<mkdir dir="${javadoc.dir}"/>
<!-- copy media and properties into the target directory -->
<copy todir="${deploy.dir}/classes">
<fileset dir="${src.dir}" includes="**/*.jpg"/>
<fileset dir="${src.dir}" includes="**/*.png"/>
<fileset dir="${src.dir}" includes="**/*.properties"/>
</copy>
<copy todir="${deploy.dir}/lib">
<fileset dir="lib" includes="**/*.jar"/>
</copy>
<copy todir="${deploy.dir}/lib" flatten="true">
<fileset refid="${app.name}.libs"/>
</copy>
</target>
<!-- cleans out the intermediate build files -->
<target name="clean">
<delete dir="${deploy.dir}/classes"/>
<delete dir="${deploy.dir}/docs"/>
</target>
<!-- wipes the entire build directory clean -->
<target name="distclean" depends="clean">
<delete dir="${deploy.dir}"/>
</target>
<!-- build the java class files -->
<target name="compile" depends="check-available">
<javac srcdir="${src.dir}" destdir="${deploy.dir}/classes"
debug="on" optimize="off" deprecation="on"
classpathref="clazzpath" includeAntRuntime="no"
source="1.5" target="1.5">
<exclude name="**/TorrentDownloader*" unless="build.torrent"/>
<compilerarg value="-Xlint:unchecked"/>
</javac>
</target>
<!-- build the javadoc documentation -->
<target name="javadoc" depends="prepare">
<javadoc sourcepath="${src.dir}"
packagenames="${doc.packages}"
windowtitle="${app.name} API"
doctitle="${app.name} API"
overview="${src.dir}/${doc.overview}"
bottom="${copy.pre} ${copyright.holder} ${copy.post}"
destdir="${javadoc.dir}">
<classpath refid="clazzpath"/>
<link href="http://samskivert.com/code/samskivert/samskivert/docs/api"/>
<link href="http://java.sun.com/j2se/1.5/docs/api/"/>
</javadoc>
</target>
<!-- a target for rebuilding everything -->
<target name="all" depends="clean,check-available,compile,javadoc,dist"/>
<!-- builds our distribution files -->
<target name="dist" depends="check-available,compile">
<jar destfile="${deploy.dir}/${app.name}.jar" manifest="lib/manifest.mf"
basedir="${deploy.dir}/classes" excludes="**/netscape/**"/>
</target>
<!-- optimizes, combines and removes dead code -->
<target name="proguard" depends="dist">
<taskdef resource="proguard/ant/task.properties"
classpath="${deploy.dir}/lib/proguard.jar"/>
<proguard configuration="etc/getdown.pro"/>
<taskdef name="weave" classname="com.rc.retroweaver.ant.RetroWeaverTask"
classpath="${deploy.dir}/lib/retroweaver-all-1.2.2.jar"/>
<weave inputjar="${deploy.dir}/${app.name}-pro.jar"
outputjar="${deploy.dir}/${app.name}-retro-pro.jar"/>
<!-- now combine the retroweaved jar file with the retroweaver runtime -->
<unjar src="${deploy.dir}/${app.name}-retro-pro.jar"
dest="${deploy.dir}/rptmp"/>
<unjar src="${deploy.dir}/lib/retroweaver-rt-1.2.2.jar"
dest="${deploy.dir}/rptmp"/>
<jar destfile="${deploy.dir}/${app.name}-retro-pro.jar"
manifest="lib/manifest.mf" basedir="${deploy.dir}/rptmp"/>
<delete dir="${deploy.dir}/rptmp"/>
</target>
<target name="sign" depends="proguard">
<signjar jar="${deploy.dir}/${app.name}-retro-pro.jar" lazy="true"
keystore="${cert_dir}/lib/keystore.dat" storepass="${sign.storepass}"
alias="${sign.alias}" keypass="${sign.keypass}"/>
</target>
</project>