Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ant script for building and running tests.
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |