-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
362 lines (334 loc) · 12.8 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
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="oXygen-MEI-addon" default="dist">
<!-- import default properties from file -->
<property file="build.properties"/>
<property file="local.build.properties"/>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<antcall target="git-submodule-init"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="reset">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<antcall target="clean.assets"/>
<antcall target="verovio-clean"/>
</target>
<target name="clean.assets">
<delete dir="assets/"/>
</target>
<!-- GIT -->
<target name="get-local-git-revision">
<description>Get the current git revision</description>
<exec executable="git" outputproperty="local.revision">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<echo>Local revision: ${local.revision}</echo>
<property name="revision" value="${local.revision}"/>
</target>
<target name="git-pull">
<exec executable="git" dir="submodules/kb-xml-schema/">
<arg value="pull"/>
</exec>
</target>
<target name="git-checkout-master">
<mkdir dir="${dir.path}"/>
<exec executable="git" dir="${dir.path}">
<arg value="checkout"/>
<arg value="master"/>
</exec>
</target>
<target name="git-submodule-init">
<exec executable="git" dir=".">
<arg value="submodule"/>
<arg value="init"/>
</exec>
</target>
<!-- /GIT -->
<target name="load-license">
<loadfile srcfile="LICENSES/LGPL-3.0.txt" encoding="utf-8" property="license"/>
<echo>${license}</echo>
</target>
<target name="verovio-copy-src">
<copy file="src/verovio/main.java" todir="submodules/verovio/bindings/java/example-mei/" overwrite="yes"/>
</target>
<target name="verovio-clean">
<exec dir="submodules/verovio/bindings/java/" executable="mvn">
<arg value="clean"/>
</exec>
<delete file="submodules/verovio/bindings/java/example-mei/main.class"/>
</target>
<target name="verovio-prepare" depends="verovio-copy-src, verovio-clean">
<exec dir="submodules/verovio/bindings/java/" executable="mvn">
<arg value="package"/>
</exec>
</target>
<target name="verovio-build" depends="verovio-prepare" >
<exec dir="submodules/verovio/bindings/java/" executable="mvn">
<arg value="package"/>
</exec>
</target>
<target name="verovio-compile" depends="verovio-build">
<exec dir="submodules/verovio/bindings/java/example-mei/" executable="javac">
<arg line="-classpath" />
<arg value=".:../target/VerovioToolkit-2.0.0.jar"/>
<arg value="main.java"/>
</exec>
</target>
<target name="dist" depends="clean,init,get-local-git-revision,load-license,verovio-compile">
<antcall target="frameworks.init"/>
<property name="zip" value="${name.short}_${revision}.zip"/>
<property name="dest" value="${build.dir}/${name.short}"/>
<copy todir="${dest}" flatten="false" outputencoding="utf-8">
<fileset dir="LICENSES" />
<fileset dir="src/" >
<exclude name="framework/"/>
<exclude name="plugin/"/>
<exclude name="verovio/"/>
</fileset>
<fileset dir="src/framework/"/>
<fileset dir="src/plugin/"/>
<filterset>
<filter token="NAME" value="${name}"/>
<filter token="ID" value="${name.short}"/>
<filter token="DESCRIPTION" value="${description}"/>
<filter token="VERSION" value="${version}"/>
<filter token="LICENSE" value="${license}"/>
<filter token="ZIP" value="${zip}"/>
</filterset>
</copy>
<!-- verovio -->
<copy todir="${dest}/verovio/bindings/java/" flatten="false">
<fileset dir="submodules/verovio/bindings/java/"/>
</copy>
<copy todir="${dest}/verovio/bindings/java/example-mei" flatten="false">
<fileset dir="submodules/verovio/bindings/java/target/classes/"/>
</copy>
<copy todir="${dest}/verovio/data/" flatten="false">
<fileset dir="submodules/verovio/data/"/>
</copy>
<copy todir="${dest}/verovio/src/" flatten="false">
<fileset dir="submodules/verovio/src/"/>
</copy>
<!-- mec-proceedings -->
<copy todir="${dest}/templates/mec-proceedings/">
<fileset dir="submodules/mec-proceedings/examples/"/>
<fileset dir="submodules/mec-proceedings/templates/"/>
</copy>
<copy todir="${dest}/music-encoding/mec-proceedings/schemata/">
<fileset dir="submodules/mec-proceedings/schemata/"/>
</copy>
<copy todir="${dest}/stylesheets/mec-proceedings/">
<fileset dir="submodules/mec-proceedings/stylesheets/"/>
</copy>
<!-- /mec-proceedings -->
<!-- encoding-tools -->
<copy todir="${dest}/encoding-tools/" flatten="false">
<fileset dir="submodules/encoding-tools/"/>
</copy>
<!-- /encoding-tools -->
<copy todir="${dest}" flatten="false" outputencoding="utf-8">
<fileset dir="assets"/>
</copy>
<zip basedir="${build.dir}" excludes="oXygen-MEI-addon.xml" destfile="${dist.dir}/${revision}/${zip}"/>
<copy file="${dest}/oXygen-MEI-addon.xml" todir="${dist.dir}/${revision}/"/>
</target>
<target name="v4.0.1">
<!-- create assets directories -->
<mkdir dir="assets/music-encoding/v4.0.1/schemata/"/>
<mkdir dir="assets/music-encoding/v4.0.1/guidelines/"/>
<antcall target="git-checkout-master">
<param name="dir.path">submodules/music-encoding/</param>
</antcall>
<!--<exec executable="git" dir="submodules/music-encoding/">
<arg value="checkout"/>
<arg value="master"/>
</exec>-->
<exec executable="git" dir="submodules/music-encoding/">
<arg value="pull"/>
</exec>
<exec executable="git" dir="submodules/music-encoding/">
<arg value="checkout"/>
<arg value="tags/v4.0.1"/>
</exec>
<echo>Copy schemata:</echo>
<copy verbose="true" todir="assets/music-encoding/v4.0.1/schemata/">
<fileset dir="submodules/music-encoding/schemata/"></fileset>
</copy>
</target>
<target name="v4.0.0">
<!-- create assets directories -->
<mkdir dir="assets/music-encoding/v4.0.0/schemata/"/>
<mkdir dir="assets/music-encoding/v4.0.0/guidelines/"/>
<antcall target="git-checkout-master">
<param name="dir.path">submodules/music-encoding/</param>
</antcall>
<!--<exec executable="git" dir="submodules/music-encoding/">
<arg value="checkout"/>
<arg value="master"/>
</exec>-->
<exec executable="git" dir="submodules/music-encoding/">
<arg value="pull"/>
</exec>
<exec executable="git" dir="submodules/music-encoding/">
<arg value="checkout"/>
<arg value="tags/v4.0.0"/>
</exec>
<echo>Copy schemata:</echo>
<copy verbose="true" todir="assets/music-encoding/v4.0.0/schemata/">
<fileset dir="submodules/music-encoding/schemata/"></fileset>
</copy>
</target>
<target name="v3.0.0">
<!-- create assets directories -->
<mkdir dir="temp/v3.0.0/" />
<mkdir dir="assets/music-encoding/v3.0.0/schemata/"/>
<mkdir dir="assets/music-encoding/v3.0.0/guidelines/"/>
<!-- get schemata to temp -->
<get verbose="on" src="https://github.com/music-encoding/music-encoding/releases/download/v3.0.0/MEI.3.0.0.Schemata.only.zip" dest="temp/v3.0.0/"/>
<!-- unzip schemata -->
<unzip src="temp/v3.0.0/MEI.3.0.0.Schemata.only.zip" dest="assets/music-encoding/v3.0.0/schemata/"/>
<!-- download guidelines to assets directory -->
<get verbose="on" src="https://github.com/music-encoding/music-encoding/releases/download/v3.0.0/MEI_Guidelines_v3.0.0.pdf" dest="assets/music-encoding/v3.0.0/guidelines/"/>
<!-- cleanup temp -->
<delete dir="temp/v3.0.0/"/>
</target>
<target name="v2.1.1">
<!-- create assets directories -->
<mkdir dir="temp/v2.1.1/" />
<mkdir dir="assets/music-encoding/v2.1.1/schemata/"/>
<mkdir dir="assets/music-encoding/v2.1.1/guidelines/"/>
<!-- get source to temp -->
<get verbose="on" src="https://github.com/music-encoding/music-encoding/archive/MEI2013_v2.1.1.zip" dest="temp/v2.1.1/"/>
<!-- unzip schemata -->
<unzip src="temp/v2.1.1/MEI2013_v2.1.1.zip" dest="assets/music-encoding/v2.1.1/schemata/">
<patternset>
<include name="*/schemata/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- unzip guidelines -->
<unzip src="temp/v2.1.1/MEI2013_v2.1.1.zip" dest="assets/music-encoding/v2.1.1/guidelines/">
<patternset>
<include name="*/guidelines/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- cleanup temp -->
<delete dir="temp/v2.1.1/"/>
</target>
<target name="v2.1.0">
<!-- create assets directories -->
<mkdir dir="temp/v2.1.0/" />
<mkdir dir="assets/music-encoding/v2.1.0/schemata/"/>
<mkdir dir="assets/music-encoding/v2.1.0/guidelines/"/>
<!-- get source to temp -->
<get verbose="on" src="https://github.com/music-encoding/music-encoding/archive/MEI2013_v2.1.0.zip" dest="temp/v2.1.0/"/>
<!-- unzip schemata -->
<unzip src="temp/v2.1.0/MEI2013_v2.1.0.zip" dest="assets/music-encoding/v2.1.0/schemata/">
<patternset>
<include name="*/schemata/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- unzip guidelines -->
<unzip src="temp/v2.1.0/MEI2013_v2.1.0.zip" dest="assets/music-encoding/v2.1.0/guidelines/">
<patternset>
<include name="*/guidelines/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- cleanup temp -->
<delete dir="temp/v2.1.0/"/>
</target>
<target name="v2.0.0">
<!-- create assets directories -->
<mkdir dir="temp/v2.0.0/" />
<mkdir dir="assets/music-encoding/v2.0.0/schemata/"/>
<mkdir dir="assets/music-encoding/v2.0.0/guidelines/"/>
<!-- get source to temp -->
<get verbose="on" src="https://github.com/music-encoding/music-encoding/archive/MEI2012_v2.0.0.zip" dest="temp/v2.0.0/"/>
<!-- unzip schemata -->
<unzip src="temp/v2.0.0/MEI2012_v2.0.0.zip" dest="assets/music-encoding/v2.0.0/schemata/">
<patternset>
<include name="*/schemata/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- unzip guidelines -->
<unzip src="temp/v2.0.0/MEI2012_v2.0.0.zip" dest="assets/music-encoding/v2.0.0/guidelines/">
<patternset>
<include name="*/guidelines/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- cleanup temp -->
<delete dir="temp/v2.0.0/"/>
</target>
<target name="2011-05">
<!-- create assets directories -->
<mkdir dir="temp/2011-05/" />
<mkdir dir="assets/music-encoding/2011-05/schemata/"/>
<mkdir dir="assets/music-encoding/2011-05/guidelines/"/>
<!-- get source to temp -->
<get verbose="on" src="https://github.com/music-encoding/music-encoding/archive/MEI_release_2011-05.zip" dest="temp/2011-05/"/>
<!-- unzip schemata -->
<unzip src="temp/2011-05/MEI_release_2011-05.zip" dest="assets/music-encoding/2011-05/schemata/">
<patternset>
<include name="*/schemata/*.rng"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- unzip guidelines -->
<!-- no guidelines exist in this release -->
<!--<unzip src="temp/2011-05/MEI_release_2011-05.zip" dest="assets/music-encoding/2011-05/guidelines/">
<patternset>
<include name="*/guidelines/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>-->
<!-- cleanup temp -->
<delete dir="temp/2011-05/"/>
</target>
<target name="2010-05">
<!-- create assets directories -->
<mkdir dir="temp/2010-05/" />
<mkdir dir="assets/music-encoding/2010-05/schemata/"/>
<mkdir dir="assets/music-encoding/2010-05/guidelines/"/>
<!-- get source to temp -->
<get verbose="on" src="https://github.com/music-encoding/music-encoding/archive/MEI_release_2010-05.zip" dest="temp/2010-05/"/>
<!-- unzip schemata -->
<unzip src="temp/2010-05/MEI_release_2010-05.zip" dest="assets/music-encoding/2010-05/schemata/">
<patternset>
<include name="**/rng/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- unzip guidelines -->
<!-- no guidelines exist in this release -->
<unzip src="temp/2010-05/MEI_release_2010-05.zip" dest="assets/music-encoding/2010-05/guidelines/">
<patternset>
<include name="**/documentation/*"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- cleanup temp -->
<delete dir="temp/2010-05/"/>
</target>
<target name="frameworks.init">
<antcall target="2010-05"/>
<antcall target="2011-05"/>
<antcall target="v2.0.0"/>
<antcall target="v2.1.0"/>
<antcall target="v2.1.1"/>
<antcall target="v3.0.0"/>
<antcall target="v4.0.0"/>
<antcall target="v4.0.1"/>
</target>
</project>