|
Matt Wringe |
228dfec |
|
|
Matt Wringe |
228dfec |
|
|
Matt Wringe |
228dfec |
<project name="jline" default="jar" basedir=".">
|
|
Matt Wringe |
228dfec |
<property file="${user.home}/.m2/maven.properties"/>
|
|
Matt Wringe |
228dfec |
<property name="maven.build.output" value="target/classes"/>
|
|
Matt Wringe |
228dfec |
<property name="maven.build.directory" value="target"/>
|
|
Matt Wringe |
228dfec |
<property name="maven.build.final.name" value="jline-0.9.9"/>
|
|
Matt Wringe |
228dfec |
<property name="maven.test.reports" value="${maven.build.directory}/test-reports"/>
|
|
Matt Wringe |
228dfec |
<property name="maven.test.output" value="target/test-classes"/>
|
|
Matt Wringe |
228dfec |
<property name="maven.repo.local" value="${user.home}/.m2/repository"/>
|
|
Matt Wringe |
228dfec |
<path id="build.classpath">
|
|
Matt Wringe |
228dfec |
<fileset dir="${maven.repo.local}">
|
|
Matt Wringe |
228dfec |
<include name="junit/junit/3.8.1/junit-3.8.1.jar"/>
|
|
Matt Wringe |
228dfec |
</fileset>
|
|
Matt Wringe |
228dfec |
</path>
|
|
Matt Wringe |
228dfec |
<target name="clean" description="Clean the output directory">
|
|
Matt Wringe |
228dfec |
<delete dir="${maven.build.directory}"/>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
<target name="compile" depends="get-deps" description="Compile the code">
|
|
Matt Wringe |
228dfec |
<mkdir dir="${maven.build.output}"/>
|
|
Matt Wringe |
228dfec |
<javac destdir="${maven.build.output}" excludes="**/package.html" debug="true" deprecation="true" optimize="false">
|
|
Matt Wringe |
228dfec |
<src>
|
|
Matt Wringe |
228dfec |
<pathelement location="src/main/java"/>
|
|
Matt Wringe |
228dfec |
</src>
|
|
Matt Wringe |
228dfec |
<classpath refid="build.classpath"/>
|
|
Matt Wringe |
228dfec |
</javac>
|
|
Matt Wringe |
228dfec |
<copy todir="${maven.build.output}">
|
|
Matt Wringe |
228dfec |
<fileset dir="src/main/resources"/>
|
|
Matt Wringe |
228dfec |
</copy>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
<target name="jar" depends="compile,test" description="Clean the JAR">
|
|
Matt Wringe |
228dfec |
<jar jarfile="${maven.build.directory}/${maven.build.final.name}.jar" basedir="${maven.build.output}" excludes="**/package.html"/>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
<target name="compile-tests" depends="junit-present, compile" description="Compile the test code" if="junit.present">
|
|
Matt Wringe |
228dfec |
<mkdir dir="${maven.test.output}"/>
|
|
Matt Wringe |
228dfec |
<javac destdir="${maven.test.output}" excludes="**/package.html" debug="true" deprecation="true" optimize="false">
|
|
Matt Wringe |
228dfec |
<src>
|
|
Matt Wringe |
228dfec |
<pathelement location="src/test/java"/>
|
|
Matt Wringe |
228dfec |
</src>
|
|
Matt Wringe |
228dfec |
<classpath>
|
|
Matt Wringe |
228dfec |
<path refid="build.classpath"/>
|
|
Matt Wringe |
228dfec |
<pathelement location="${maven.build.output}"/>
|
|
Matt Wringe |
228dfec |
</classpath>
|
|
Matt Wringe |
228dfec |
</javac>
|
|
Matt Wringe |
228dfec |
<copy todir="${maven.test.output}">
|
|
Matt Wringe |
228dfec |
<fileset dir="src/test/resources"/>
|
|
Matt Wringe |
228dfec |
</copy>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
<target name="test" depends="junit-present, compile-tests" if="junit.present" description="Run the test cases">
|
|
Matt Wringe |
228dfec |
<mkdir dir="${maven.test.reports}"/>
|
|
Matt Wringe |
228dfec |
<junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir=".">
|
|
Matt Wringe |
228dfec |
<sysproperty key="basedir" value="."/>
|
|
Matt Wringe |
228dfec |
<formatter type="xml"/>
|
|
Matt Wringe |
228dfec |
<formatter type="plain" usefile="false"/>
|
|
Matt Wringe |
228dfec |
<classpath>
|
|
Matt Wringe |
228dfec |
<path refid="build.classpath"/>
|
|
Matt Wringe |
228dfec |
<pathelement location="${maven.build.output}"/>
|
|
Matt Wringe |
228dfec |
<pathelement location="${maven.test.output}"/>
|
|
Matt Wringe |
228dfec |
</classpath>
|
|
Matt Wringe |
228dfec |
<batchtest todir="${maven.test.reports}">
|
|
Matt Wringe |
228dfec |
<fileset dir="src/test/java">
|
|
Matt Wringe |
228dfec |
<include name="**/*Test.java"/>
|
|
Matt Wringe |
228dfec |
<exclude name="**/*Abstract*Test.java"/>
|
|
Matt Wringe |
228dfec |
</fileset>
|
|
Matt Wringe |
228dfec |
</batchtest>
|
|
Matt Wringe |
228dfec |
</junit>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
<target name="test-junit-present">
|
|
Matt Wringe |
228dfec |
<available classname="junit.framework.Test" property="junit.present"/>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
<target name="junit-present" depends="test-junit-present" unless="junit.present">
|
|
Matt Wringe |
228dfec |
<echo>================================= WARNING ================================</echo>
|
|
Matt Wringe |
228dfec |
<echo> Junit isn't present in your $ANT_HOME/lib directory. Tests not executed. </echo>
|
|
Matt Wringe |
228dfec |
<echo>==========================================================================</echo>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
<target name="test-offline">
|
|
Matt Wringe |
228dfec |
<condition property="maven.mode.offline">
|
|
Matt Wringe |
228dfec |
<equals arg1="${build.sysclasspath}" arg2="only"/>
|
|
Matt Wringe |
228dfec |
</condition>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
<target name="get-deps" depends="test-offline" description="Download all dependencies" unless="maven.mode.offline">
|
|
Matt Wringe |
228dfec |
<mkdir dir="${maven.repo.local}"/>
|
|
Matt Wringe |
228dfec |
<get src="http://jline.sourceforge.net/m2repo/junit/junit/3.8.1/junit-3.8.1.jar" dest="${maven.repo.local}/junit/junit/3.8.1/junit-3.8.1.jar" usetimestamp="true" ignoreerrors="true"/>
|
|
Matt Wringe |
228dfec |
<get src="http://repo1.maven.org/maven2/junit/junit/3.8.1/junit-3.8.1.jar" dest="${maven.repo.local}/junit/junit/3.8.1/junit-3.8.1.jar" usetimestamp="true" ignoreerrors="true"/>
|
|
Matt Wringe |
228dfec |
</target>
|
|
Matt Wringe |
228dfec |
</project>
|