-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.xml
More file actions
77 lines (63 loc) · 2.48 KB
/
build.xml
File metadata and controls
77 lines (63 loc) · 2.48 KB
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
<project name="OrganicObject" default="test">
<!-- Define customized constant values -->
<property name="jar" value="PKG.jar"/>
<property name="test_target" value="PKG.AllUnitTestSuite"/>
<!-- Define constant values -->
<property name="src.dir" value="src"/>
<property name="src_main.dir" value="${src.dir}/main"/>
<property name="src_test.dir" value="${src.dir}/test"/>
<property name="build.dir" value="build"/>
<property name="build_main.dir" value="${build.dir}/main"/>
<property name="build_test.dir" value="${build.dir}/test"/>
<property name="build_lib.dir" value="${build.dir}/lib"/>
<property name="lib.dir" value="lib"/>
<!-- Setup classpath for all libs -->
<path id="classpath">
<pathelement location="${build_main.dir}"/>
<pathelement location="${build_test.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<echo message="${ant.version}"/>
<!-- Prepare directories -->
<target name="init">
<mkdir dir="${build_main.dir}"/>
</target>
<target name="test_init">
<mkdir dir="${build_test.dir}"/>
</target>
<!-- Compile -->
<target name="compile" depends="init">
<javac srcdir="${src_main.dir}" destdir="${build_main.dir}" classpathref="classpath" encoding="utf-8"/>
</target>
<target name="compile_test" depends="test_init, compile">
<javac srcdir="${src_test.dir}" destdir="${build_test.dir}" classpathref="classpath" encoding="utf-8"/>
</target>
<!-- Test -->
<target name="test_package" depends="compile_test">
<junit fork="yes" haltonfailure="yes" printsummary="yes">
<test name="${test_target}"/>
<formatter type="plain" usefile="false"/>
<classpath refid="classpath"/>
<assertions>
<enable/>
</assertions>
</junit>
</target>
<target name="test" depends="test_package"/>
<!-- Clean bin/ -->
<target name="clean_bin">
<delete dir="${build_main.dir}"/>
</target>
<target name="clean_test">
<delete dir="${build_test.dir}"/>
</target>
<target name="clean_lib">
<delete dir="${build_lib.dir}"/>
</target>
<target name="clean" depends="clean_bin, clean_test, clean_lib"/>
<!-- Build jar -->
<target name="jar" depends="compile">
<mkdir dir="${build_lib.dir}"/>
<jar destfile="${build_lib.dir}/${jar}" basedir="${build_main.dir}"/>
</target>
</project>