-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.xml
executable file
·126 lines (104 loc) · 4.37 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?xml version="1.0" encoding="UTF-8"?>
<project name="SketchChair" basedir="." default="build">
<!-- Hook into One-Jar project -->
<available property="one-jar.dir" file="../one-jar/build.onejar.xml" value="../one-jar"/>
<!-- Will be ignored if available above -->
<property name="one-jar.dir" location="one-jar" />
<import file="${one-jar.dir}/build.onejar.xml"/>
<property name="eclipse.jar-in-jar.dir" value="build-lib/eclipse"/>
<property name="temp.dir" value="temp" />
<path id="libraries">
<fileset dir="lib" includes="*.jar"/>
</path>
<target name="mkdirs">
<mkdir dir="${test.results.dir}" />
<mkdir dir="${test.reports.dir}"/>
<mkdir dir="classes/src"/>
<mkdir dir="classes/test"/>
<mkdir dir="classes/junit"/>
<mkdir dir="build"/>
</target>
<target name="build" depends="clean, mkdirs, compile, build.SketchChair" />
<target name="clean">
<delete dir="classes" />
</target>
<target name="distclean" depends="clean" description="clean distribution">
<delete dir="build"/>
<delete dir="test-reports"/>
<delete dir="test-results"/>
</target>
<target name="compile" depends="mkdirs">
<javac destdir="classes/src" includes="**/*.java" debug="true" verbose="true" target="1.5">
<src path="src" />
<exclude name="**/processingjs/**" />
<classpath refid="libraries" />
<classpath refid="one-jar.libraries"/>
<classpath path="${one-jar.ant.jar}"/>
</javac>
</target>
<!-- Build the One-Jar -->
<target name="build.SketchChair">
<mkdir dir="build"/>
<one-jar destfile="build/SketchChair.jar">
<manifest>
<attribute name="Main-Class" value="OneJar"/>
<attribute name="One-Jar-Main-Class" value="main.main"/>
</manifest>
<main>
<fileset dir="classes/src">
<exclude name="**/processingjs/**" />
</fileset>
</main>
<lib>
<fileset dir="lib" includes="*.jar">
<exclude name="**/processingjs/**" />
</fileset>
</lib>
<fileset dir="data"/>
<binlib>
<fileset dir="binlib" includes="**" />
</binlib>
</one-jar>
<one-jar destfile="build/test-SketchChair.jar">
<manifest>
<attribute name="Main-Class" value="cc.sketchchair.Boot"/>
<attribute name="One-Jar-Main-Class" value="cc.sketchchair.test.Test"/>
</manifest>
<zipfileset src="${one-jar.ant.jar}" includes="**/Testable.class"/>
<main>
<fileset dir="classes/test"/>
</main>
<lib>
<fileset dir="lib" includes="*.jar" />
</lib>
</one-jar>
<delete dir="${temp.dir}" />
</target>
<property name="formatter" value="xml" />
<!-- Test the distribution -->
<target name="junit.report.SketchChair" depends="build" description="JUnit test of SketchChair">
<antcall target="junit.SketchChair" />
<antcall target="junit.report"/>
</target>
<target name="junit.SketchChair" depends="build">
<echo>********** junit-SketchChair.jar</echo>
<junit fork="yes" showoutput="no" printsummary="yes">
<jvmarg value="-Done-jar.verbose=true" />
<jvmarg value="-Done-jar.jarname=${basedir}/build/test-SketchChair.jar" />
<classpath>
<fileset file="${basedir}/build/test-SketchChair.jar" />
<path refid="one-jar.libraries"/>
<path location="classes/junit" />
</classpath>
<!-- Uses Invoker to set up a JUnit test bridge -->
<test name="cc.sketchchair.test.SketchChairSuite" todir="${test.results.dir}" outfile="SketchChairSuite" />
<formatter type="${formatter}" usefile="yes" />
</junit>
</target>
<target name="run.SketchChair" depends="build" description="Run a One-Jar SketchChair">
<java fork="true" jar="build/SketchChair.jar"/>
</target>
<target name="test.SketchChair" depends="build" description="Stand-alone test a One-Jar SketchChair">
<java fork="true" jar="build/test-SketchChair.jar"/>
</target>
</project>