Skip to content

Commit

Permalink
Ant script for building and running tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikwat committed Jun 14, 2010
1 parent 56a5bb0 commit c7ac80e
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions build.xml
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jscribd" default="dist" basedir=".">
<!-- set global properties for this build -->
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="test" location="test" />

<path id="classpath.base">
<pathelement location="lib/commons-logging-1.1.1.jar" />
<pathelement location="lib/httpclient-4.0.jar" />
<pathelement location="lib/httpcore-4.0.1.jar" />
<pathelement location="lib/httpcore-nio-4.0.1.jar" />
<pathelement location="lib/httpmime-4.0.jar" />
<pathelement location="lib/apache-mime4j-0.6.jar" />
</path>
<path id="classpath.test">
<pathelement location="lib/junit-4.8.1.jar" />
<pathelement location="${build}" />
<path refid="classpath.base" />
</path>

<target name="init">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}" />
</target>

<target name="compile" depends="init" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}">
<classpath refid="classpath.base" />
</javac>
</target>

<target name="compile-tests" depends="compile" description="compile the test sources">
<!-- Compile the java code from ${test} into ${build} -->
<javac srcdir="${test}" destdir="${build}">
<classpath refid="classpath.test" />
</javac>
</target>

<target name="test" depends="compile-tests">
<junit>
<classpath refid="classpath.test" />
<formatter type="brief" usefile="false" />
<test name="com.scribd.resource.ScribdUserTest" />
<test name="com.scribd.resource.ScribdDocumentTest" />
</junit>
</target>

<target name="dist" depends="compile" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib" />

<!-- Put everything in ${build} into the jscribd-${DSTAMP}.jar file -->
<jar jarfile="${dist}/lib/jscribd-${DSTAMP}.jar" basedir="${build}" />
</target>

<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
</project>

0 comments on commit c7ac80e

Please sign in to comment.