-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
executable file
·384 lines (336 loc) · 12.6 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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<project name="slidinator" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant"
>
<!-- NOTE: This script requires that the DITA Open Toolkit
libraries be included in the Java classpath
used to run Ant itself. See the project
documentation for setup instructions. For
Eclipse, you need to add the jars in the
Toolkit lib/ and lib/saxon/ directories
to the Ant jars configured in the Eclipse
Ant/runtime preferences.
-->
<!-- NOTE: Update version.properties as needed to reflect new
versions of project components.
-->
<property file="version.properties"/>
<property file="build.properties"/>
<property file="${user.home}/.build.properties"/>
<property file="${user.home}/build.properties"/>
<property name="build" location="${basedir}/build"/>
<property name="dist" location="${basedir}/dist"/>
<property name="lib" location="${basedir}/lib"/>
<property name="src" location="${basedir}/src/java"/>
<property name="license.dir" location="${basedir}/license"/>
<property name="toolkit.plugin.src" location="${basedir}/toolkit_plugins"/>
<property name="temp" location="${basedir}/temp"/>
<property name="docs.dir" location="${basedir}/docs"/>
<property name="docs" location="${basedir}/docs"/>
<property name="templates.dir" location="${basedir}/templates"/>
<property name="website.source" location="${docs}/website"/>
<property name="website.build" location="${build}/website"/>
<property name="sampledata" location="${basedir}/sample_data"/>
<property name="sampledata.dist" location="${dist}/sample_data"/>
<property name="plugin.dist" location="${dist}/plugins"/>
<property name="package.dist" location="${dist}/slidinator"/>
<property name="package.zip.base" value="slidinator"/>
<property name="dita-ot-dir" location="c:\DITA-OT1.5"/>
<property name="plugin.src" location="${basedir}/toolkit_plugins"/>
<property name="plugin-deploy_target" location="${dita-ot-dir}/plugins"/>
<property name="doctypes.plugin-dist" location="${plugin.dist}/org.slidinator.doctypes"/>
<property name="doctypes.src" location="${basedir}/doctypes"/>
<property name="xslt.src" location="${basedir}/src/xslt"/>
<property name="target.home" location="${basedir}/target"/>
<import file="${dita-ot-dir}${file.separator}integrator.xml" optional="yes"/>
<property name="lib.home" value="${lib}" />
<property name="src.home" value="${basedir}/src" />
<property name="src.java.home" value="${src.home}/java" />
<property name="resources.home" value="${src.home}/resources" />
<property name="classes.home" value="${target.home}/classes"/>
<property name="target.home" value="target"/>
<path id="dita-classpath"
>
<fileset dir="${dita-ot-dir}">
<include name="lib"/><!-- Added for 1.5.4 -->
</fileset>
<fileset dir="${dita-ot-dir}/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="classpath.base">
<pathelement path="${classes.home}"/>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</path>
<target name="resolve" description="Retrieve dependencies with ivy" depends="init">
<ivy:retrieve pattern="${ivy.lib.dir}/[artifact].[ext]" />
</target>
<target name="init">
<buildnumber/>
<tstamp/>
</target>
<tstamp>
<format property="package.date" pattern="yyyy-MM-dd"/>
</tstamp>
<tstamp>
<format property="build-date-time"
pattern="yyyy-MM-dd HH:mm:SSS z"/>
</tstamp>
<target name="clean">
</target>
<target name="add-version-info-to-files">
<replace file="${plugin.dist}/org.slidinator.pptx/xsl/map2slidesetImpl.xsl"
propertyfile="${basedir}/build.number"
>
<replacefilter
token="^version^"
value="${package_version}"
/>
<replacefilter
token="^buildnumber^"
property="build.number"
/>
<replacefilter
token="^timestamp^"
value="${build-date-time}"
/>
</replace>
</target>
<target name="dist-license-info" depends="dist-init">
<copy todir="${package.dist}">
<fileset dir="${license.dir}">
<include name="*"/>
</fileset>
</copy>
</target>
<target name="dist-toolkit-plugins"
description="Packages the DITA Open Toolkit plugins for deployment to a working Toolkit instance"
depends="
dist-init,
jar-slideset-generator
"
>
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${plugin.dist}" includes="*"/>
</delete>
<copy todir="${plugin.dist}">
<fileset dir="${license.dir}">
<include name="*"/>
</fileset>
</copy>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.slidinator.pptx/**"/>
<exclude name="*.zip"/>
<exclude name="org.slidinator.*2html"/>
</fileset>
</copy>
<copy todir="${plugin.dist}/org.slidinator.pptx/lib">
<fileset dir="${dist}">
<include name="dita2slideset-app.jar"/>
</fileset>
</copy>
<copy todir="${doctypes.plugin-dist}/doctypes">
<fileset dir="${doctypes.src}">
</fileset>
</copy>
<antcall target="add-version-info-to-files"/>
<property name="sample_data-zip.filename" value="slidinator-sample_data-${package_version}.zip"/>
<property name="sample_data-zip" location="${dist}/${sample_data-zip.filename}"/>
<zip destfile="${sample_data-zip}">
<fileset dir="${dist}">
<include name="sample_data/**"/>
</fileset>
</zip>
</target>
<target name="deploy-toolkit-plugins" depends="dist-toolkit-plugins"
description="Deploy plugins to local DITA Open Toolkit">
<delete failonerror="true" includeemptydirs="true">
<fileset dir="${plugin-deploy_target}" includes="org.slidinator.*/**">
</fileset>
</delete>
<mkdir dir="${plugin-deploy_target}"/>
<copy todir="${plugin-deploy_target}">
<fileset dir="${plugin.dist}">
<include name="**/*"/>
<exclude name="**/CVS"/>
</fileset>
</copy>
<!-- Integrate the deployed plugins: -->
<antcall target="integrate"/>
</target>
<target name="dist-init" depends="init">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${dist}" includes="*/**"/>
</delete>
<mkdir dir="${dist}"/>
<mkdir dir="${package.dist}"/>
</target>
<target name="dist-documentation" depends="dist-init">
<copy todir="${package.dist}/documentation">
<fileset dir="${docs.dir}/user_docs">
<exclude name="epub/"/>
<exclude name="kindle/"/>
<exclude name="out/"/>
<exclude name="docx2*/"/>
<exclude name="temp/"/>
<include name="*/**"/>
</fileset>
</copy>
</target>
<target name="package-toolkit-plugins" depends="dist-init, dist-toolkit-plugins"
description="Create distributable Zip package of the Toolkit plugins, including the vocabulary modules."
>
<zip destfile="${package.dist}/slidinator-toolkit-plugins-${package_version}.zip">
<fileset dir="${plugin.dist}">
<include name="*.txt"/>
<include name="*/**"/>
</fileset>
</zip>
</target>
<target name="package-delivery"
depends="
dist-init,
package-toolkit-plugins,
dist-license-info,
dist-documentation
"
description="Create distributable package of all the deliverables"
>
<copy todir="${package.dist}/xslt">
<fileset dir="${xslt.src}">
<include name="*/**"/>
</fileset>
</copy>
<zip destfile="${dist}/${package.zip.base}-${package_version}.zip">
<fileset dir="${package.dist}" >
</fileset>
<fileset dir="${dist}" >
<include name="sample_data/**/*"/>
<include name="templates/**/*"/>
</fileset>
<fileset dir="${build}/docs">
<include name="*.pdf"/>
<include name="*.epub"/>
<include name="*.mobi"/>
<include name="html/**/*"/>
</fileset>
</zip>
</target>
<target name="init-web-site">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${website.build}" includes="*/**"/>
</delete>
</target>
<target name="generate-web-site"
depends="init-web-site"
description="Generate Web site HTML">
<ant antfile="${dita-ot-dir}/build.xml"
dir="${dita-ot-dir}"
target="dita2xhtml"
>
<property name="args.input" location="${docs}/website/dita4publishers.ditamap"/>
<property name="transtype" value="dita2xhtml"/>
<property name="args.outext" value="html"/>
<property name="args.xhtml.toc" value="toc"/>
<property name="dita.dir" location="${dita-ot-dir}"/>
<property name="dita.temp.dir" location="${temp}/dita-temp"/>
<property name="clean.temp" value="true"/><!-- Unset to preserve the temp directory -->
<property name="output.dir" location="${website.build}"/>
</ant>
<copy todir="${website.build}" >
<fileset dir="${docs}/website/static-html" includes="index.html"/>
</copy>
</target>
<target name="init-target">
<delete dir="${target.home}" failonerror="false"/>
<mkdir dir="${target.home}"/>
<mkdir dir="${api-and-tools.target}"/>
<mkdir dir="${api-and-tools.target}/lib"/>
</target>
<target name="compile" depends="init">
<delete dir="${classes.home}" />
<mkdir dir="${classes.home}"/>
<javac
srcdir="${src.java.home}"
destdir="${classes.home}"
debug="on"
deprecation="on"
source="1.6"
target="1.6"
>
<classpath refid="classpath.base"/>
</javac>
</target>
<target name="jar-slideset-generator" depends="dist-init,compile" description="Create jar for DITA-to-SlideSet transformer">
<jar jarfile="${dist}/dita2slideset.jar" basedir="${classes.home}" >
<include name="org/slidinator/slideset/**/*"/>
</jar>
<copy todir="${classes.home}">
<fileset dir="${src}">
<include name="log4j.properties"/>
</fileset>
</copy>
<jar jarfile="${dist}/dita2slideset-app.jar" basedir="${classes.home}" >
<include name="org/slidinator/slideset/**/*"/>
<include name="log4j.properties"/>
<manifest>
<attribute name="Main-Class" value="org.slidinator.slideset.DITA2PPTX"/>
<attribute name="Class-Path" value=".
commons-logging.jar
commons-cli.jar
commons-io.jar
log4j.jar
log4j.properties
"
/>
</manifest>
<zipgroupfileset dir="${lib}">
<include name="commons-*.jar"/>
<include name="dom4j.jar"/>
<include name="log4j.jar"/>
<include name="poi.jar"/>
<include name="poi-*.jar"/>
<include name="saxon*.jar"/>
<include name="xml-apis.jar"/>
<include name="xml-resolver.jar"/>
<include name="xbean.jar"/>
<include name="xercesImpl.jar"/>
</zipgroupfileset>
</jar>
</target>
<target name="package-editing-templates" depends="init-target, clean"
description="Packages the editing templates in their own Zip file.">
<copy todir="${dist}/templates">
<fileset dir="${templates.dir}">
<include name="maps/**"/>
<include name="topics/**"/>
</fileset>
</copy>
<zip destfile="${dist}/slidinator-templates.zip" basedir="${dist}">
<include name="templates/*/**"/>
</zip>
</target>
<target name="push-jar-to-ivy" depends="jar-slideset-generator"
description="Puts the Slidinator jars in Ivy reflecting the value of the package_version in version.properties"
>
<echo message="Copying jars to ${ivy.repo.scp.user}@${ivy.repo.scp.server}:${ivy.repo.parent.dir}/ivy-repo/slidinator/slidinator-toolkit-plugins/dita2slideset-${package_version}.jar"/>
<scp todir="${ivy.repo.scp.user}@${ivy.repo.scp.server}:${ivy.repo.parent.dir}/ivy-repo/slidinator/dita2slideset/dita2slideset-${package_version}.jar"
file="${dist}/dita2slideset.jar"
password="${ivy.repo.scp.password}"
verbose="true"
/>
</target>
<!-- /slidinator/dist/slidinator/slidinator-toolkit-plugins-0.1.2.zip -->
<target name="push-toolkit-plugins-to-ivy" depends="package-toolkit-plugins"
description="Puts the Slidinator Toolkit plugin package in Ivy reflecting the value of the package_version in version.properties"
>
<echo message="Copying toolkit package to ${ivy.repo.scp.user}@${ivy.repo.scp.server}:${ivy.repo.parent.dir}/ivy-repo/slidinator/slidinator-toolkit-plugins/slidinator-toolkit-plugins-${package_version}.zip"/>
<scp todir="${ivy.repo.scp.user}@${ivy.repo.scp.server}:${ivy.repo.parent.dir}/ivy-repo/slidinator/slidinator-toolkit-plugins/slidinator-toolkit-plugins-${package_version}.zip"
file="${dist}/slidinator/slidinator-toolkit-plugins-${package_version}.zip"
password="${ivy.repo.scp.password}"
verbose="true"
/>
</target>
</project>