Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

263 lines (211 sloc) 7.158 kB
<?xml version='1.0'?>
<project name="MongoDB Java Driver" default="compile" basedir=".">
<property name="version" value="2.6.1"/>
<property name="targetdir" location="target"/>
<property name="testdir" location="${targetdir}/test"/>
<dirname property="javabase" file="${java.home}"/>
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="conf" />
<pathelement path="build/main" />
<pathelement path="build/test" />
<pathelement path="${javabase}/lib/tools.jar" />
</path>
<target name="init">
<mkdir dir="build" />
<mkdir dir="build/main" />
<mkdir dir="build/test" />
<mkdir dir="build/util" />
<mkdir dir="logs" />
<mkdir dir="${testdir}" />
</target>
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile" depends="init">
<javac srcdir="src/main"
destdir="build/main"
optimize="off"
deprecation="off"
source="1.5"
target="1.5"
encoding="ISO-8859-1"
memoryMaximumSize="256M"
fork="true"
debug="on"
includeantruntime="false">
<compilerarg value="-Xlint:all,-fallthrough"/>
<classpath refid="classpath"/>
</javac>
<javac srcdir="src/test"
destdir="build/test"
optimize="off"
deprecation="off"
source="1.5"
encoding="ISO-8859-1"
fork="true"
debug="on"
includeantruntime="false">
<classpath refid="classpath"/>
<compilerarg value="-Xlint:all,-fallthrough"/>
</javac>
</target>
<target name="utilcompile" depends="compile">
<javac srcdir="src/util"
destdir="build/util"
optimize="off"
deprecation="off"
source="1.5"
target="1.5"
encoding="ISO-8859-1"
memoryMaximumSize="256M"
fork="true"
debug="on"
includeantruntime="false">
<classpath refid="classpath"/>
<compilerarg value="-Xlint:all,-fallthrough"/>
</javac>
</target>
<target name="jar" depends="compile" description="Create driver jar">
<exec executable="git" output="build/main/git-hash">
<arg value="log" />
<arg value="--pretty=format:%H" />
<arg value="-1" />
</exec>
<jar jarfile="mongo.jar" manifest="src/main/META-INF/MANIFEST.MF" >
<fileset dir="build/main" />
</jar>
<jar jarfile="bson.jar" >
<fileset dir="build/main" >
<not>
<filename name="com/"/>
</not>
</fileset>
</jar>
</target>
<target name="javadocs" depends="compile,utilcompile" description="Generate API docs">
<delete dir="docs/"/>
<javadoc packagenames="com.mongodb,com.mongodb.gridfs,com.mongodb.util,org.bson,org.bson.types,org.bson.io,org.bson.util"
sourcepath="src/main/"
defaultexcludes="yes"
destdir="docs/${version}"
author="true"
version="true"
source="1.5"
use="true"
access="protected"
>
<link href="http://download.oracle.com/javase/1.5.0/docs/api/" />
<classpath refid="classpath"/>
<taglet name="ApiToolsTaglet" path="build/util" />
</javadoc>
</target>
<target name="alljars" depends="jar, javadocs" description="build jar, source jar, javadoc jar">
<jar jarfile="mongo-sources.jar" >
<fileset dir="src/main" />
</jar>
<jar jarfile="mongo-javadoc.jar" >
<fileset dir="docs/${version}" />
</jar>
<jar jarfile="bson-sources.jar" >
<fileset dir="src/main" />
</jar>
<jar jarfile="bson-javadoc.jar" >
<fileset dir="docs/${version}" />
</jar>
</target>
<target name="rebuild" depends="clean, compile"/>
<!-- - - - - - - - - - - - - - - - - - - - - - -->
<!-- test targets -->
<!-- - - - - - - - - - - - - - - - - - - - - - -->
<taskdef name="testng" classpathref="classpath" classname="org.testng.TestNGAntTask" />
<target name="test" depends="compile">
<testng classpathref="classpath" outputdir="${testdir}" listeners="com.mongodb.util.TestNGListener" haltonfailure="true" >
<jvmarg value="-Xmx512M" />
<xmlfileset dir="." includes="testng.xml"/>
</testng>
</target>
<target name="test-single" depends="compile">
<condition property="propsSpecified">
<and>
<isset property="class.name" />
</and>
</condition>
<fail unless="propsSpecified" message="class.name roperty not specified."/>
<copy todir="build/test" file="testng-single.xml" overwrite="true">
<filterset>
<filter token="CLASS" value="${class.name}"/>
</filterset>
</copy>
<testng classpathref="classpath" outputdir="${testdir}" haltonfailure="true" verbose="1">
<jvmarg value="-Xmx512M" />
<xmlfileset dir="build/test" includes="testng-single.xml"/>
</testng>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - -->
<!-- misc targets -->
<!-- - - - - - - - - - - - - - - - - - - - - - -->
<target name="examples" depends="compile">
<javac srcdir="examples"
destdir="build/test"
optimize="off"
deprecation="off"
source="1.5"
encoding="ISO-8859-1"
debug="on"
includeantruntime="false">
<classpath refid="classpath"/>
</javac>
<java classname="QuickTour" >
<classpath refid="classpath"/>
</java>
<java classname="QuickTourAdmin" >
<classpath refid="classpath"/>
</java>
</target>
<target name="readoplog" depends="compile">
<javac srcdir="examples"
destdir="build/test"
optimize="off"
deprecation="off"
source="1.5"
encoding="ISO-8859-1"
debug="on"
includeantruntime="false">
<classpath refid="classpath"/>
</javac>
<java classname="examples.ReadOplog" fork="true">
<classpath refid="classpath"/>
</java>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - -->
<!-- reporting targets -->
<!-- - - - - - - - - - - - - - - - - - - - - - -->
<target name="junit-reports" depends="test">
<junitreport todir="${testdir}">
<fileset dir="${testdir}">
<include name="*/*.xml"/>
</fileset>
<report format="noframes" todir="${testdir}"/>
</junitreport>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - -->
<!-- publish targets -->
<!-- - - - - - - - - - - - - - - - - - - - - - -->
<target name="publish">
<exec dir="." executable="python">
<arg value="mavenPush.py"/>
<arg value="${version}"/>
<arg value="/ebs/maven/"/>
</exec>
</target>
<target name="publish-local">
<exec dir="." executable="python">
<arg value="mavenPush.py"/>
<arg value="${version}"/>
<arg value="~/.m2/repository/"/>
</exec>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.