forked from Exmaralda-Org/exmaralda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_coma_win.xml
264 lines (234 loc) · 10.5 KB
/
build_coma_win.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
<?xml version='1.0'?>
<!--<project name="coma2j6" default="clean" basedir=".">-->
<project name="coma2j6" default="clean" basedir=".">
<!-- set to false for release versions -->
<property name="preview" value="true" />
<property name="template_directory" value="templates/" />
<property name="resources" value="src/org/exmaralda/coma/resources" />
<property name="docfolder" value="templates/documentation" />
<!-- make version properties -->
<xslt in="${template_directory}/changes.xml" out="${template_directory}/version.properties" style="${template_directory}/changes2version_properties.xsl" />
<property file="${resources}/version.properties" />
<property name="targetroot" value="org/exmaralda/coma/" />
<property name="calicons" value="src/com/toedter/calendar/images" />
<property name="caltarget" value="com/toedter/calendar/images" />
<property name="source" value="src" />
<property name="build" value="build" />
<property name="doc" value="javadoc" />
<property name="release" value="builds" />
<property name="lib" value="lib" />
<fileset dir="libs" id="libraries">
<include name="elan.jar" />
<include name="AppleJavaExtensions.jar" />
<include name="jdom.jar" />
<include name="jaxen-core.jar" />
<include name="jaxen-jdom.jar" />
<include name="mrj.jar" />
<include name="resolver.jar" />
<include name="saxpath.jar" />
<include name="xalan.jar" />
<include name="xerces.jar" />
<include name="xercesImpl.jar" />
<include name="xml-apis.jar" />
<include name="forms-1.1.0.jar" />
<include name="jmf/*.jar" />
<include name="jctable.jar" />
<include name="tritonus_share.jar" />
<include name="basicplayer3.0.jar" />
<include name="mp3spi1.9.4.jar" />
<include name="args4j-2.0.9.jar" />
<include name="comfyj-2.3.jar" />
<include name="winpack-3.6.jar" />
<include name="jniwrap-3.6.1.jar" />
<include name="quaqua.jar" />
<include name="swing-worker-1.2.jar" />
</fileset>
<path id="comaresources">
<fileset refid="libraries" />
</path>
<path id="svnant.classpath">
<fileset dir="/Users/kai/Java/EXMARaLDA/libs/svnant/lib/">
<include name="*.jar" />
</fileset>
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler" classpath="libs/jarbundler-2.1.0.jar" />
<taskdef name="jsmoothgen" classname="net.charabia.jsmoothgen.ant.JSmoothGen" classpath="libs/jsmooth/lib/jsmoothgen-ant.jar" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="libs/ant-contrib.jar" />
</classpath>
</taskdef>
<target name="prepare">
<tstamp />
<svn>
<wcVersion path="." />
</svn>
<echo message="Subversion repository url: ${revision.max}" />
<delete dir="${release}/mac/Coma.app" />
<delete dir="tmp" />
<mkdir dir="tmp" />
<copy file="${template_directory}/version.properties" tofile="${resources}/version.properties" />
<copy file="libs/comfyj.lic" toFile="${build}/comfyj.lic" />
<copy file="libs/jniwrap.lic" toFile="${build}/jniwrap.lic" />
<copy file="libs/libquaqua.jnilib" toFile="${build}/libquaqua.jnilib" />
<copy file="libs/libquaqua64.jnilib" toFile="${build}/libquaqua64.jnilib" />
<unjar dest="tmp">
<fileset refid="libraries" />
</unjar>
<delete file="tmp/META-INF/JNIWRAPP.DSA" />
<delete file="tmp/META-INF/JNIWRAPP.SF" />
<mkdir dir="${build}" />
<mkdir dir="${build}/${caltarget}" />
<copy todir="${build}/${caltarget}" verbose="true">
<fileset dir="${calicons}" />
</copy>
<copy todir="${build}/${targetroot}/resources">
<fileset dir="${resources}">
<exclude name="**/raw/**" />
<exclude name="**/ftppass.*" />
</fileset>
</copy>
<mkdir dir="${lib}" />
<mkdir dir="${doc}" />
</target>
<target name="compile" depends="prepare">
<javac destdir="${build}" sourcepath="" failonerror="true" fork="true" memorymaximumsize="512m">
<src path="${source}" />
<include name="**/*.java" />
<exclude name="_*" />
<exclude name="**/discarded/**" />
<exclude name="**/teide/**" />
<classpath refid="comaresources" />
</javac>
<copy todir="${build}/">
<fileset dir="${source}">
<include name="**/*.xsl" />
<include name="**/*.xml" />
</fileset>
</copy>
</target>
<target name="makesplash" depends="compile">
<taskdef name="splashmaker" classname="org.exmaralda.common.helpers.SplashVersioner" classpath="build" />
<if>
<equals arg1="${preview}" arg2="true" />
<then>
<splashmaker major="${comanext}" minor="${revision.max}" />
</then>
<else>
<splashmaker major="${comareleased}" />
</else>
</if>
<copy file="${resources}/images/splash.png" toFile="${build}/${targetroot}/resources/images/splash.png" />
</target>
<target name="jar" depends="makesplash">
<jar compress="true" jarfile="${lib}/coma.jar" basedir="${build}">
<fileset dir="tmp" />
<fileset dir="." includes="**/images" />
<manifest>
<attribute name="Main-Class" value="org.exmaralda.coma.launcher.Launcher" />
<attribute name="Class-Path" value="coma.jar" />
<attribute name="SplashScreen-Image" value="org/exmaralda/coma/resources/images/splash.png" />
</manifest>
</jar>
</target>
<target name="clean" depends="upload_preview">
<!-- <delete dir="${build}" /> -->
</target>
<!-- creates the application bundle for the mac -->
<target name="do_mac_app" depends="jar">
<echo message="v2 of the mac app builder" />
<mkdir dir="${release}/mac/Coma.app" />
<mkdir dir="${release}/mac/Coma.app/Contents" />
<mkdir dir="${release}/mac/Coma.app/Contents/MacOS" />
<mkdir dir="${release}/mac/Coma.app/Contents/Resources" />
<mkdir dir="${release}/mac/Coma.app/Contents/Resources/Java" />
<filter token="comaversion" value="${comaversion}" />
<filter token="comabuild" value="${comabuild}" />
<copy file="${release}/resources/Info.plist" todir="${release}/mac/Coma.app/Contents" filtering="true" />
<copy file="${release}/resources/coma.icns" todir="${release}/mac/Coma.app/Contents/Resources" />
<copy file="${release}/resources/document.icns" todir="${release}/mac/Coma.app/Contents/Resources" />
<!-- <copy file="${release}/resources/JavaApplicationStub" todir="${release}/mac/Coma.app/Contents/MacOS" /> -->
<exec dir="${release}/mac/Coma.app/Contents/MacOS" executable="ln">
<arg line="-s /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub JavaApplicationStub" />
</exec>
<copy file="${release}/resources/PkgInfo" todir="${release}/mac/Coma.app/Contents" />
<copy file="${lib}/coma.jar" todir="${release}/mac/Coma.app/Contents/Resources/Java" />
<copy file="${resources}/images/splash.png" todir="${release}/mac/Coma.app/Contents" />
<chmod file="${release}/mac/Coma.app/Contents/MacOS/JavaApplicationStub" perm="555" />
</target>
<target name="do_mac_dmg" depends="do_mac_app">
<!--unmount the image in any case -->
<exec dir="${release}/resources" executable="hdiutil">
<arg line="detach /Volumes/comaimage" />
</exec>
<!--duplicate the pre-created dmg-->
<copy file="${release}/resources/sourcedmg.dmg" tofile="${release}/resources/tmp.dmg" />
<!--mount that copy -->
<exec dir="${release}/resources" executable="hdiutil">
<arg line="mount tmp.dmg -mountpoint /Volumes/comaimage" />
</exec>
<!-- copy the .app-folder to the mounted volume -->
<copy todir="/Volumes/comaimage/Corpus Manager.app">
<fileset dir="${release}/mac/Coma.app" />
</copy>
<!-- copy relevant documentation files -->
<copy todir="/Volumes/comaimage/Help" file="${docfolder}/understanding_coma_metadata_deu.pdf" />
<copy todir="/Volumes/comaimage/Help" file="${docfolder}/understanding_coma_metadata_eng.pdf" />
<copy todir="/Volumes/comaimage/Help" file="${docfolder}/Understanding_the_basics_of_exmaralda.pdf" />
<copy todir="/Volumes/comaimage/Help" file="${resources}/documentation/comadoku.pdf" />
<!-- copy it to the desktop, too - just for testing -->
<copy todir="/Users/kai/Desktop/Corpus Manager.app">
<fileset dir="${release}/mac/Coma.app" />
</copy>
<!--change the permissions in the .app folder-->
<chmod perm="555" file="/Volumes/comaimage/Corpus Manager.app/Contents/MacOS/JavaApplicationStub" />
<chmod perm="555" file="/Users/kai/Desktop/Corpus Manager.app/Contents/MacOS/JavaApplicationStub" />
<!--copy pre-created styling information to the colume and hide it-->
<copy file="${release}/resources/DSStore" tofile="/Volumes/comaimage/.DS_Store" />
<exec dir="/Volumes/comaimage" executable="SetFile">
<arg line="-a V .DS_Store" />
</exec>
<!--unmount volume again-->
<exec dir="${release}/resources" executable="hdiutil">
<arg line="detach /Volumes/comaimage" />
</exec>
<!--convert the image to a compressed one -->
<echo message="cv ${comaversion}" />
<exec dir="${release}/resources" executable="hdiutil" timeout="3600000" failifexecutionfails="false">
<arg line="convert tmp.dmg -format UDCO -o coma${comaversion}.dmg" />
</exec>
<!--delete the temporary image-->
<delete file="${release}/resources/tmp.dmg" />
<move file="${release}/resources/coma${comaversion}.dmg" tofile="${release}/mac/Coma.dmg" />
</target>
<target name="packsources">
<tar destfile="${release}/source/source.tar" compression="gzip" basedir="${source}" excludes="**/discarded/**/*.java" />
</target>
<target name="upload_preview" depends="do_mac_dmg">
<!-- <target name="upload_preview" depends="do_mac_dmg"> -->
<echo message="generating bugs list" />
<xslt in="${template_directory}/changes.xml" out="tmp/coma_bugs.html" style="${template_directory}/coma_changes2knownbugs.xsl" />
<xslt in="${template_directory}/changes.xml" out="tmp/coma_changes.html" style="${template_directory}/coma_changes2html.xsl">
<classpath location="libs/saxonb9-0-0-4j/saxon9.jar" />
</xslt>
<property file="${resources}/ftppass.properties" />
<echo message="uploading mac-coma-preview" />
<ftp password="${uhhpass}" server="${uhhserver}" userid="${uhhlogin}" remotedir="${uhhfolder}/preview">
<fileset dir="${release}/mac">
<include name="Coma.dmg" />
</fileset>
</ftp>
<echo message="uploading bugs list" />
<ftp password="${exmpass}" server="${exmserver}" userid="${exmlogin}" remotedir="${exmfolder}">
<fileset dir="tmp">
<include name="coma_bugs.html" />
<include name="coma_changes.html" />
</fileset>
</ftp>
</target>
<target name="sftp-upload">
<scp todir="${uhhlogin}:${uhhpass}@rrzlogin.rrz.uni-hamburg.de:/www/exmaralda/files/preview" sftp="true" trust="true">
</scp>
</target>
</project>