-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
94 lines (82 loc) · 3.6 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="RoundKeeper" default="build">
<property name="one-jar.dist.dir" value="./dist"/>
<property name="one-jar.version" value="0.97"/>
<property name="one-jar.ant.jar" value="${one-jar.dist.dir}/one-jar-ant-task-${one-jar.version}.jar"/>
<taskdef name="one-jar" classname="com.simontuffs.onejar.ant.OneJarTask"
classpath="${one-jar.ant.jar}" onerror="report"/>
<target name="resolve" description="--> retrieve dependencies with ivy place them in ${basedir}/lib"
unless="resolve.init">
<delete dir="${libDir}"/>
<path id="ivy.lib.path">
<fileset dir="${basedir}/lib" includes="*.jar"/>
</path>
<ivy:settings id="basic.settings" file="./settings/ivysettings.xml"/>
<ivy:retrieve settingsRef="basic.settings"/>
<ivy:resolve/>
<property name="resolve.init" value="true"/>
</target>
<target name="init">
<property name="sourceDir" value="src"/>
<property name="testDir" value="test"/>
<property name="targetDir" value="target"/>
<property name="reportDir" value="${targetDir}/reports"/>
<property name="outputDir" value="${targetDir}/classes"/>
<property name="outputTestDir" value="${targetDir}/${testDir}"/>
<property name="libDir" value="lib"/>
<property name="jarName" value="RoundKeeper.jar"/>
<property name="roundKeeperVersion" value="1.0.0.1"/>
<property environment="localenv"/>
<property name="ivy2home" value="${localenv.IVY2_HOME}"/>
<echo>IVY2_HOME = ${ivy2home}</echo>
</target>
<target name="clean" depends="init">
<delete dir="${targetDir}"/>
</target>
<target name="prep" depends="clean, resolve">
<mkdir dir="${reportDir}"/>
<mkdir dir="${outputDir}"/>
<mkdir dir="${outputTestDir}"/>
</target>
<target name="compile" depends="prep">
<javac srcdir="${sourceDir}" destdir="${outputDir}" includeantruntime="false">
<include name="**/*.java"/>
<classpath>
<path refid="ivy.lib.path"/>
</classpath>
</javac>
<jar basedir="${outputDir}" destfile="${targetDir}/${jarName}"/>
<path id="target.compiled">
<fileset dir="${targetDir}" includes="*.jar"/>
</path>
</target>
<target name="compiletests" depends="prep, compile">
<javac srcdir="${testDir}" destdir="${outputTestDir}" includeantruntime="false">
<include name="**/*.java"/>
<classpath>
<path refid="ivy.lib.path"/>
<path refid="target.compiled"/>
</classpath>
</javac>
</target>
<target name="test" depends="compiletests">
<junit haltonerror="true" haltonfailure="true">
<batchtest haltonfailure="true" todir="${reportDir}">
<fileset dir="${outputTestDir}" includes="**/*.java"/>
</batchtest>
</junit>
</target>
<target name="build" depends="test">
<one-jar destfile="./target/RoundKeeper-${roundKeeperVersion}.jar">
<manifest>
<attribute name="Main-Class" value="com.warriorwebpros.Main"/>
<attribute name="One-Jar-Main-Class" value="com.warriorwebpros.Main"/>
</manifest>
<main>
<fileset dir="${outputDir}"/>
</main>
<lib>
<fileset dir="${libDir}" includes="*.jar" excludes="*javadoc.jar *sources.jar hamcrest* mockito*"/>
</lib>
</one-jar>
</target>
</project>