-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
184 lines (160 loc) · 6.91 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?xml version="1.0" encoding="UTF-8"?>
<project name="O2ModemTester" default="run" basedir=".">
<description>Builds, tests, and runs the project</description>
<import file="buildconfig.xml"/>
<property name="DISTLIBRARIESFULLDIR" value="${DISTRIBUTIONDIR}/${DISTLIBRARIESDIR}"/>
<property name="JAVADOCFULLDIR" value="${DISTRIBUTIONDIR}/${JAVADOCDIR}"/>
<available property="USE_EVE"
file="${LIBRARIESDIR}/eve.jar"
/>
<available property="DOTESTS"
file="${TESTDIR}"
/>
<!--<available property="EVEVM" file="D:\Dokumenty\Programovani\JavaSE\_Eve\Eve\JavaEve.exe"/>
-->
<target name="compile">
<delete dir="${COMPILEDIR}"/>
<mkdir dir="${COMPILEDIR}"/>
<javac srcdir="${SOURCEDIR}" destdir="${COMPILEDIR}" includes="**/*.java">
<classpath>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
</classpath>
</javac>
</target>
<target name="compiledebug">
<!--<delete dir="${COMPILEDIR}"/>-->
<mkdir dir="${COMPILEDIR}"/>
<copy todir="${COMPILEDIR}">
<fileset dir="${SOURCEDIR}" includes="**/*.java"/>
</copy>
<javac fork="true" debug="true" debuglevel="lines,vars,source" srcdir="${SOURCEDIR}" destdir="${COMPILEDIR}" includes="**/*.java">
<classpath>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
</classpath>
</javac>
</target>
<target name="build" depends="builddebug,buildnodebug">
</target>
<target name="builddebug" if="DEBUGMODE">
<antcall target="builddebugforce"/>
</target>
<target name="buildnodebug" unless="DEBUGMODE">
<antcall target="compile"/>
<mkdir dir="${DISTRIBUTIONDIR}"/>
<delete dir="${DISTLIBRARIESFULLDIR}"/>
<mkdir dir="${DISTLIBRARIESFULLDIR}"/>
<copy todir="${DISTLIBRARIESFULLDIR}">
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
</copy>
<pathconvert pathsep=" " property="manifestClassPath">
<fileset dir="${DISTRIBUTIONDIR}" includes="${DISTLIBRARIESDIR}/**/*.*"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="${DISTLIBRARIESDIR}/*"/>
</chainedmapper>
</pathconvert>
<jar destfile="${DISTRIBUTIONDIR}/${JARFILENAME}.jar" basedir="${COMPILEDIR}">
<manifest>
<attribute name="Main-Class" value="${MAINCLASS}"/>
<attribute name="Class-Path" value="${manifestClassPath}"/>
</manifest>
</jar>
</target>
<target name="builddebugforce" depends="compiledebug">
<mkdir dir="${DISTRIBUTIONDIR}"/>
<mkdir dir="${DISTLIBRARIESFULLDIR}"/>
<copy todir="${DISTLIBRARIESFULLDIR}">
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
</copy>
<pathconvert pathsep=" " property="manifestClassPath">
<fileset dir="${DISTRIBUTIONDIR}" includes="${DISTLIBRARIESDIR}/**/*.*"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="${DISTLIBRARIESDIR}/*"/>
</chainedmapper>
</pathconvert>
<jar destfile="${DISTRIBUTIONDIR}/${JARFILENAME}.jar" basedir="${COMPILEDIR}">
<manifest>
<attribute name="Main-Class" value="${MAINCLASS}"/>
<attribute name="Class-Path" value="${manifestClassPath}"/>
</manifest>
</jar>
</target>
<target name="runjava" unless="USE_EVE">
<antcall target="build"/>
<java jar="${DISTRIBUTIONDIR}/${JARFILENAME}.jar"/>
</target>
<target name="runevejvm" unless="EVEVM">
<antcall target="build"/>
<echo message="Running EVE in JVM"/>
<java classname="Eve" fork="true">
<classpath>
<fileset dir="." includes="${DISTLIBRARIESFULLDIR}/**/*.jar"/>
<fileset file="${DISTRIBUTIONDIR}/${JARFILENAME}.jar"/>
</classpath>
<arg value="${MAINCLASS}"/>
</java>
</target>
<target name="runevevm" if="EVEVM">
<antcall target="compile"/>
<echo message="Running EVE in EVEVM"/>
<path id="compiledClasses">
<fileset file="${COMPILEDIR}/${MAINCLASSPATH}.class"/>
</path>
<exec executable="${EVEVM}">
<arg value="-cp"/>
<arg pathref="compiledClasses"/>
<arg value="${MAINCLASS}"/>
</exec>
</target>
<target name="runeve" if="USE_EVE">
<antcall target="runevevm"/>
<antcall target="runevejvm"/>
</target>
<target name="run" depends="runjava,runeve">
</target>
<target name="javadoc">
<mkdir dir="${DISTRIBUTIONDIR}"/>
<javadoc sourcepath="${SOURCEDIR}" destdir="${JAVADOCFULLDIR}" windowtitle="${PROJECTNAME}">
<fileset dir="${SOURCEDIR}" includes="**/*.java"/>
<classpath>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
</classpath>
</javadoc>
</target>
<target name="clean">
<delete dir="${DISTRIBUTIONDIR}"/>
<delete dir="${COMPILEDIR}"/>
</target>
<target name="test" depends="builddebugforce" if="DOTESTS">
<mkdir dir="${TESTRESULTSDIR}"/>
<mkdir dir="${COMPILETESTSDIR}"/>
<javac debug="true" debuglevel="lines,vars,source" srcdir="${TESTDIR}" destdir="${COMPILETESTSDIR}" includes="**/*.java">
<classpath>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
<fileset file="${DISTRIBUTIONDIR}/${JARFILENAME}.jar"/>
</classpath>
</javac>
<copy todir="${COMPILETESTSDIR}">
<fileset dir="${TESTDIR}" includes="**/*.java"/>
</copy>
<junit errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
<batchtest todir="${TESTRESULTSDIR}">
<fileset dir="${TESTDIR}" includes="**/*.java"/>
</batchtest>
<formatter type="plain"/>
<classpath>
<pathelement location="${COMPILETESTSDIR}"/>
<pathelement path="${COMPILEDIR}"/>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<!--<jvmarg line="${run.jvmargs}"/>-->
</junit>
</target>
</project>