One baby step toward making Narya obtain its depenendies from Maven.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6219 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2010-10-22 16:23:15 +00:00
parent 4b443fe148
commit fbfcd9db90
+40 -18
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" standalone="yes"?>
<!-- build configuration -->
<project name="narya" default="compile" basedir=".">
<project name="narya" default="compile" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<!-- import overriding properties -->
<property file="build.properties"/>
@@ -16,26 +16,33 @@
<import file="etc/libs-incl.xml"/>
<!-- declare our classpath business -->
<path id="classpath">
<pathelement location="${classes.dir}"/>
<fileset dir="${deploy.dir}/lib" includes="**/*.jar"/>
</path>
<property name="maven-ant.vers" value="2.1.1"/>
<property name="maven-ant.dir" value="${user.home}/.m2/ant-support"/>
<property name="maven-ant.jar" value="${maven-ant.dir}/maven-ant-tasks-${maven-ant.vers}.jar"/>
<property name="maven-ant.url"
value="http://mirrors.ibiblio.org/pub/mirrors/apache/maven/binaries"/>
<condition property="maven-ant.exists"><available file="${maven-ant.jar}"/></condition>
<target name="-download-maven-ant" unless="maven-ant.exists">
<mkdir dir="${maven-ant.dir}"/>
<get src="${maven-ant.url}/maven-ant-tasks-${maven-ant.vers}.jar"
dest="${maven-ant.jar}" usetimestamp="true"/>
</target>
<!-- checks the availability of certain libraries -->
<target name="check-available" depends="prepare">
<available property="ehcache.present" classpathref="classpath"
classname="net.sf.ehcache.CacheManager"/>
<echo level="info" message="Have EHCache: ${ehcache.present}"/>
<condition property="gwt.present"><and>
<available classname="com.google.gwt.core.client.GWT" classpathref="classpath"/>
<available classname="com.threerings.gwt.ui.Widgets" classpathref="classpath"/>
</and></condition>
<echo level="info" message="Have GWT: ${gwt.present}"/>
<target name="-init-maven-ant" depends="-download-maven-ant">
<taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant" classpath="${maven-ant.jar}"/>
<artifact:dependencies pathId="maven.classpath">
<dependency groupId="com.samskivert" artifactId="jmustache" version="1.0"/>
</artifact:dependencies>
</target>
<!-- prepares the application directories -->
<target name="prepare">
<target name="prepare" depends="-init-maven-ant">
<path id="classpath">
<path refId="maven.classpath"/>
<pathelement location="${classes.dir}"/>
<fileset dir="${deploy.dir}/lib" includes="**/*.jar"/>
</path>
<mkdir dir="${deploy.dir}"/>
<mkdir dir="${deploy.dir}/lib"/>
<mkdir dir="${classes.dir}"/>
@@ -49,6 +56,18 @@
</copy>
</target>
<!-- checks the availability of certain libraries -->
<target name="check-available" depends="prepare">
<available property="ehcache.present" classpathref="classpath"
classname="net.sf.ehcache.CacheManager"/>
<echo level="info" message="Have EHCache: ${ehcache.present}"/>
<condition property="gwt.present"><and>
<available classname="com.google.gwt.core.client.GWT" classpathref="classpath"/>
<available classname="com.threerings.gwt.ui.Widgets" classpathref="classpath"/>
</and></condition>
<echo level="info" message="Have GWT: ${gwt.present}"/>
</target>
<!-- makes sure our tools are compiled and defines the ant tasks -->
<target name="preptools" depends="prepare">
<javac srcdir="src/java" destdir="${classes.dir}" includeAntRuntime="false"
@@ -218,6 +237,9 @@
<jar destfile="${deploy.dir}/${lib.name}-tests.jar">
<fileset dir="tests/${classes.dir}" includes="com/threerings/**"/>
</jar>
<artifact:dependencies filesetId="mustache.fileset">
<dependency groupId="com.samskivert" artifactId="jmustache" version="1.0"/>
</artifact:dependencies>
<!-- build a dependencies-included version of narya-tools -->
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpathref="classpath"/>
@@ -228,7 +250,7 @@
<include name="com/threerings/util/**"/>
</fileset>
<zipfileset src="${deploy.dir}/lib/samskivert.jar"/>
<zipfileset src="${deploy.dir}/lib/jmustache-1.0.jar"/>
<zipfileset refid="mustache.fileset"/>
<rule pattern="com.samskivert.**" result="cs.@1"/>
<zipfileset src="${deploy.dir}/lib/javassist.jar"/>
<rule pattern="javassist.**" result="ja.@1"/>