-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
96 lines (80 loc) · 3.03 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
95
96
<?xml version="1.0" encoding="UTF-8"?>
<project name="cardpairs" default="main">
<description>
CardPairs is an open source project that represents memory game variation with cards.
</description>
<!-- set global properties for this build -->
<property name="main-class" value="com.github.savinov.cardpairs.CardPairs" />
<property name="lib.dir" value="/usr/share/java" />
<property name="src.dir" value="src" />
<property name="build.dir" value="build" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="doc.dir" value="apidocs" />
<property name="reports.dir" value="${build.dir}/reports" />
<property name="main.classes" value="${build.dir}/classes" />
<property name="test.classes" value="${build.dir}/test-classes" />
<property name="main.src" value="${src.dir}/main/java" />
<property name="test.src" value="${src.dir}/test/java" />
<property name="main.resources" value="${src.dir}/main/resources" />
<path id="classpath" />
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${doc.dir}" />
</target>
<target name="compile">
<mkdir dir="${main.classes}" />
<javac srcdir="${main.src}" destdir="${main.classes}" />
<mkdir dir="${main.classes}/resources" />
<copy todir="${main.classes}/resources">
<fileset dir="${main.resources}" />
</copy>
</target>
<target name="compile-test" depends="compile">
<mkdir dir="${test.classes}" />
<javac srcdir="${test.src}" destdir="${test.classes}">
<classpath location="${main.classes}" />
<classpath location="${lib.dir}/junit4.jar" />
</javac>
</target>
<target name="test" depends="compile, compile-test">
<mkdir dir="${reports.dir}" />
<junit printsummary="yes" haltonfailure="yes" haltonerror="yes">
<classpath location="${main.classes}" />
<classpath location="${test.classes}" />
<classpath location="${lib.dir}/junit4.jar" />
<formatter type="plain" />
<batchtest todir="${reports.dir}">
<fileset dir="${test.classes}" includes="**/*Test*" />
</batchtest>
</junit>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}" />
<jar destfile="${jar.dir}/${ant.project.name}.jar"
basedir="${main.classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}" />
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java fork="true" classname="${main-class}">
<classpath>
<path refid="classpath" />
<path location="${jar.dir}/${ant.project.name}.jar" />
</classpath>
</java>
</target>
<target name="doc">
<javadoc packagenames="com.github.savinov.cardpairs.*"
sourcepath="${main.src}"
defaultexcludes="true"
destdir="${doc.dir}"
author="true"
version="true"
use="true"
windowtitle="CardPairs API" />
</target>
<target name="clean-build" depends="clean,jar" />
<target name="main" depends="clean,run" />
</project>