-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
265 lines (184 loc) · 9.25 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
<project name='processingLibs' default='build' basedir='./'>
<description>
processingLibs. ant build file.
</description>
<!-- #### (1) where are your processing libraries located? edit location. #### -->
<property name='processing' location='/Users/michaelforrest/Documents/Processing/libraries'/>
<!-- #### (2) where are the jar files located that are required for compiling
your library such as e.g. core.jar ? edit location. #### -->
<property name='libraryClasspath' location='/Applications/Processing.app/Contents/Resources/Java'/>
<path id='library-classpath'>
<fileset dir='${libraryClasspath}'>
<!-- #### (3) add the jar files that are required for compiling. edit name.
for more include files. duplicate <include name="" /> #### -->
<include name='core.jar'/>
<!-- <include name='${processing}/MicroKontrol/library/MicroKontrol.jar'/>
<include name='libraries/rwmidi/library/rwmidi.jar'/>
<include name='libraries/opengl/library/opengl.jar'/>
<include name='libraries/opengl/library/jogl.jar'/>-->
</fileset>
</path>
<!-- #### (4) set the java version that should be used to compile your library. #### -->
<property name='javaVersion' value='1.5'/>
<!-- #### the following items are properties that will be used to make changes to
the html document template. values of properties will be
implemented ito the document automatically. #### -->
<!-- #### (5) who is the author of this library? edit value. #### -->
<property name='author' value='Michael Forrest'/>
<!-- #### (6) which copyright? edit value. #### -->
<property name='copyright' value='(c) 2008'/>
<!-- #### (7) give your library a name. edit value. #### -->
<property name='libraryName' value='Grimonium'/>
<!-- #### (8) give your library a name. edit value. #### -->
<property name='versionNumber' value='0.1.8'/>
<!-- #### (9) your contact url. edit value. #### -->
<property name='yourLink' value='http://grimaceworks.com'/>
<!-- #### (10) a comma separated list of keywords describing your library. edit value. #### -->
<property name='keywords' value='music,live performance,processing,midi,animata,ableton live,propellerhead reason'/>
<!-- #### (11) a comma separated list of platforms the library has been tested. edit value. #### -->
<property name='tested:platform' value='Mac OSX'/>
<!-- #### (12) the processing version this library has been tested with. edit value. #### -->
<property name='tested:processingVersion' value='1.0'/>
<!-- #### (13) does the library depend on any other library, dll, jnilib, etc. edit value. #### -->
<property name='tested:dependencies' value='rwmidi,microkontrol'/>
<!-- #### (14) where can the source code be found? edit value. #### -->
<property name='source:host' value='GitHub'/>
<property name='source:url' value='http://github.com/michaelforrest/grimonium'/>
<property name='source:repository' value='http://github.com/michaelforrest/grimonium'/>
<!-- no changes or adjustments required below -->
<taskdef resource='net/sf/antcontrib/antcontrib.properties'>
<classpath>
<pathelement location='./resources/code/ant-contrib-1.0b3.jar'/>
</classpath>
</taskdef>
<property name='jarFile' value='${libraryName}.jar'/>
<property name='src' location='src'/>
<property name='bin' location='bin'/>
<property name='reference' location='reference'/>
<property name='dist' location='distribution'/>
<target name='init'>
<echo>Properties initialized.
src path ${src}
bin path ${bin}
libraryClasspath ${libraryClasspath}
processing Libraries ${processing}
java version ${javaVersion}
</echo>
<echo>building library ...</echo>
<!-- Create the time stamp -->
<tstamp>
<format property='date' pattern='MM/dd/yyyy' unit='hour' offset='0'/>
</tstamp>
<mkdir dir='${dist}'/>
</target>
<!-- compile the library -->
<target name='compile' description='compile the source' depends='init'>
<javac srcdir='${src}' destdir='${bin}' source='${javaVersion}'>
<classpath>
<path refid='library-classpath'/>
</classpath>
</javac>
</target>
<!-- build the distribution of the library -->
<target name='build' description='generate the distribution' depends='compile'>
<!-- delete the previous content of the ${dist} folder -->
<delete dir='${dist}'/>
<!-- build the structure for ${dist} -->
<mkdir dir='${dist}'/>
<mkdir dir='${dist}/library'/>
<mkdir dir='${dist}/examples'/>
<mkdir dir='${dist}/reference'/>
<mkdir dir='${dist}/src'/>
<jar jarfile='${dist}/library/${jarFile}' basedir='${bin}'/>
<copy todir='${dist}/examples'>
<fileset dir='examples'/>
</copy>
<copy todir='${dist}/APIMidi'>
<fileset dir='resources/APIMidi'/>
</copy>
<copy todir='${dist}/src'>
<fileset dir='src'/>
</copy>
<!-- create the java reference of the library -->
<mkdir dir='${reference}'/>
<javadoc destdir='${reference}' doctitle='Javadocs: ${libraryName}' stylesheetfile='resources/stylesheet.css' bottom='processing library ${libraryName} by ${author}. ${copyright}' public='true' verbose='false' version='false' windowtitle='Javadocs: ${libraryName}'>
<classpath>
<path location='${libraryClasspath}/core.jar'/>
<path location='${libraryClasspath}/libraries/rwmidi/library/rwmidi.jar'/>
<path location='${libraryClasspath}/libraries/OscP5/library/OscP5.jar'/>
<path location='${processing}/MicroKontrol/library/MicroKontrol.jar'/>
<path location='libraries/rwmidi/library/rwmidi.jar'/>
<path location='libraries/opengl/library/opengl.jar'/>
<path location='libraries/opengl/library/jogl.jar'/>
</classpath>
<taglet name='ExampleTaglet' path='resources/code'/>
<fileset dir='${src}' defaultexcludes='yes'>
<!-- #### (9) add packages to be added to reference. #### -->
<include name='**/*'/>
</fileset>
</javadoc>
<copy todir='${dist}/reference'>
<fileset dir='${reference}'/>
</copy>
<!-- copy the jar file to processing's libraries -->
<mkdir dir='${processing}/${libraryName}'/>
<copy todir='${processing}/${libraryName}'>
<fileset dir='${dist}'/>
</copy>
<!-- zip the distribution of the library -->
<zip excludes='**/_DS.Store' basedir='${dist}' destfile='${dist}/${libraryName}.zip'/>
<!-- <rename src="${dist}/${libraryName}.zip" dest="${dist}/${libraryName}_${versionNumber}.zip" /> -->
<!-- organize the ${dist} folder -->
<mkdir dir='${dist}/web'/>
<move todir='${dist}/web/reference'>
<fileset dir='${dist}/reference'/>
</move>
<move todir='${dist}/web/examples'>
<fileset dir='${dist}/examples'/>
</move>
<delete dir='${dist}/library'/>
<copy todir='${dist}/web'>
<fileset dir='web'/>
</copy>
<!--
format the index.html file.
regular expressions are used to parse the web index.html file.
key words starting and ending with ## are replaced by values
defined earlier in the beginning of this build file.
-->
<replaceregexp replace='${libraryName}' flags='g' file='${dist}/web/index.html' match='##yourLibrary##'/>
<replaceregexp replace='${author}' flags='g' file='${dist}/web/index.html' match='##author##'/>
<replaceregexp replace='${versionNumber}' flags='g' file='${dist}/web/index.html' match='##versionNumber##'/>
<replaceregexp replace='${yourLink}' flags='g' file='${dist}/web/index.html' match='##yourLink##'/>
<replaceregexp replace='${date}' flags='g' file='${dist}/web/index.html' match='##date##'/>
<replaceregexp replace='${keywords}' flags='g' file='${dist}/web/index.html' match='##keywords##'/>
<replaceregexp replace='${tested:platform}' flags='g' file='${dist}/web/index.html' match='##tested:platform##'/>
<replaceregexp replace='${tested:processingVersion}' flags='g' file='${dist}/web/index.html' match='##tested:processingVersion##'/>
<replaceregexp replace='${tested:dependencies}' flags='g' file='${dist}/web/index.html' match='##tested:dependencies##'/>
<replaceregexp replace='${source:host}' flags='g' file='${dist}/web/index.html' match='##source:host##'/>
<replaceregexp replace='${source:url}' flags='g' file='${dist}/web/index.html' match='##source:url##'/>
<replaceregexp replace='${source:repository}' flags='g' file='${dist}/web/index.html' match='##source:repository##'/>
<echo>---------------------</echo>
<antcall target='processExamples'/>
<echo>---------------------</echo>
<replaceregexp replace='' flags='g' file='${dist}/web/index.html' match='##examples##'/>
<!-- finish organizating library's distribution -->
<mkdir dir='${dist}/web/download'/>
<copy todir='${dist}/web/download' file='${dist}/${libraryName}.zip'/>
<copy todir='${processing}/${libraryName}/reference'>
<fileset dir='${reference}'/>
</copy>
<!-- done, finished. -->
<echo>done, finished.</echo>
</target>
<!-- parsing the examples folder -->
<target name='processExamples'>
<dirset dir='examples' id='examples.contents' excludes='*/*'/>
<property name='examples.list' refid='examples.contents'/>
<foreach list='${examples.list}' param='exampleDir' target='addExamples' delimiter=';'>
</foreach>
</target>
<target name='addExamples'>
<replaceregexp replace='<li><a href="examples/${exampleDir}/${exampleDir}.pde">${exampleDir}</a></li> \1' flags='g' file='${dist}/web/index.html' match='(##examples##)'/>
</target>
</project>