This repository has been archived by the owner on Apr 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 251
/
release.xml
435 lines (374 loc) · 19.5 KB
/
release.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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
<project name="weka-release" default="release_base_zip_no_junit" basedir=".">
<!--
===========================================================================
Ant build file for creating weka release distributions. Make sure that
last-release.props contains the date of the last release of this branch
of Weka (so that the changelog is correct).
Use ./weka/build.xml for tasks related to compiling weka and making the
core weka.jar executable jar file.
Type ant -projecthelp for targets and descriptions.
$Revision$
===========================================================================
-->
<!-- set global properties for this build -->
<property name="temp" value="temp"/>
<property name="weka" value="weka"/>
<property name="wekadocs" value="wekadocs"/>
<property name="wekaexamples" value="wekaexamples"/>
<property name="dist" value="dist"/>
<property name="os" value="osx"/>
<property name="makensis" value="makensis"/>
<property name="osx_jre_vendor" value="apple"/>
<property environment="env" />
<!-- load the last release date -->
<property file="last-release.props"/>
<!-- define the latex task -->
<taskdef name="latex" classname="de.dokutransdata.antlatex.LaTeX"/>
<!-- Define the bundleapp task. Java Application Bundler (http://java.net/projects/appbundler) makes Mac OS application
bundles for Java 1.7 or higher (jarbundler does not work for Java 1.7). This requires Oracle Java 1.7 or
higher at build time too - uncomment this taskdef if building a Mac app for Java 1.7 -->
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask"/>
<target name="init_all" depends="requirements_instructions">
<!-- Create the time stamp and various dirs -->
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd"/>
</tstamp>
<!-- Remove packages that have no test classes -->
<delete dir="packages/internal/WekaExcel"/>
<delete dir="packages/internal/WekaODF"/>
<!-- Something in the lib dir of scatterPlot3D makes the GOE barf when running the tests -->
<delete dir="packages/external/scatterPlot3D"/>
<mkdir dir="${temp}/weka-${release}"/>
<mkdir dir="${temp}/weka-${release}/changelogs"/>
<mkdir dir="${temp}/weka-${release}/data"/>
<mkdir dir="${temp}/weka-${release}/doc"/>
<mkdir dir="${dist}"/>
</target>
<target name="requirements_instructions">
<echo message="NOTE: THIS BUILD FILE IS FOR CREATING WEKA RELEASE DISTRIBUTIONS. USE THE build.xml IN ./weka FOR TASKS RELATED TO COMPILING WEKA."/>
<echo message="This build file should be run from a clean checkout (and not from a working copy). Furthermore, there should be no packages installed." />
<echo message="In order to make a complete set of release artifacts for Weka, this build script requires the following"/>
<echo message="1) Additional jars to be installed in Apache Ant's lib directory:"/>
<echo message="nsvnkit.jar"/>
<echo message="svnkit-cli.jar"/>
<echo message="ant_latex.jar (http://www.dokutransdata.de/ant_latex/)"/>
<echo message="jarbundler.jar (Mac app for Apple Java 1.6)"/>
<echo message="xercesImpl.jar"/>
<echo message="appbundler (Mac app for Oracle Java 1.7 or higher. http://java.net/projects/appbundler/)"/>
<echo message=""/>
<echo message="2) To create windows installers the makensis utility from NSIS is needed. Under Linux (Ubuntu), this can be installed by typing sudo apt-get install nsis. For instructions on how to build this for Mac OS X run the nsis_osx_howto target"/>
<echo message="3) Building Mac application bundles depends on the target JRE. For JRE 1.6, jarbundler is used. For Oracle JRE >= 1.7, jarbundler does not work and appbundler must be used. Appbundler *requires* Java >= 1.7, so the build script must run under >= 1.7 in this case."/>
<echo message="Under Mac OS X, hdiutil is used to create a compressed dmg file. Under Linux, genisoimage (already installed in Ubuntu) is used to first create a dmg and then libdmg (http://shanemcc.co.uk/libdmg/) is used to produce a compressed dmg file from the uncompressed one"/>
<echo message="LaTeX is required for building Weka's documentation. Additionally the wrapfig.sty style is needed if not already insalled"/>
</target>
<target name="nsis_osx_howto">
<echo message="To build makensis for OS X:"/>
<echo message="1) Download and install scons: http://www.scons.org/"/>
<echo message="2) Download pre-compiled (Windows) NSIS v2.46 (zip archive) from sourceforge and unzip somewhere"/>
<echo message="3) Check out NSIS 2.46 tag from subversion: https://nsis.svn.sourceforge.net/svnroot/nsis/NSIS/tags/v246"/>
<echo message="4) Execute the following from the root directory of the NSIS 2.46 checked out from subversion: scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=[path to pre-compiled nsis 2.46] install-compiler"/>
<echo message="5) OS X executable version of makensis will be placed in the pre-compiled nsis 2.46 root directory"/>
</target>
<target name="set_version">
<echo message="Setting version in weka/core/version.txt to ${release}"/>
<ant antfile="build.xml" dir="${weka}" target="set_version" inheritall="false">
<property name="release" value="${release}"/>
</ant>
</target>
<target name="run_tests_all" depends="clean, init_all">
<echo message="Running unit tests..."/>
<ant antfile="build.xml" dir="${weka}" target="run_tests_all" inheritall="false"/>
</target>
<target name="weka-exe" depends="init_all, set_version">
<echo message="Building weka.jar executable jar file..."/>
<ant antfile="build.xml" dir="${weka}" target="clean" inheritall="false"/>
<ant antfile="build.xml" dir="${weka}" target="exejar" inheritall="false"/>
</target>
<target name="remote-engine" depends="weka-exe">
<echo message="Building remote engine jar..."/>
<ant antfile="build.xml" dir="${weka}" target="remotejar" inheritall="false"/>
</target>
<target name="weka-examples" depends="weka-exe">
<echo message="Building weka examples..."/>
<ant antfile="build.xml" dir="${wekaexamples}" target="clean" inheritall="false"/>
<ant antfile="build.xml" dir="${wekaexamples}" inheritall="false">
<property name="java.class.path" value="../${weka}/build/classes"/>
</ant>
</target>
<target name="weka-src" depends="init_all">
<echo message="Building weka.jar src jar file..."/>
<ant antfile="build.xml" dir="${weka}" target="srcjar" inheritall="false"/>
</target>
<target name="javadocs" depends="weka-exe" description="Create the javadocs">
<echo message="Generating java docs for weka..."/>
<ant antfile="build.xml" dir="${weka}" target="docs" inheritall="false"/>
</target>
<!-- changelog will need -DstartDate property -->
<target name="changelog" depends="init_all" description="Create a changelog for Weka development-3-7. Creates a changelog with changes from the date in last-release-props to today">
<echo message="Creating a changelog for {${lastReleaseDate}}:{${TODAY}}"/>
<ant antfile="build.xml" dir="${weka}" target="changelog" inheritall="false">
<property name="date_range" value="{${lastReleaseDate}}:{${TODAY}}"/>
<property name="release" value="${release}"/>
<property name="weka_branch" value="trunk"/>
</ant>
</target>
<target name="packages_changelog" depends="init_all" description="Create a changelog for Weka development-3-7. Creates a changelog with changes from the date in last-release-props to today">
<echo message="Creating packages changelog for {${lastReleaseDate}}:{${TODAY}}"/>
<ant antfile="build.xml" dir="${weka}" target="packages_changelog" inheritall="false">
<property name="date_range" value="{${lastReleaseDate}}:{${TODAY}}"/>
<property name="release" value="${release}"/>
<property name="weka_branch" value="trunk"/>
</ant>
</target>
<target name="manual" depends="init_all" description="Make the WekaManual.">
<latex
verbose="on"
clean="on"
pdftex="off"
workingDir="${wekadocs}/manual"
>
<fileset dir="${wekadocs}/manual">
<include name="manual.tex" />
</fileset>
</latex>
<echo message="Running dvips..."/>
<exec executable="dvips" dir="${wekadocs}/manual">
<arg value="-oWekaManual.ps"/>
<arg value="manual.dvi"/>
</exec>
<echo message="Running ps2pdf..."/>
<exec executable="ps2pdf" dir="${wekadocs}/manual">
<arg value="WekaManual.ps"/>
</exec>
</target>
<target name="copy-files" depends="javadocs, remote-engine, weka-src, changelog, packages_changelog, manual">
<copy todir="${temp}/weka-${release}">
<fileset dir="${weka}/dist">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${temp}/weka-${release}/changelogs">
<fileset dir="${wekadocs}/changelogs">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${temp}/weka-${release}/doc">
<fileset dir="${weka}/doc"/>
</copy>
<copy todir="${temp}/weka-${release}/data">
<fileset dir="${wekadocs}/data"/>
</copy>
<copy todir="${temp}/weka-${release}/">
<fileset dir="${wekadocs}">
<include name="documentation.*"/>
<include name="README" />
<include name="COPYING" />
<include name="weka.*" />
</fileset>
</copy>
<copy todir="${temp}/weka-${release}/">
<fileset dir="${wekadocs}/manual">
<include name="WekaManual.pdf"/>
</fileset>
</copy>
<!-- copy the generated pdf up one directory - this copy is under subversion control and needs to be committed -->
<copy file="${wekadocs}/manual/WekaManual.pdf" toFile="${wekadocs}/WekaManual.pdf"/>
<copy file="${wekadocs}/WekaManual.pdf" toFile="${dist}/WekaManual-${release}.pdf"/>
<!-- copy changelogs to README files for uploading to SourceForge release directories -->
<copy file="${wekadocs}/changelogs/CHANGELOG-${release}" toFile="${dist}/README-${release}.txt"/>
<copy file="${wekadocs}/changelogs/CHANGELOG_PACKAGES-${release}" toFile="${dist}/README-PACKAGES-${release}.txt"/>
<zip destfile="${temp}/weka-${release}/wekaexamples.zip"
basedir="${wekaexamples}"/>
</target>
<target name="clean" description="Removes the dist directory">
<delete dir="${dist}"/>
<delete dir="${temp}"/>
</target>
<!-- build the Mac application suitable for running under Oracle Java >= 1.7 -->
<target name="osx_app_oracle" if="${osx_jre_oracle}">
<bundleapp outputdirectory="${temp}"
name="weka-${release}-oracle-jvm"
displayname="Weka-${release}"
icon="weka/src/main/java/weka/gui/weka_icon_new.icns"
identifier="nz.ac.waikato.cms.Weka"
shortversion="${version}"
mainclassname="weka.gui.GUIChooser">
<runtime dir="${env.JAVA_HOME}" />
<classpath file="${temp}/weka-${release}/weka.jar"/>
<option value="-Xss20M"/>
</bundleapp>
<antcall target="dmg_${os}">
<param name="jvm_target" value="${jvm_target}"/>
</antcall>
</target>
<target name="install_app_stub_osx_apple_jre">
<!-- jarbundler does this automatically if we are building under OS X with Apple JRE 1.6 -->
<copy file="installer/osx_app_resources/JavaApplicationStub" toDir="${temp}/weka-${release}-apple-jvm.app/Contents/MacOS/"/>
<chmod file="${temp}/weka-${release}-apple-jvm.app/Contents/MacOS/JavaApplicationStub" perm="ugo+rx"/>
</target>
<!-- build the Mac application suitable for running under Apple Java 1.6 -->
<target name="osx_app_apple" if="${osx_jre_apple}">
<taskdef name="jarbundler"
classname="net.sourceforge.jarbundler.JarBundler" />
<jarbundler dir="${temp}"
name="weka-${release}-apple-jvm"
mainclass="weka.gui.GUIChooser"
icon="weka/src/main/java/weka/gui/weka_icon_new.icns"
version="${release}"
verbose="true"
VMOptions="-Xss20M"
shortname="Weka-${release}"
arguments=""
workingdirectory="/Users"
jvmversion="1.6+">
<javaproperty name="java.library.path" value="$APP_PACKAGE/Contents/Resources"/>
<jarfileset dir="${temp}/weka-${release}/">
<include name="weka.jar"/>
</jarfileset>
<documenttype name="Attribute Relation File Format (ARFF)"
extensions="arff xrff"
iconFile="weka/src/main/java/weka/gui/weka_icon_new.icns"
role="Editor"/>
<documenttype name="Knowledge Flow layout"
extensions="kf kfml"
iconFile="weka/src/main/java/weka/gui/weka_icon_new.icns"
role="Editor"/>
</jarbundler>
<antcall target="install_app_stub_osx_apple_jre"/>
<antcall target="dmg_${os}">
<param name="jvm_target" value="${jvm_target}"/>
</antcall>
</target>
<target name="dmg_osx">
<!-- Make a .dmg disk image under Mac OSX -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X">
<arg value="create"/>
<arg value="-srcfolder"/>
<arg value="${temp}"/>
<arg value="-volname"/>
<arg value="weka-${release}"/>
<arg value="-ov"/>
<arg value="${dist}/weka-${release}-${jvm_target}.dmg"/>
<arg value="-fs"/>
<arg value="HFS+"/>
</exec>
<delete dir="${temp}/weka-${release}-${jvm_target}.app"/>
</target>
<target name="dmg_linux">
<!-- Make a .dmg disk image under Linux -->
<exec executable="genisoimage" os="Linux">
<arg value="-D"/>
<arg value="-V"/>
<arg value="Weka-${release}"/>
<arg value="-no-pad"/>
<arg value="-r"/>
<arg value="-apple"/>
<arg value="-o"/>
<arg value="${dist}/weka-${release}-temp.dmg"/>
<arg value="${temp}"/>
</exec>
<exec executable="dmg" os="Linux">
<arg value="dmg"/>
<arg value="${dist}/weka-${release}-temp.dmg"/>
<arg value="${dist}/weka-${release}-${jvm_target}.dmg"/>
</exec>
<delete file="${dist}/weka-${release}-temp.dmg"/>
<delete dir="${temp}/weka-${release}-${jvm_target}.app"/>
</target>
<target name="osx_installer" description="Make an OS X application(s). Run with -Drelease=<number of release (eg. 3-4-1)> and at least one JVM provider (e.g. -Dosx_jre_apple=true -Dosx_jre_oracle=true).">
<delete dir="${temp}/nsis"/>
<antcall target="osx_app_oracle">
<param name="jvm_target" value="oracle-jvm"/>
</antcall>
<antcall target="osx_app_apple">
<param name="jvm_target" value="apple-jvm"/>
</antcall>
</target>
<target name="installer_init">
<unzip src="${dist}/weka-${release}.zip" dest="${temp}"/>
<!-- add unziped jre to the release dir -->
<mkdir dir="${temp}/weka-${release}/jre"/>
<unzip src="${jre}" dest="${temp}/weka-${release}/jre"/>
<mkdir dir="${temp}/nsis"/>
<copy todir="${temp}/nsis">
<fileset dir="installer/nsis/">
<include name="**/*"/>
</fileset>
</copy>
<javac srcdir="${temp}/nsis"
fork="yes"
destdir="${temp}/nsis"
includeantruntime="false"
source="1.6" target="1.6">
<include name="GenerateSetup.java"/>
</javac>
<javac srcdir="${temp}/nsis/templates"
fork="yes"
destdir="${temp}/nsis/templates"
includeantruntime="false"
source="1.6" target="1.6">
<include name="RunWeka.java"/>
</javac>
</target>
<target name="release_base_zip_no_junit" depends="copy-files" description="Make a distribution of Weka. Run with -Drelease=number (e.g. 3-7-10)">
<echo message="Making weka-${release}.zip ..."/>
<zip destfile="${dist}/weka-${release}.zip" basedir="${temp}">
<include name="**/*"/>
</zip>
<echo message="Cleaning up..."/>
<delete dir="${temp}"/>
<ant antfile="build.xml" dir="${weka}" target="clean" inheritall="false"/>
</target>
<target name="release_base_zip" depends="run_tests_all, copy-files" description="Run unit tests ans make a distribution of Weka. Run with -Drelease=number (e.g. 3-7-10)">
<echo message="Making weka-${release}.zip ..."/>
<zip destfile="${dist}/weka-${release}.zip" basedir="${temp}">
<include name="**/*"/>
</zip>
<echo message="Cleaning up..."/>
<delete dir="${temp}"/>
<ant antfile="build.xml" dir="${weka}" target="clean" inheritall="false"/>
</target>
<target name="win_installers" depends="installer_init">
<!-- non-jre installer - 32 bit -->
<echo message="Creating nsis script for 32 bit installer"/>
<java dir="${temp}/nsis" classname="GenerateSetup" fork="true">
<arg line="-version ${version} -input-dir ../weka-${release} -output-dir ./output -dir Weka-${release} -link-prefix 'Weka ${version}'"/>
<classpath>
<pathelement location="${temp}/nsis"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
<!-- non-jre installer - 64 bit -->
<echo message="Creating nsis script for 64 bit installer"/>
<java dir="${temp}/nsis" classname="GenerateSetup" fork="true">
<arg line="-version ${version} -input-dir ../weka-${release} -output-dir ./output -dir Weka-${release} -link-prefix 'Weka ${version}' -x64 true"/>
<classpath>
<pathelement location="${temp}/nsis"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
<echo message="Compiling nsis script for 32 bit installer to executable"/>
<exec executable="${makensis}">
<arg value="temp/nsis/output/weka-${release}.nsi"/>
</exec>
<echo message="Compiling nsis script for 64 bit installer to executable"/>
<exec executable="${makensis}">
<arg value="temp/nsis/output/weka-${release}-x64.nsi"/>
</exec>
<!-- copy all exe installers to dist -->
<copy todir="${dist}">
<fileset dir="${temp}/nsis/output/">
<include name="**/*.exe"/>
</fileset>
</copy>
<delete dir="${temp}/nsis"/>
</target>
<target name="installers_no_junit" depends="clean, release_base_zip_no_junit, win_installers, osx_installer" description="Make a release and create installers without running unit tests. Default OS is OSX (add -Dos=linux to build Mac dmg file under Linux with genisoimage). Run with -Drelease=X-Y-Z -Dversion=X.Y.Z -Djre=<path to JRE zip to unpack in Weka windows install directory> -Dmakensis=<absolute path to the makensis executable> (only needed if makensis is not in the PATH). Specify at least one JVM provider for constructing Mac application bundles (e.g. -Dosx_jre_apple=true -Dosx_jre_oracle=true). Mote that Mac application for oracle requires Java 1.7 and the bundleapp taskdef at the beginning of this build script to be uncommented)">
<echo message="Cleaning up..."/>
<delete dir="${temp}"/>
</target>
<target name="installers" depends="clean, release_base_zip, win_installers, osx_installer" description="Make a release and create instalers. Default OS is OSX (add -Dos=linux to build Mac dmg file under Linux with genisoimage). Run with -Drelease=X-Y-Z -Dversion=X.Y.Z -Djre=<path to JRE zip to unpack in Weka windows install directory> -Dmakensis=<absolute path to the makensis executable> (only needed if makensis is not in the PATH). Specify at least one JVM provider for constructing Mac application bundles (e.g. -Dosx_jre_apple=true -Dosx_jre_oracle=true). Mote that Mac application for oracle requires Java 1.7 and the bundleapp taskdef at the beginning of this build script to be uncommented)">
<echo message="Cleaning up..."/>
<delete dir="${temp}"/>
</target>
</project>