forked from nzakas/props2js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
109 lines (94 loc) · 4.01 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
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="props2js" default="build.jar" basedir=".">
<target name="clean" depends="-load.properties">
<delete dir="${build.dir}" quiet="true"/>
</target>
<target name="-load.properties">
<property file="ant.properties"/>
</target>
<target name="-init" depends="-load.properties">
<mkdir dir="${build.dir}"/>
</target>
<target name="build.classes" depends="-init">
<mkdir dir="${build.dir}/classes"/>
<javac srcdir="${src.dir}"
destdir="${build.dir}/classes"
includes="**/*.java"
deprecation="off"
debug="on"
source="${class.version}"
target="${class.version}">
<classpath>
<pathelement location="${lib.dir}/${jargs.jar}"/>
<pathelement location="${lib.dir}/${gson.jar}"/>
</classpath>
</javac>
</target>
<target name="build.tests" depends="-init">
<mkdir dir="${build.dir}/testclasses"/>
<javac srcdir="${tests.dir}"
destdir="${build.dir}/testclasses"
includes="**/*.java"
deprecation="off"
debug="on"
source="${class.version}"
target="${class.version}">
<classpath>
<pathelement location="${lib.dir}/${gson.jar}"/>
<pathelement location="${lib.dir}/${jargs.jar}"/>
<pathelement location="${lib.dir}/${junit.jar}"/>
<pathelement location="${build.dir}/classes"/>
</classpath>
</javac>
<copy todir="${build.dir}/testclasses/net/nczonline/web/props2js">
<fileset dir="${tests.dir}" includes="*.png"/>
<fileset dir="${tests.dir}" includes="*.css"/>
</copy>
</target>
<target name="build.jar" depends="build.classes">
<make-jar name="${props2js.name}" jar="${props2js.jar}" main="${props2js.main}">
<jar-files>
<fileset dir="${build.dir}/classes" includes="**/*.class"/>
</jar-files>
</make-jar>
</target>
<target name="test.classes" depends="build.classes,build.tests">
<junit printsummary="yes" fork="yes" errorproperty="junit.failure" failureproperty="junit.failure" showoutput="true">
<jvmarg value="-Duser.dir=${res.dir}"/>
<!-- classpath must include all jar dependencies and classes -->
<classpath>
<pathelement location="${build.dir}/classes"/>
<pathelement location="${build.dir}/testclasses"/>
<pathelement location="${lib.dir}/${gson.jar}"/>
<pathelement location="${lib.dir}/${junit.jar}"/>
</classpath>
<!-- formatter to use for output -->
<formatter type="plain" usefile="false"/>
<!-- fully qualified classname of testsuite -->
<batchtest>
<fileset dir="${build.dir}/testclasses">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</target>
<macrodef name="make-jar">
<attribute name="jar"/>
<attribute name="main"/>
<attribute name="name"/>
<element name="jar-files"/>
<sequential>
<mkdir dir="${build.dir}/@{name}-jar"/>
<unjar src="${lib.dir}/${jargs.jar}" dest="${build.dir}/@{name}-jar"/>
<unjar src="${lib.dir}/${gson.jar}" dest="${build.dir}/@{name}-jar"/>
<copy todir="${build.dir}/@{name}-jar">
<jar-files/>
</copy>
<jar destfile="${build.dir}/@{jar}" basedir="${build.dir}/@{name}-jar">
<manifest>
<attribute name="Main-Class" value="@{main}"/>
</manifest>
</jar>
</sequential>
</macrodef>
</project>