-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild-addin.xml
270 lines (252 loc) · 10.3 KB
/
build-addin.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
<?xml version="1.0" encoding="utf-8"?>
<project name="Pipeline Lite AddIn" default="buildDistForWin">
<description>Buildfile for the Daisy Pipeline Lite.
Note that it requires libs from
https://sourceforge.net/p/daisymfcgui/code/HEAD/tree/trunk/bundles/
to be build</description>
<!-- Build for 32 bit -->
<property name="platform" value="win32.win32.x86"/>
<!-- Build for 64 bit -->
<!--<property name="platform" value="win32.win32.x86_64"/>-->
<import file="${basedir}/build-core.xml"/>
<property name="addin.name" value="pipeline-lite"/>
<property name="lite.lib.home" value="${basedir}/gui/bundles/libs"/>
<property name="launchers.home" value="${basedir}/gui/bundles/libs"/>
<target name="requiredProperties"
description="Check for property">
<fail unless="platform" message="
the platform property is not set.
Please add a -Dplaform=value to your command line, with a value in
[ win32.win32.x86 , win32.win32.x86_64 ... ] "/>
</target>
<!-- ================================================================== -->
<!-- Fileset definitions -->
<!-- ================================================================== -->
<fileset dir="${base.dir}/lib" id="fileset.pipeline.jars">
<patternset id="patternset.utilJars.2">
<include name="batik-css.jar"/>
<include name="batik-util.jar"/>
<include name="chardet.jar"/>
<include name="commons-cli-1.1.jar"/>
<include name="epubcheck-3.0.jar"/>
<include name="icu4j-72_1.jar"/>
<include name="jl1.0.jar"/>
<include name="reload4j-1.2.25.jar"/>
<include name="jing.jar"/>
<include name="xml-apis.jar"/>
<include name="sac.jar"/>
<include name="saxon.jar"/>
<include name="saxon8.jar"/>
<include name="saxon8-dom.jar"/>
<include name="serializer.jar"/>
<include name="stax-api-1.0.1.jar"/>
<include name="tagsoup-1.2.jar"/>
<include name="tritonus_remaining-0.3.6.jar"/>
<include name="tritonus_share-0.3.6.jar"/>
<include name="wstx-lgpl-3.2.8.jar"/>
<include name="xalan.jar"/>
<include name="xercesImpl.jar"/>
<include name="zedval.jar"/>
</patternset>
</fileset>
<!-- Transformers -->
<fileset dir="${transformers.dir}" id="fileset.addin.transformers">
<include name="int_daisy_filesetRenamer/**/*.*"/>
<include name="int_daisy_mathAltCreator/**/*.*"/>
<include name="int_daisy_mixedContentNormalizer/**/*.*"/>
<include name="int_daisy_validator/**/*.*"/>
<include name="pipeline_system_deleter/**/*.*"/>
<include name="se_tpb_annonsator/**/*.*"/>
<include name="se_tpb_dtbAudioEncoder/**/*.*"/>
<include name="se_tpb_dtbookFix/**/*.*"/>
<include name="se_tpb_filesetcreator/**/*.*"/>
<include name="se_tpb_speechgen2/**/*.*"/>
<include name="se_tpb_xmldetection/**/*.*"/>
<include name="se_tpb_zed2daisy202/**/*.*"/>
<exclude name="**/*.java"/>
</fileset>
<!-- Scripts -->
<fileset dir="${basedir}/scripts" id="fileset.full.scripts">
<include name="**/*"/>
</fileset>
<fileset dir="${basedir}/scripts" id="fileset.addin.scripts">
<include name="_dev/_postprocess.taskScript"/>
<include name="_dev/default.taskScript"/>
</fileset>
<fileset dir="${basedir}/scripts" id="fileset.addin.scripts.lang.ja">
<include name="_dev/DAISY Pipeline TTS Narrator_ja.taskScript"/>
</fileset>
<!-- Pipeline Lite Libs -->
<fileset dir="${lite.lib.home}" id="fileset.lite.jars">
<include name="org.daisy.pipeline.lite-*.jar"/>
<include name="org.daisy.pipeline.scripts.ui-*.jar"/>
<include name="org.daisy.util.jface-*.jar"/>
<include name="org.daisy.util.swt-*.jar"/>
<include name="org.eclipse.core.commands-*.jar"/>
<include name="org.eclipse.equinox.common-*.jar"/>
<include name="org.eclipse.jface-*.jar"/>
<include name="org.eclipse.swt-*.jar"/>
</fileset>
<fileset dir="${lite.lib.home}" id="fileset.lite.jars.win">
<include name="org.eclipse.swt.${platform}-*.jar"/>
</fileset>
<fileset dir="${lite.lib.home}" id="fileset.lite.jars.mac">
<include name="org.eclipse.swt.carbon.macosx_*.jar"/>
</fileset>
<fileset dir="${lite.lib.home}" id="fileset.lite.jars.lang.ja">
<include name="org.eclipse.core.commands.nl_ja_*.jar"/>
<include name="org.eclipse.equinox.common.nl_ja_*.jar"/>
<include name="org.eclipse.jface.nl_ja_*.jar"/>
<include name="org.eclipse.swt.nl_ja_*.jar"/>
</fileset>
<target name="buildForWin"
description="Builds a zipfile containing the Pipeline Lite distribution for Windows">
<antcall target="buildReleaseZip">
<param name="target.win" value="true"/>
<param name="releaseName" value="${addin.name}-ms-${ISO-TODAY}"/>
</antcall>
</target>
<target name="buildDistForWin"
description="Builds the Pipeline Lite distribution for Windows">
<property name="releaseName" value="${addin.name}-ms-${ISO-TODAY}"/>
<property name="release.dir" value="${distribution.dir}/${releaseName}"/>
<antcall target="buildReleaseDir">
<param name="target.win" value="true"/>
<param name="release.dir" value="${release.dir}"/>
</antcall>
</target>
<target name="buildForMac"
description="Builds a zipfile containing the Pipeline Lite distribution for Mac OS X">
<antcall target="buildReleaseZip">
<param name="target.mac" value="true"/>
<param name="releaseName" value="${addin.name}-mac-${ISO-TODAY}"/>
</antcall>
</target>
<target name="buildReleaseZip" description="Builds a zipfile containing the Pipeline Lite distribution">
<property name="release.dir" value="${distribution.dir}/${releaseName}"/>
<antcall target="buildReleaseDir">
<param name="release.dir" value="${release.dir}"/>
</antcall>
<zip destfile="${distribution.dir}/${releaseName}.zip" basedir="${distribution.dir}" includes="${releaseName}/**/*"/>
<delete dir="${release.dir}"/>
</target>
<target name="buildUI"
depends="buildCoreJar,buildUtil,createDistributionDir"
description="Builds the pipeline lite libray (need maven in path)">
<delete dir="${basedir}/gui/bundles/org.daisy.pipeline.lite/libs" />
<delete dir="${basedir}/gui/bundles/org.daisy.pipeline.scripts.ui/libs" />
<delete dir="${basedir}/gui/bundles/org.daisy.util.jface/libs" />
<delete dir="${basedir}/gui/bundles/org.daisy.util.swt/libs" />
<delete dir="${basedir}/gui/bundles/libs" />
<copy file="${distribution.dir}/pipeline.jar"
tofile="${basedir}/gui/bundles/local-repo/org/daisy/pipeline/org.daisy.pipeline/1.0.12/org.daisy.pipeline-1.0.12.jar" />
<copy file="${distribution.dir}/org.daisy.util.jar"
tofile="${basedir}/gui/bundles/local-repo/org/daisy/pipeline/org.daisy.util/1.0.12/org.daisy.util-1.0.12.jar" />
<exec dir="${basedir}/gui/bundles" executable="cmd">
<arg value="/C"/>
<arg value="mvn"/>
<arg line="clean package -Dosgi.platform=${platform}" />
</exec>
</target>
<target name="buildReleaseDir"
depends="buildCoreJar,buildUtil,createDistributionDir,buildUI"
description="Builds a dir containing everything needed in a AddIn release">
<copy file="${distribution.dir}/pipeline.jar" tofile="${release.dir}/lib/org.daisy.pipeline_${ISO-TODAY}.jar" />
<copy file="${distribution.dir}/org.daisy.util.jar" tofile="${release.dir}/lib/org.daisy.util_${ISO-TODAY}.jar" />
<!-- Required JARs -->
<copy todir="${release.dir}/lib">
<fileset refid="fileset.pipeline.jars"/>
<fileset refid="fileset.lite.jars"/>
</copy>
<!-- Transformers -->
<copy todir="${release.dir}/transformers">
<fileset refid="fileset.addin.transformers"/>
</copy>
<!-- Property Files -->
<copy todir="${release.dir}">
<fileset dir="${base.dir}/bin">
<include name="pipeline.properties"/>
</fileset>
</copy>
<!-- Scripts -->
<copy todir="${release.dir}/scripts">
<fileset refid="fileset.addin.scripts"/>
<flattenmapper/>
</copy>
<!-- Licenses -->
<copy todir="${release.dir}/licenses">
<fileset dir="${base.dir}/licenses">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- Call platform-specific targets -->
<antcall target="buildReleaseDir-Mac"/>
<antcall target="buildReleaseDir-Win"/>
<antcall target="buildReleaseDir-lang"/>
</target>
<target name="buildReleaseDir-Win" if="target.win">
<!-- Windows-specific JARs -->
<copy todir="${release.dir}/lib">
<fileset refid="fileset.lite.jars.win"/>
</copy>
<!-- Property Files -->
<copy tofile="${release.dir}/pipeline.user.properties" file="${lite.lib.home}/pipeline.user.win.properties"/>
<!-- Lame -->
<unzip dest="${release.dir}/ext" stripAbsolutePathSpec="false">
<fileset dir="${base.dir}/launchers/third_parties_runtimes/${platform}">
<include name="lame*.zip"/>
</fileset>
</unzip>
<!-- Launchers -->
<copy todir="${release.dir}">
<fileset dir="${launchers.home}">
<include name="pipeline-lite.exe"/>
</fileset>
</copy>
<!-- Assuming openJDK jre archive format, which start with a folder named like jdk<major>u<minor>-<build_version>-jre -->
<unzip dest="${release.dir}" stripAbsolutePathSpec="false">
<fileset dir="${base.dir}/launchers/third_parties_runtimes/${platform}">
<include name="OpenJDK*.zip"/>
</fileset>
</unzip>
<!-- renaming openjdk jre folder to jre -->
<path id="jre_name">
<dirset dir="${release.dir}">
<include name="*-jre"/>
</dirset>
</path>
<property name="jre_name" refid="jre_name" />
<move file="${jre_name}" tofile="${release.dir}/jre" />
</target>
<target name="buildReleaseDir-Mac" if="target.mac">
<!-- Mac-specific JARs -->
<copy todir="${release.dir}/lib">
<fileset refid="fileset.lite.jars.mac"/>
</copy>
<!-- Property Files -->
<copy tofile="${release.dir}/pipeline.user.properties" file="${lite.lib.home}/pipeline.user.mac.properties"/>
<!-- Launchers -->
<copy todir="${release.dir}">
<fileset dir="${launchers.home}">
<include name="pipeline-lite.sh"/>
</fileset>
</copy>
</target>
<target name="buildReleaseDir-lang">
<antcall target="buildReleaseDir-lang.ja"/>
</target>
<target name="buildReleaseDir-lang.ja" if="addin.lang.ja">
<!-- Eclipse localization -->
<copy todir="${release.dir}/lib">
<fileset refid="fileset.lite.jars.lang.ja"/>
</copy>
<!-- Overwrite Scripts -->
<copy todir="${release.dir}/scripts" overwrite="yes">
<fileset refid="fileset.addin.scripts.lang.ja"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*_ja.taskScript" to="*.taskScript"/>
</chainedmapper>
</copy>
</target>
</project>