-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
50 lines (50 loc) · 2.5 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<project name="HTMLParser" default="jar" basedir=".">
<property file="${user.home}/.m2/maven.properties"/>
<property name="maven.build.output" value="target/classes"/>
<property name="maven.build.directory" value="target"/>
<property name="maven.build.final.name" value="HTMLParser-2.0-SNAPSHOT"/>
<property name="maven.test.reports" value="${maven.build.directory}/test-reports"/>
<property name="maven.test.output" value="target/test-classes"/>
<property name="maven.repo.local" value="${user.home}/.m2/repository"/>
<path id="build.classpath">
<fileset dir="${maven.repo.local}"/>
</path>
<target name="clean" description="Clean the output directory">
<delete dir="${maven.build.directory}"/>
</target>
<target name="compile" depends="get-deps" description="Compile the code">
<mkdir dir="${maven.build.output}"/>
<javac destdir="${maven.build.output}" excludes="**/package.html" debug="true" deprecation="true" optimize="false">
<src>
<pathelement location="src/main/java"/>
</src>
<classpath refid="build.classpath"/>
</javac>
<copy todir="${maven.build.output}">
<fileset dir="src/main/resources"/>
</copy>
</target>
<target name="jar" depends="compile,test" description="Clean the JAR">
<jar jarfile="${maven.build.directory}/${maven.build.final.name}.jar" basedir="${maven.build.output}" excludes="**/package.html"/>
</target>
<target name="compile-tests" depends="junit-present, compile" description="Compile the test code" if="junit.present">
<mkdir dir="${maven.test.output}"/>
</target>
<target name="test" depends="junit-present, compile-tests" if="junit.present" description="Run the test cases"/>
<target name="test-junit-present">
<available classname="junit.framework.Test" property="junit.present"/>
</target>
<target name="junit-present" depends="test-junit-present" unless="junit.present">
<echo>================================= WARNING ================================</echo>
<echo> Junit isn't present in your $ANT_HOME/lib directory. Tests not executed. </echo>
<echo>==========================================================================</echo>
</target>
<target name="test-offline">
<condition property="maven.mode.offline">
<equals arg1="${build.sysclasspath}" arg2="only"/>
</condition>
</target>
<target name="get-deps" depends="test-offline" description="Download all dependencies" unless="maven.mode.offline">
<mkdir dir="${maven.repo.local}"/>
</target>
</project>