Permalink
Browse files

ooo-buildify

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2989 6335cc39-0255-0410-8fd6-9bcaacd3b74c
  • Loading branch information...
1 parent e02fb89 commit 697b0bfb057291b0ee93ec4af294282498ded0a6 @groves groves committed Mar 16, 2011
Showing with 55 additions and 49 deletions.
  1. +36 −0 bootstrap.xml
  2. +17 −47 build.xml
  3. +2 −2 pom.xml
View
@@ -0,0 +1,36 @@
+<project name="bootstrap" default="-extract-ooo-build">
+ <!--
+ Pulls in ooo-build from our maven repository to make our base build system available.
+ From http://ooo-maven.googlecode.com/hg/etc/bootstrap.xml
+
+ To use, copy this file into your project's directory and add
+
+ <property name="ooo-build.vers" value="1.3"/>
+ <ant antfile="bootstrap.xml"/>
+ <import file="${user.home}/.m2/ooo-build/${ooo-build.vers}/ooo-build.xml"/>
+
+ to the top level of your build.xml. Then you can depend on -init-ooo in your lowest level
+ target and pick up all the standard ooo ant tasks and macros.
+ -->
+
+ <property name="maven.dir" value="${user.home}/.m2"/>
+ <property name="ooo-build.path"
+ value="com/threerings/ooo-build/${ooo-build.vers}"/>
+ <property name="ooo-build.jar"
+ value="ooo-build-${ooo-build.vers}.jar"/>
+ <property name="ooo-build.local.dir" value="${maven.dir}/repository/${ooo-build.path}"/>
+ <property name="ooo-build.local.file" value="${ooo-build.local.dir}/${ooo-build.jar}"/>
+ <condition property="ooo-build.exists"><available file="${ooo-build.local.file}"/></condition>
+ <target name="-download-ooo-build" unless="ooo-build.exists">
+ <mkdir dir="${ooo-build.local.dir}"/>
+ <get src="http://ooo-maven.googlecode.com/hg/repository/${ooo-build.path}/${ooo-build.jar}"
+ dest="${ooo-build.local.file}" usetimestamp="true"/>
+ </target>
+
+ <property name="ooo-build.dir" value="${maven.dir}/ooo-build/${ooo-build.vers}"/>
+ <condition property="extracted.exists"><available file="${ooo-build.dir}/ooo-build.xml"/></condition>
+ <target name="-extract-ooo-build" depends="-download-ooo-build" unless="extracted.exists">
+ <mkdir dir="${ooo-build.dir}"/>
+ <unjar src="${ooo-build.local.file}" dest="${ooo-build.dir}"/>
+ </target>
+</project>
View
@@ -6,36 +6,21 @@
<property name="classes.dir" value="${deploy.dir}/classes"/>
<property name="tclasses.dir" value="${deploy.dir}/test-classes"/>
<property name="javadoc.dir" value="${deploy.dir}/docs"/>
- <property name="gwtjar.dir" value="${deploy.dir}/gwt-jar"/>
- <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>
-
- <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:pom id="pom" file="pom.xml"/>
- <artifact:dependencies pathId="classpath" pomRefId="pom"/>
- </target>
+ <property name="ooo-build.vers" value="2.1"/>
+ <ant antfile="bootstrap.xml"/>
+ <import file="${user.home}/.m2/ooo-build/${ooo-build.vers}/ooo-build.xml"/>
- <target name="-prepare" depends="-init-maven-ant">
+ <target name="-prepare" depends="-init-contrib">
<mkdir dir="${deploy.dir}"/>
+ <mavendep pom="pom.xml" scope="compile"/>
+ <mavendep pom="pom.xml" id="test" scope="test"/>
</target>
<target name="clean" description="Cleans out compiled classes and docs.">
<delete dir="${classes.dir}"/>
<delete dir="${tclasses.dir}"/>
<delete dir="${deploy.dir}/docs"/>
- <delete dir="${gwtjar.dir}"/>
</target>
<target name="distclean" description="Cleans out all build resultss.">
@@ -45,26 +30,17 @@
<target name="compile" depends="-prepare" description="Compiles main and test sources.">
<mkdir dir="${classes.dir}"/>
<copy todir="${classes.dir}"><fileset dir="src/main/resources" includes="**"/></copy>
- <javac srcdir="${src.dir}" destdir="${classes.dir}" includeAntRuntime="false"
- debug="on" optimize="${build.optimize}" source="1.5" target="1.5" encoding="utf-8">
- <classpath refid="classpath"/>
- <compilerarg value="-Xlint"/>
- <compilerarg value="-Xlint:-serial"/>
- <compilerarg value="-Xlint:-path"/>
- </javac>
+ <ooojavac srcdir="${src.dir}" destdir="${classes.dir}" version="1.5"
+ classpathref="pom.xml.path"/>
<mkdir dir="${tclasses.dir}"/>
<copy todir="${tclasses.dir}"><fileset dir="src/test/resources" includes="**"/></copy>
- <javac srcdir="${test.dir}" destdir="${tclasses.dir}" includeAntRuntime="false"
- debug="on" optimize="${build.optimize}" source="1.5" target="1.5" encoding="utf-8">
- <classpath>
- <path refid="classpath"/>
- <pathelement location="${classes.dir}"/>
- </classpath>
- <compilerarg value="-Xlint"/>
- <compilerarg value="-Xlint:-serial"/>
- <compilerarg value="-Xlint:-path"/>
- </javac>
+ <path id="built.classpath">
+ <path refid="test.path"/>
+ <pathelement location="${classes.dir}"/>
+ </path>
+ <ooojavac srcdir="${test.dir}" destdir="${tclasses.dir}" version="1.5"
+ classpathref="built.classpath"/>
</target>
<target name="javadoc" depends="-prepare" description="Builds javadocs.">
@@ -87,14 +63,14 @@
<property name="test" value=""/>
<target name="tests" depends="compile"
description="Runs unit tests. Use -Dtest=Foo to run only FooTest.">
- <taskdef name="unit" classpathref="classpath"
+ <taskdef name="unit" classpathref="test.path"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<mkdir dir="${deploy.dir}/test-reports"/>
<unit printsummary="off" haltonfailure="yes" fork="${junit.fork}">
<classpath>
<pathelement location="${classes.dir}"/>
<pathelement location="${tclasses.dir}"/>
- <path refid="classpath"/>
+ <path refid="built.classpath"/>
<fileset dir="lib/test" includes="*.jar"/>
</classpath>
<sysproperty key="test_dir" value="${tclasses.dir}"/>
@@ -117,14 +93,8 @@
<jar destfile="${deploy.dir}/${ant.project.name}.jar" basedir="${classes.dir}"/>
</target>
- <property name="maven.deploy.repo" value="file://${user.home}/.m2/repository"/>
<target name="maven-deploy" depends="dist"
description="Deploys our build artifacts to a Maven repository.">
- <jar basedir="${src.dir}" destfile="${deploy.dir}/${ant.project.name}-sources.jar"/>
- <artifact:deploy file="${deploy.dir}/${ant.project.name}.jar" uniqueVersion="false">
- <remoteRepository url="${maven.deploy.repo}"/>
- <pom refid="pom"/>
- <attach file="${deploy.dir}/${ant.project.name}-sources.jar" classifier="sources"/>
- </artifact:deploy>
+ <mavendeploy pom="pom.xml" srcdir="${src.dir}"/>
</target>
</project>
View
@@ -71,7 +71,7 @@
<exclusion><groupId>com.sun.jmx</groupId><artifactId>jmxri</artifactId></exclusion>
<exclusion><groupId>oro</groupId><artifactId>oro</artifactId></exclusion>
<exclusion><groupId>junit</groupId><artifactId>junit</artifactId></exclusion>
- </exclusions>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
@@ -82,7 +82,7 @@
<exclusions>
<exclusion><groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId></exclusion>
- </exclusions>
+ </exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>

0 comments on commit 697b0bf

Please sign in to comment.