Files
getdown/build-ivy.xml
T
Michael Bayne c3c9c66290 This should be with the previous commit which has a lovely blank commit
message.

We want to put everything into one jar file which we'll publish via Maven. So
we include our command line tools, and replace the un-proguarded jar with the
proguarded one during the packaging step.

I may look into not renaming the Getdown code so that apps (like Bang) that
link against some of it, can use this jar file. Or I'll just figure out
specifically what apps are likely to link against and not rename just that.
It's probably not a huge size increase either way.
2010-09-21 05:41:56 +00:00

73 lines
3.4 KiB
XML

<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="getdown" basedir=".">
<property name="app.name" value="getdown"/>
<!-- downloads ivy if necessary and sets everything up -->
<property name="ivy.vers" value="2.1.0-rc2" />
<property name="ivy.jar.dir" value="${user.home}/.ant/lib" />
<condition property="ivy.exists"><available file="${ivy.jar.dir}/ivy.jar"/></condition>
<target name="-download-ivy" unless="ivy.exists">
<mkdir dir="${ivy.jar.dir}"/>
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.vers}/ivy-${ivy.vers}.jar"
dest="${ivy.jar.dir}/ivy.jar" usetimestamp="true"/>
</target>
<target name="-init-ivy" depends="-download-ivy">
<path id="ivy.lib.path"><fileset dir="${ivy.jar.dir}" includes="*.jar"/></path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<ivy:cachepath pathid="compile.classpath" conf="compile" log="download-only"/>
</target>
<target name="proguard" depends="-init-ivy">
<!-- Ivy is awesome and will fill the location of all of our dependencies into properties -->
<property name="cache.dir" value="${user.home}/.ivy2/cache"/>
<ivy:artifactproperty
name="[artifact]"
value="${cache.dir}/[organization]/[module]/[type]s/[artifact]-[revision].[ext]"/>
<!-- fucking Proguard, fucking Mac OS X -->
<mkdir dir="target"/>
<copy file="${java.home}/../Classes/classes.jar" tofile="target/runtime.jar"
failonerror="false"/>
<copy file="${java.home}/lib/rt.jar" tofile="target/runtime.jar" failonerror="false"/>
<taskdef resource="proguard/ant/task.properties" classpath="${proguard}"/>
<proguard>
<injar path="target/getdown-${maven.version}.jar"/>
<injar path="lib/jRegistryKey.jar" filter="!META-INF/**"/>
<injar path="${samskivert}" filter="!META-INF/**,!**/Log4JLogger*,
!**/*.java,com/samskivert/Log.class,**/samskivert/io/**,**/samskivert/swing/**,
**/samskivert/text/**,**/samskivert/util/**"/>
<injar path="${commons-codec}" filter="!META-INF/**"/>
<outjar path="target/getdown-pro-${maven.version}.jar"/>
<libraryjar name="target/runtime.jar"/>
<libraryjar name="${ant}"/>
<keep name="com.threerings.getdown.launcher.Getdown">
<method access="static" name="main"/>
</keep>
<keep name="com.threerings.getdown.launcher.GetdownApp">
<method access="static" name="main"/>
</keep>
<keep name="com.threerings.getdown.launcher.GetdownApplet">
<constructor/><method name="*"/><field access="public" name="*"/>
</keep>
<keep name="*" extends="javax.swing.JApplet">
<constructor/><method name="*"/><field access="public" name="*"/>
</keep>
<keep name="com.threerings.getdown.launcher.GetdownAppletConfig">
<constructor/><method name="*"/><field access="public" name="*"/>
</keep>
<keep name="com.threerings.getdown.tools.DigesterTask">
<constructor/><method name="*"/><field access="public" name="*"/>
</keep>
<keep name="ca.beq.util.win32.registry.**">
<constructor/><method name="*"/><field access="public" name="*"/>
</keep>
</proguard>
<delete file="target/runtime.jar"/>
<rename src="target/getdown-pro-${maven.version}.jar"
dest="target/getdown-${maven.version}.jar" replace="true"/>
</target>
</project>