forked from hrs-allbsd/OpenLanguageTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.xml
309 lines (257 loc) · 9.83 KB
/
common.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<?xml version="1.0"?>
<project name="common" default="all">
<!-- the main build script loads its properties first, so these get loaded
only when building locally -->
<property file="build.local.properties"/>
<!-- fallback to common properties in project root; we do this for directories
which do not have build.local.properties
-->
<dirname property="common.basedir" file="${ant.file.common}"/>
<property file="${common.basedir}/common.properties"/>
<!-- IzPack setup -->
<taskdef name="izpack"
classpath="${izpack.home}/lib/standalone-compiler.jar"
classname="com.izforge.izpack.ant.IzPackTask"/>
<!-- default source files location -->
<path id="src.dirs">
<path location="src"/>
</path>
<!-- default pattern for compilation -->
<patternset id="src.pattern">
<include name="**/*.java"/>
</patternset>
<!-- default test source files fileset; to exclude/include any tests
not in src with different name patter than *Test.java
override this fileset in your build.local.properties
-->
<fileset id="test.src" dir="test">
<patternset refid="test.src.pattern"/>
</fileset>
<!-- default pattern for tests -->
<patternset id="test.src.pattern">
<include name="**/*Test.java"/>
</patternset>
<!-- DEPENDENCIES DEFINITIONS
The paths here are dependencies for targets. Each script that compiles
some sources needs to define path with id build.classpath which will
be used for compilation of sources
Example:
<project ...>
<path id="build.classpath">
<path refid="deps.lib1"/> //use deps.lib1 jars for compilation
<path refid="deps.junit"/> //use junit jars for compilation
</path>
</project>
-->
<!-- jars in lib/lib1 -->
<path id="deps.utilities">
<fileset dir="${common.basedir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- jars in lib/lib2 -->
<path id="deps.dtdparser">
<fileset dir="${extlib.dir}" includes="dtdparser121.jar"/>
</path>
<!-- TODO download the rest of the api jar (JWSDP) get rid of S1AS deps -->
<path id="deps.jax-rpc">
<fileset dir="${common.basedir}/utilities/iAS7/share/lib/" includes="*.jar"/>
</path>
<!-- these deps contain both versions of dependencies: for st2 and editor so subsequent
builds may seem to be working even though they are not -->
<path id="deps.common.util">
<fileset dir="${dest.dir}/" includes="tt-common.jar"/>
<fileset dir="${dest.dir}/" includes="utilities-editor.jar"/>
<fileset dir="${dest.dir}/" includes="utilities-fuzzytm.jar"/>
</path>
<path id="deps.filters">
<fileset dir="${dest.dir}/" includes="filters.jar"/>
<fileset dir="${dest.dir}/" includes="filters-editor.jar"/>
</path>
<path id="deps.formatters">
<fileset dir="${dest.dir}/" includes="formatting.jar"/>
<fileset dir="${dest.dir}/" includes="formatting-editor.jar"/>
</path>
<path id="deps.backconv">
<fileset dir="${dest.dir}/" includes="backconv.jar"/>
</path>
<path id="deps.swing-layout">
<fileset dir="${extlib.dir}/swing-layout" includes="swing-layout-*.jar"/>
</path>
<!-- jars for Saxon9HE -->
<path id="deps.saxon">
<fileset dir="${extlib.dir}/saxon" includes="saxon9he.jar"/>
</path>
<!-- jars in lib/junit -->
<path id="deps.junit">
<fileset dir="${junit.home}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- dom4j dependecies -->
<path id="deps.dom4j">
<fileset dir="${extlib.dir}" includes="dom4j-161.jar"/>
</path>
<!-- javacc dependecies -->
<path id="deps.javacc">
<fileset dir="${javacchome}" includes="*.jar"/>
</path>
<!-- common classpath; include build.dir -->
<path id="common.build.classpath">
<path refid="deps.javacc"/>
<path refid="build.classpath"/>
<pathelement location="${build.dir}"/>
</path>
<!-- TASKS DEFINITIONS -->
<!-- COMMON TARGETS -->
<!--
Initialize the build enviroment:
- create the destination directory
- timestamp
-->
<target name="init" depends="banner">
<echo>Creating destination directory: ${build.dir}</echo>
<mkdir dir="${build.dir}"/>
<mkdir dir="${dest.dir}"/>
<tstamp/>
</target>
<!--
Do all you need to before compiling
-->
<target name="pre-compile" depends="init">
<echo>pre-compile</echo>
</target>
<!--
compile sources
-->
<fileset id="x1">
<include name="**/X*.java"/>
</fileset>
<target name="compile" depends="pre-compile">
<echo>compile</echo>
<javac
target="${platform.version}"
destdir="${build.dir}"
classpathref="common.build.classpath"
fork="${compiler.fork}"
debug="${compiler.debug}"
verbose="${compiler.verbose}">
<patternset refid="src.pattern"/>
<src refid="src.dirs"/>
</javac>
</target>
<!--
make deliverables: [jwe]ar files
-->
<target name="dist" depends="compile">
<echo>dist</echo>
</target>
<!--
restore build enviroment
-->
<target name="clean">
<echo>clean</echo>
<echo>Removing build directory</echo>
<delete dir="${build.dir}"/>
<echo>Removing any JavaCC artifacts</echo>
<delete>
<fileset dir="." includes="**/*.jj" />
</delete>
</target>
<!--
print what and where is being built
-->
<target name="banner">
<echo>*******************************************</echo>
<echo>Building ${ant.project.name} in</echo>
<echo>${ant.file}</echo>
<echo>*******************************************</echo>
</target>
<path id="common.test.classpath">
<path refid="deps.junit"/>
<path refid="test.classpath"/>
<pathelement location="${build.dir}"/>
<pathelement location="${common.basedir}/external/resources"/>
</path>
<!-- unittests targets -->
<!-- test.src fileset must be to contain all JAVA! files which are tests
test.classpath must be set
-->
<target name="pre-test" >
<mkdir dir="${build.dir}/junit-reports"/>
<mkdir dir="${build.dir}/test-results"/>
</target>
<target name="test.compile" depends="compile">
<echo>compile</echo>
<ant dir="${common.basedir}/src/testtools" target="compile">
</ant>
<javac
target="${platform.version}"
destdir="${build.dir}"
classpathref="common.test.classpath"
fork="${compiler.fork}"
debug="${compiler.debug}"
verbose="${compiler.verbose}">
<patternset refid="src.pattern"/>
<src refid="test.src"/>
</javac>
</target>
<target name="test" depends="test.compile, pre-test">
<junit printsummary="yes" haltonfailure="no" dir=".">
<classpath refid="common.test.classpath"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=${test.debug.suspend},address=${test.debug.port}"/>
<!-- support for transparent directories; see TestSupport class -->
<sysproperty key="junit.output.dir" value="${test-sys-prop.junit.output.dir}"/>
<formatter type="xml"/>
<test fork="yes" todir="${build.dir}/junit-reports" name="${test.single.class}" if="do.single.test"/>
<batchtest fork="yes" todir="${build.dir}/junit-reports" unless="do.single.test">
<fileset refid="test.srcfiles"/>
</batchtest>
</junit>
<junitreport todir="${build.dir}/junit-reports">
<fileset dir="${build.dir}/junit-reports">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${build.dir}/junit-reports/html"/>
</junitreport>
</target>
<!-- run it all -->
<target name="all" depends="dist">
<echo>all</echo>
</target>
<!-- upload a nightly build to java.net -->
<!-- requires build.ant.properties to contain username/passwd details -->
<!-- properties : java.net.username == username
java.net.passwd == password
uploaded.file.name == name of file to appear on java.net
uploaded.file.dir == name of directory on java.net
path.to.file == file in build area to upload
description == description of file
-->
<path id="upload.file.class.path">
<fileset dir="${common.basedir}/external/build/javanettasks" includes="**/*.jar"/>
</path>
<!-- this does java.net uploads to allow us to do nightly builds
Username and pasword information is accessed from a file in
~/.java.net with contents similar to :
userName=timf
password=yadayada
proxyServer=proxy.acme.com
proxyPort=8080
-->
<target name="upload">
<taskdef name="javaNetUpload"
classname="org.kohsuke.jnt.ant.FileUploadTask"
classpathref="upload.file.class.path"/>
<echo>Uploading file ${path.to.file} to ${uploaded.file.dir}/${uploaded.file.name}</echo>
<javaNetUpload
projectName="open-language-tools"
toFile="${uploaded.file.dir}/${uploaded.file.name}"
fromFile="${path.to.file}"
fileDescription="${uploaded.file.description}"
overwrite="yes"
fileStatus="Draft"
/>
</target>
</project>