forked from dita4publishers/dita4publishers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·1329 lines (1204 loc) · 47.7 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
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<project name="DITA For Publishers" 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="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="rsuite.src" location="${basedir}/rsuite/src/java"/>
<property name="rsuite.xslt" location="${basedir}/rsuite/xslt"/>
<property name="toolkit.plugin.src" location="${basedir}/toolkit_plugins"/>
<property name="rsuiteSrc" location="${basedir}/rsuite"/>
<property name="temp" location="${basedir}/temp"/>
<property name="epubTemp" location="${temp}/epub"/>
<property name="epubBuild" location="${build}/epubs"/>
<property name="kindleTemp" location="${temp}/kindle"/>
<property name="kindleBuild" location="${build}/kindle"/>
<!-- NOTE: The kindle building executable must be in the PATH -->
<property name="kindlepreview.executable" value="kindlepreviewer"/>
<property name="docs.dir" location="${basedir}/docs"/>
<property name="docs" location="${basedir}/docs"/>
<property name="templates.dir" location="${toolkit.plugin.src}/org.dita4publishers.doctypes/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}/dita4publishers"/>
<property name="package.zip.base" value="dita4publishers"/>
<property name="dita-ot-dir" location="c:\DITA-OT1.5"/>
<property name="plugin.src" location="${basedir}/toolkit_plugins"/>
<property name="shakespear-sample" location="${basedir}/sample_data/specializations/shakespear"/>
<property name="plugin-shakespear-samples-src" value="${shakespear-sample}/toolkit_plugins"/>
<property name="plugin-deploy_target" location="${dita-ot-dir}/plugins"/>
<property name="doctypes.plugin-dist" location="${plugin.dist}/org.dita4publishers.doctypes"/>
<property name="doctypes.plugin-shakespear-dist" value="${plugin.dist}/org.dita4publishers.shakespear.doctypes"/>
<property name="doctypes-skakespear-samples.src" value="${shakespear-sample}/doctypes"/>
<property name="xslt.src" location="${basedir}/xslt"/>
<property name="target.home" location="${basedir}/target"/>
<property name="api-and-tools.dirname" value="d4p-api-and-tools"/>
<property name="api-and-tools.target" location="${target.home}/${api-and-tools.dirname}"/>
<property name="api-and-tools.dist" location="${dist}/${api-and-tools.dirname}"/>
<property name="release.dir" location="${basedir}/release"/>
<import file="install-ivy.xml"/>
<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="rsuite-plugin.name" value="dita4publishers-rsuite" />
<property name="target.home" value="target"/>
<property name="target.jar" value="${rsuite-plugin.name}-plugin.jar"/>
<path id="dita-classpath"
>
<fileset dir="${dita-ot-dir}">
<include name="lib"/>
</fileset>
<fileset dir="${dita-ot-dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${dita-ot-dir}/lib/org.dita.dost.platform">
<include name="*.properties"/>
</fileset>
<fileset dir="${dita-ot-dir}/lib/saxon">
<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, init-ivy">
<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.dita4publishers.epub/xsl/map2epubImpl.xsl"
propertyfile="${basedir}/build.number"
>
<replacefilter
token="^buildnumber^"
property="build.number"
/>
<replacefilter
token="^version^"
value="${epub_version}"
/>
<replacefilter
token="^timestamp^"
value="${package.date}"
/>
</replace>
<replace file="${plugin.dist}/org.dita4publishers.kindle/xsl/map2kindleImpl.xsl"
propertyfile="${basedir}/build.number"
>
<replacefilter
token="^buildnumber^"
property="build.number"
/>
<replacefilter
token="^version^"
value="${kindle_version}"
/>
<replacefilter
token="^timestamp^"
value="${package.date}"
/>
</replace>
<replace file="${plugin.dist}/org.dita4publishers.html2/xsl/map2html2Impl.xsl"
propertyfile="${basedir}/build.number"
>
<replacefilter
token="^buildnumber^"
property="build.number"
/>
<replacefilter
token="^version^"
value="${html2_version}"
/>
<replacefilter
token="^timestamp^"
value="${package.date}"
/>
</replace>
<replace file="${plugin.dist}/org.dita4publishers.word2dita/xsl/docx2dita.xsl"
propertyfile="${basedir}/build.number"
>
<replacefilter
token="^buildnumber^"
property="build.number"
/>
<replacefilter
token="^version^"
value="${word2dita_version}"
/>
<replacefilter
token="^timestamp^"
value="${package.date}"
/>
</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-sample-data" depends="dist-init">
<copy todir="${sampledata.dist}">
<fileset dir="${sampledata}">
<exclude name="**/*.zip"/>
<exclude name="**/epub/"/>
<exclude name="**/out/"/>
<exclude name="**/output/"/>
<exclude name="**/temp/"/>
<include name="common/**"/>
<include name="word2dita/**"/>
<include name="wizard-of-oz/**"/>
<include name="japanese/**"/>
</fileset>
</copy>
</target>
<target name="dist-license"
description="Packages the license used for all packages"
depends="dist-init"
>
<copy todir="${plugin.dist}">
<fileset dir="${license.dir}">
<include name="*"/>
</fileset>
</copy>
</target>
<target name="dist-common-toolkit-plugins"
description="Packages the plugins used by all D4P transformation types"
depends="dist-init, dist-license"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita-community.adjust-copy-to/**"/>
<include name="org.dita-community.common.xslt/**"/>
<include name="org.dita-community.common.mapdriven/**"/>
<include name="org.dita-community.preprocess-extensions/**"/>
<include name="org.dita4publishers.common.mapdriven/**"/>
<include name="org.dita4publishers.common.xslt/**"/>
</fileset>
</copy>
</target>
<target name="dist-word2dita-toolkit-plugins"
description="Packages the plugins used the word2dita plugin"
depends="dist-init, dist-license, dist-doctype-plugins"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita-community.common.xslt/**"/>
<include name="org.dita4publishers.word2dita/**"/>
</fileset>
</copy>
</target>
<target name="dist-shakespear-toolkit-plugins"
description="Packages the plugins needed for the Shakespear play content samples"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin-shakespear-samples-src}">
<include name="*/**"/>
</fileset>
</copy>
<copy todir="${plugin.dist}/org.dita4publishers.shakespear.doctypes">
<fileset dir="${shakespear-sample}">
<include name="doctypes/**"/>
<include name="templates/**"/>
</fileset>
</copy>
</target>
<target name="dist-doctype-plugins"
description="Packages just the doctype plugins"
depends="dist-init, dist-license"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="net.sourceforge.dita4publishers.doctypes/**"/>
<include name="org.dita4publishers.doctypes/**"/>
<include name="org.dita4publishers.math/**"/>
<include name="org.dita4publishers.xmldomain.doctypes/**"/>
</fileset>
</copy>
<replace dir="${plugin.dist}/org.dita4publishers.math/doctypes/mathml3/dtd">
<!--
%character; to %mll3_character;
-->
<include name="*.dtd"/>
<replacetoken><![CDATA[%character;]]></replacetoken>
<replacevalue><![CDATA[%mml_character;]]></replacevalue>
</replace>
<!-- Standalone Math plugin -->
<!-- FIX a bug/unfortunate potential parameter entity name clash with the MathML3 DTD -->
<replace dir="${plugin.dist}/org.dita4publishers.math/doctypes/mathml3/dtd">
<!--
<!ENTITY % character "CDATA"> to <!ENTITY % mll3_character "CDATA" >
-->
<include name="*.dtd"/>
<replacetoken><![CDATA[<!ENTITY % character ]]></replacetoken>
<replacevalue><![CDATA[<!ENTITY % mml_character ]]></replacevalue>
</replace>
</target>
<target name="dist-common-html-toolkit-plugins"
description="Packages just the doctype plugins"
depends="dist-common-toolkit-plugins"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita4publishers.common.mapdriven/**"/>
<include name="org.dita4publishers.common.html/**"/>
<include name="org.dita4publishers.math-d.html/**"/>
<include name="org.dita4publishers.media-d.html/**"/>
</fileset>
</copy>
</target>
<target name="dist-html2-toolkit-plugins"
description="Packages just the doctype plugins"
depends="dist-init, dist-license, dist-common-html-toolkit-plugins"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita4publishers.html2/**"/>
<!-- These are required because the HTML2 transform
adds the MathJax stuff by default.
-->
<include name="org.dita4publishers.math-d.html/**"/>
<include name="org.dita4publishers.media-d.html/**"/>
</fileset>
</copy>
</target>
<target name="dist-html5-toolkit-plugins"
description="Packages just the doctype plugins"
depends="dist-init, dist-license, dist-common-html-toolkit-plugins"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita4publishers.html5/**"/>
<include name="org.dita4publishers.json/**"/>
</fileset>
</copy>
</target>
<target name="dist-epub-toolkit-plugins"
description="Packages just the EPUB plugins"
depends="dist-init, dist-license, dist-common-html-toolkit-plugins"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita4publishers.epub/**"/>
</fileset>
</copy>
</target>
<target name="dist-kindle-toolkit-plugins"
description="Packages just the kindle plugins"
depends="dist-epub-toolkit-plugins"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita4publishers.kindle/**"/>
</fileset>
</copy>
</target>
<target name="dist-toolkit-plugins" description="Packages the DITA Open Toolkit plugins for deployment to a working Toolkit instance"
depends="dist-common-toolkit-plugins,
dist-doctype-plugins,
dist-kindle-toolkit-plugins,
dist-html5-toolkit-plugins,
dist-html2-toolkit-plugins,
dist-word2dita-toolkit-plugins,
dist-shakespear-toolkit-plugins
"
>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita4publishers.common.xslfo/**"/>
<include name="org.dita4publishers.*.fo/**"/>
<include name="org.dita4publishers.*.html/**"/>
</fileset>
</copy>
<!-- FIXME: Make this work again -->
<!-- <antcall target="add-version-info-to-files"/>-->
</target>
<target name="dist-dita2indesign-toolkit-plugins"
description="Creates a standalone distribution of the DITA2InDesign Open Toolkit plug-ins"
depends="dist-init">
<!-- NOTE: These used to be called org.dita2indesign.* -->
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${plugin.dist}" includes="org.dita4publishers.*/**"/>
</delete>
<copy todir="${plugin.dist}">
<fileset dir="${plugin.src}">
<include name="org.dita4publishers.*/**/*"/>
</fileset>
</copy>
<replace file="${plugin.dist}/org.dita4publishers.dita2indesign/xsl/dita2indesignImpl.xsl"
propertyfile="${basedir}/build.number"
>
<replacefilter
token="^buildnumber^"
property="build.number"
/>
<replacefilter
token="^version^"
value="${dita2indesign_version}"
/>
<replacefilter
token="^timestamp^"
value="${package.date}"
/>
</replace>
</target>
<target name="package-dita2indesign-toolkit-plugins"
description="Creates a standalone delivery package of the DITA2InDesign Open Toolkit plugins"
depends="dist-dita2indesign-toolkit-plugins">
<zip destfile="${plugin.dist}/dita2indesign-toolkit-plugins-${dita2indesign_version}-ot-${ot-version}.zip">
<fileset dir="${plugin.dist}">
<include name="org.dita4publishers.*/**"/>
</fileset>
</zip>
</target>
<target name="deploy-preprocess-test-plugin"
description="Deploy plugins to local DITA Open Toolkit">
<echo> Deploying org.dita-community.preprocess-tester...</echo>
<copy todir="${plugin-deploy_target}">
<fileset dir="${plugin.src}/org.dita-community.preprocess-tester">
<include name="**"/>
</fileset>
</copy>
<echo> Calling integrator...</echo>
<!-- Integrate the deployed plugins: -->
<exec executable="${dita-ot-dir}/bin/dita">
<arg line="-install"/>
</exec>
</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.dita4publishers.*/**"/>
<fileset dir="${plugin-deploy_target}" includes="org.dita-community.*/**"/>
</delete>
<mkdir dir="${plugin-deploy_target}"/>
<copy todir="${plugin-deploy_target}">
<fileset dir="${plugin.dist}">
<include name="**/*"/>
<exclude name="**/CVS"/>
<!--
<exclude name="org.dita4publishers.pubmap.fo/**"/>
-->
</fileset>
</copy>
<!-- Integrate the deployed plugins: -->
<exec executable="${dita-ot-dir}/bin/dita">
<arg line="-install"/>
</exec>
</target>
<target name="deploy-disted-plugins">
<!-- Deploys whatever have been put in the dist directory -->
<delete failonerror="true" includeemptydirs="true">
<fileset dir="${plugin-deploy_target}" includes="org.dita4publishers.*/**">
<exclude name="net.sourceforge.dita4publishers.doctypes/**"/>
<exclude name="org.dita4publishers.doctypes/**"/>
<exclude name="org.dita4publishers.math/**"/>
<exclude name="org.dita4publishers.xmldomain.doctypes/**"/>
</fileset>
<fileset dir="${plugin-deploy_target}" includes="org.dita-community.*/**"/>
</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: -->
<exec executable="${dita-ot-dir}/bin/dita">
<arg line="--install"/>
</exec>
</target>
<target name="deploy-html2" depends="dist-html2-toolkit-plugins, deploy-disted-plugins"
description="Deploy only the HTML2 plugin and its dependencies to local DITA Open Toolkit">
</target>
<target name="deploy-html5" depends="dist-html5-toolkit-plugins, deploy-disted-plugins"
description="Deploy only the HTML5 plugin and its dependencies to local DITA Open Toolkit">
</target>
<target name="deploy-epub" depends="dist-epub-toolkit-plugins, deploy-disted-plugins"
description="Deploy only the EPUB plugin and its dependencies to local DITA Open Toolkit">
</target>
<target name="deploy-kindle" depends="dist-kindle-toolkit-plugins, deploy-disted-plugins"
description="Deploy only the Kindle plugin and its dependencies to local DITA Open Toolkit">
</target>
<target name="dist-init" depends="init">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${dist}" includes="*/**"/>
</delete>
<mkdir dir="${dist}"/>
<mkdir dir="${package.dist}"/>
<mkdir dir="${release.dir}"/>
</target>
<target name="dist-api-and-tools" description="Create distribution package for API and tools materials."
depends="package-api-and-tools">
<zip destfile="${dist}/${api-and-tools.dirname}-${package.date}-ot-${ot-version}.zip">
<fileset dir="${api-and-tools.target}">
<include name="**/*"/>
</fileset>
</zip>
</target>
<target name="dist-epub-plugin" depends="build-d4p-user-guide">
<delete failonerror="true" includeemptydirs="true">
<fileset dir="${plugin.dist}" includes="org.dita4publishers.epub/**"/>
</delete>
<copy todir="${plugin.dist}/org.dita4publishers.epub">
<fileset dir="${build}/docs">
<include name="*.epub"/>
<include name="*.mobi"/>
<include name="*.pdf"/>
</fileset>
<fileset dir="${plugin.src}/org.dita4publishers.epub">
<include name="**/*"/>
<exclude name="test/**"/>
</fileset>
<fileset dir="${plugin.src}/org.dita4publishers.common.xslt">
<include name="**/*"/>
</fileset>
<fileset dir="${plugin.src}/org.dita4publishers.kindle">
<include name="**/*"/>
</fileset>
</copy>
</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="deploy-doctypes" depends="dist-doctype-plugins, deploy-disted-plugins"
description="Deploy only the EPUB plugin and its dependencies to local DITA Open Toolkit">
</target>
<target name="package-vocabulary-plugins" depends="dist-init, dist-toolkit-plugins"
description="Create distributable Zip packages of the different Toolkit plugins"
>
<zip destfile="${release.dir}/dita4publishers-vocabulary-plugins-${vocab_version}.zip">
<fileset dir="${plugin.dist}">
<!-- net.sourceforge.* provides legacy mapping catalogs for
the old net.sourceforge versions of the vocab.
-->
<include name="net.sourceforge.dita4publishers.doctypes/**"/>
<include name="org.dita4publishers.doctypes/**"/>
<include name="org.dita4publishers.xmldomain.doctypes/**"/>
<include name="org.dita4publishers.shakespear.doctypes/**"/>
</fileset>
</zip>
</target>
<target name="package-word2dita-plugins" depends="dist-init, dist-word2dita-toolkit-plugins"
description="Create distributable Zip package for the Word2DITA transform plugin with its dependencies"
>
<zip destfile="${release.dir}/dita4publishers-word2dita-plugins-${package_version}-ot-${ot-version}.zip">
<fileset dir="${plugin.dist}">
<include name="org.dita-community.common.xslt/**"/>
<include name="org.dita4publishers.doctypes/**"/>
<include name="org.dita4publishers.math/**"/>
<include name="org.dita4publishers.xmldomain.doctypes/**"/>
<include name="org.dita4publishers.word2dita/**"/>
</fileset>
</zip>
</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="${release.dir}/dita4publishers-toolkit-plugins-${package_version}-ot-${ot-version}.zip">
<fileset dir="${plugin.dist}">
<include name="*.txt"/>
<include name="*/**"/>
<exclude name="org.dita4publishers.pubmap.fo/**"/>
</fileset>
</zip>
</target>
<target name="package-html5-plugins" depends="dist-init, dist-html5-toolkit-plugins"
description="Creates an HTML5-only distribution package">
<zip destfile="${release.dir}/dita4publishers-html5-toolkit-plugins-${package_version}-ot-${ot-version}.zip">
<fileset dir="${plugin.dist}">
<include name="*.txt"/>
<include name="*/**"/>
</fileset>
</zip>
</target>
<target name="package-epub-plugins" depends="dist-init, dist-epub-toolkit-plugins"
description="Creates an EPUB-only distribution package">
<zip destfile="${release.dir}/dita4publishers-epub-toolkit-plugins-${package_version}-ot-${ot-version}.zip">
<fileset dir="${plugin.dist}">
<include name="*/**"/>
</fileset>
</zip>
</target>
<target name="package-all-plugins" depends="make-plugin-packages"
description="Make all the plugin packages for release on GitHub"
>
<!-- Defining a better name for older make-plugin-packages target -->
</target>
<target name="make-plugin-packages"
description="Make all the plugin packages for release on GitHub"
>
<delete dir="${release.dir}" includeEmptyDirs="true" failonerror="false">
<include name="**/*"/>
</delete>
<!-- Each target clears and uses the dist directory, so have to call
them rather than using depends.
-->
<antcall target="package-epub-plugins"/>
<antcall target="package-html5-plugins"/>
<antcall target="package-word2dita-plugins"/>
<antcall target="package-vocabulary-plugins"/>
<antcall target="package-toolkit-plugins"/>
<antcall target="package-dita2indesign-toolkit-plugins"/>
</target>
<!-- RC28: Removed package-api-and-tools as those are not longer maintained -->
<target name="package-delivery"
depends="
dist-init,
package-toolkit-plugins,
package-editing-templates,
build-d4p-user-guide,
dist-sample-data,
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>
<!--
<copy todir="${package.dist}/epubs">
<fileset dir="${epubBuild}">
<include name="**/*.epub"/>
</fileset>
</copy>
-->
<zip destfile="${release.dir}/${package.zip.base}-${package_version}-ot-${ot-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="epub-d4p-user-guide">
<property name="pub.name" value="d4p-users-guide"/>
<property name="root.map" location="${docs.dir}/${pub.name}.ditamap"/>
<property name="output.dir" location="${build}/docs"/>
<property name="temp.dir" location="${basedir}/temp/${pub.name}/epub" />
<delete dir="${output.dir}" failonerror="false">
<include name="${pub.name}.epub"/>
</delete>
<exec taskname="dita-cmd" executable="${dita-ot-dir}/bin/dita" osfamily="unix" failonerror="true">
<arg value="--format"/>
<arg value="epub"/>
<arg value="--input"/>
<arg value="${root.map}"/>
<arg value="--filter"/>
<arg value="${docs.dir}/ditaval/epub-only.ditaval"/>
<arg value="--temp"/>
<arg value="${temp.dir}"/>
<arg value="-output"/>
<arg value="${output.dir}"/>
<arg value="--verbose"/>
<arg value="--clean.temp"/>
<arg value="no"/>
<arg value="-Dargs.copycss"/>
<arg value="yes"/>
<arg value="-Depub.exclude.auto.rellinks"/>
<arg value="true"/>
<arg value="-Dgenerate.copy.outer"/>
<arg value="3"/>
<arg value="-Dhtml2.generate.index"/>
<arg value="true"/>
<arg value="-Dimages.output.dir"/>
<arg value="images"/>
<arg value="-Depub.pubid.uri.stub"/>
<arg value="https://dita4publishers.org"/>
</exec>
<antcall target="post-transform-cleanup-d4p-user-guide">
<param name="pub.name" value="${pub.name}"/>
<param name="output.dir" location="${output.dir}"/>
</antcall>
</target>
<target name="kindle-d4p-user-guide">
<property name="pub.name" value="d4p-users-guide"/>
<property name="root.map" location="${docs.dir}/${pub.name}.ditamap"/>
<property name="output.dir" location="${build}/docs"/>
<delete failonerror="false">
<fileset dir="${output.dir}">
<include name="${pub.name}.mobi"/>
</fileset>
</delete>
<exec taskname="dita-cmd" executable="${dita-ot-dir}/bin/dita" osfamily="unix" failonerror="true">
<arg value="--format"/>
<arg value="kindle"/>
<arg value="--input"/>
<arg value="${root.map}"/>
<arg value="--filter"/>
<arg value="${docs.dir}/ditaval/epub-only.ditaval"/>
<arg value="--temp"/>
<arg value="${basedir}/temp/${pub.name}/kindle"/>
<arg value="-output"/>
<arg value="${output.dir}"/>
<arg value="--verbose"/>
<arg value="--clean.temp"/>
<arg value="no"/>
<arg value="-Dargs.outext"/>
<arg value="xhtml"/>
<arg value="-Dargs.copycss"/>
<arg value="yes"/>
<arg value="-Depub.exclude.auto.rellinks"/>
<arg value="true"/>
<arg value="-Dgenerate.copy.outer"/>
<arg value="3"/>
<arg value="-Dhtml2.generate.index"/>
<arg value="true"/>
<arg value="-Dimages.output.dir"/>
<arg value="images"/>
<arg value="kindlegen.executable"/>
<arg value="${kindlepreview.executable}"/>
</exec>
<antcall target="post-transform-cleanup-d4p-user-guide">
<param name="pub.name" value="${pub.name}"/>
<param name="output.dir" location="${output.dir}"/>
</antcall>
</target>
<target name="html5-d4p-user-guide" description="Generate HTML5 for D4P User's Guide">
<property name="pub.name" value="d4p-users-guide"/>
<property name="root.map" location="${docs.dir}/${pub.name}.ditamap"/>
<property name="output.dir" location="${build}/docs/html5/${pub.name}"/>
<exec taskname="dita-cmd" executable="${dita-ot-dir}/bin/dita" osfamily="unix" failonerror="true">
<arg value="--format"/>
<arg value="d4p-html5"/>
<arg value="--input"/>
<arg value="${root.map}"/>
<arg value="--temp"/>
<arg value="${basedir}/temp/${pub.name}/html5"/>
<arg value="-output"/>
<arg value="${output.dir}"/>
<arg value="--verbose"/>
<arg value="--clean.temp"/>
<arg value="yes"/>
<arg value="-Dargs.outext"/>
<arg value="html"/>
<arg value="-Dargs.copycss"/>
<arg value="yes"/>
<arg value="-Dargs.css"/>
<arg value="/${basedir}/src/css/d4p-docs-html5.css"/>
<arg value="-Dargs.hide.parent.link"/>
<arg value="yes"/>
<arg value="-Dd4p.html5.json.vars.file"/>
<arg value="${output.dir}/json.vars"/>
<arg value="-Douter.control"/>
<arg value="quiet"/>
<arg value="-Ddita.dir"/>
<arg value="${dita-ot-dir}"/>
<arg value="-Dargs.xhtml.toc"/>
<arg value="index"/>
<arg value="-Dargs.hdf"/>
<arg value="${docs.dir}/user_docs/${pub.name}/static-html/topic-header-html.html"/>
<arg value="-Dargs.ftr"/>
<arg value="${docs.dir}/user_docs/${pub.name}/static-html/topic-footer-html.html"/>
<arg value="-Dclean.temp"/>
<arg value="true"/>
<arg value="-Dhtml2.generate.dynamic.toc"/>
<arg value="true"/>
<arg value="-Dhtml2.generate.index"/>
<arg value="true"/>
</exec>
</target>
<target name="post-transform-cleanup-d4p-user-guide">
<property name="pub.name" value="d4p-users-guide"/>
<property name="output.dir" location="${build}/docs"/>
<!-- Delete the directory the Toolkit creates with images -->
<delete dir="${output.dir}" includeEmptyDirs="true" failonerror="true">
<include name="${pub.name}/"/>
<include name="dita.list"/>
<include name="dita.xml.properties"/>
</delete>
</target>
<target name="pdf-d4p-user-guide" description="Build the PDF for the D4P user's guide">
<property name="pub.name" value="d4p-users-guide.ditamap"/>
<property name="root.map" location="${docs.dir}/${pub.name}"/>
<property name="output.dir" location="${build}/docs"/>
<delete failonerror="false">
<fileset dir="${output.dir}">
<include name="${pub.name}.pdf"/>
</fileset>
</delete>
<!-- FIXME: PDF generation does not produce good results with OT 3.6.1 -->
<exec taskname="dita-cmd" executable="${dita-ot-dir}/bin/dita" osfamily="unix" failonerror="true">
<arg value="--format"/>
<arg value="pdf2"/>
<arg value="--input"/>
<arg value="${root.map}"/>
<arg value="--temp"/>
<arg value="${basedir}/temp/${pub.name}/pdf"/>
<arg value="-output"/>
<arg value="${output.dir}"/>
<arg value="--verbose"/>
<arg value="--clean.temp"/>
<arg value="no"/>
<arg value="-Daxf.path"/>
<arg value="${axf.path}"/>
<arg value="-Dpdf.formatter"/>
<arg value="ah"/>
</exec>
<antcall target="post-transform-cleanup-d4p-user-guide">
<param name="pub.name" value="${pub.name}"/>
<param name="output.dir" location="${output.dir}"/>
</antcall>
</target>
<target name="indesign-d4p-user-guide">
<property name="pub.name" value="d4p-users-guide.ditamap"/>
<property name="root.map" location="${docs.dir}/user_docs/${pub.name}"/>
<property name="output.dir" location="${build}/docs/indesign"/>
<ant antfile="${dita-ot-dir}/build.xml"
target="dita2indesign"
>
<property name="args.input" location="${root.map}"/>
<property name="args.draft" value="${draft}"/>
<property name="output.dir" value="${output.dir}"/>
<property name="dita.temp.dir" value="${basedir}/temp/${pub.name}/indesign"/>
<property name="transtype" value="indesign"/>
<property name="clean.temp" value="yes"/>
</ant>
</target>
<target name="build-d4p-user-guide"
description="Generates all the deliverable forms of the D4P User Guide">
<property name="pub.name" value="d4p-users-guide"/>
<property name="root.map" location="${docs.dir}/${pub.name}.ditamap"/>
<replace file="${root.map}"
propertyfile="${basedir}/build.number"
>
<replacefilter
token="^buildnumber^"
property="build.number"
/>
<replacefilter
token="^version^"
value="${package_version}"
/>
</replace>
<antcall target="html5-d4p-user-guide"/>
<antcall target="epub-d4p-user-guide"/>
<antcall target="kindle-d4p-user-guide"/>
<!-- <antcall target="indesign-d4p-user-guide"/> -->
<!-- NOTE: current PDF2 transform does not produce good FO from the D4P User Guide so just removing this for now -->
<!-- <antcall target="pdf-d4p-user-guide"/>-->
</target>
<target name="generate-epubs-for-samples" depends="epub-wizard-of-oz, epub-shakespear-plays"
description="Generate ePUB versions of the publications in sample_data"
>
</target>
<target name="test-epub-shakespear-play" description="Test generation of epubs for shakespear plays">
<property name="sampleRootDir" location="${shakespear-sample}/plays"/>
<antcall target="epub-map"><param name="mapname" value="hen_viii"/></antcall>
</target>
<target name="epub-shakespear-plays" description="Generate epubs for each of the shakespear plays">
<property name="sampleRootDir" location="${shakespear-sample}/plays"/>
<antcall target="epub-map"><param name="mapname" value="a_and_c"/></antcall>
<antcall target="epub-map"><param name="mapname" value="all_well"/></antcall>
<antcall target="epub-map"><param name="mapname" value="as_you"/></antcall>
<antcall target="epub-map"><param name="mapname" value="com_err"/></antcall>
<antcall target="epub-map"><param name="mapname" value="coriolan"/></antcall>
<antcall target="epub-map"><param name="mapname" value="cymbelin"/></antcall>
<antcall target="epub-map"><param name="mapname" value="dream"/></antcall>
<antcall target="epub-map"><param name="mapname" value="hamlet"/></antcall>
<antcall target="epub-map"><param name="mapname" value="hen_iv_1"/></antcall>
<antcall target="epub-map"><param name="mapname" value="hen_iv_2"/></antcall>
<antcall target="epub-map"><param name="mapname" value="hen_v"/></antcall>
<antcall target="epub-map"><param name="mapname" value="hen_vi_1"/></antcall>
<antcall target="epub-map"><param name="mapname" value="hen_vi_2"/></antcall>
<antcall target="epub-map"><param name="mapname" value="hen_vi_3"/></antcall>
<antcall target="epub-map"><param name="mapname" value="hen_viii"/></antcall>
<antcall target="epub-map"><param name="mapname" value="j_caesar"/></antcall>
<antcall target="epub-map"><param name="mapname" value="john"/></antcall>
<antcall target="epub-map"><param name="mapname" value="lear"/></antcall>
<antcall target="epub-map"><param name="mapname" value="lll"/></antcall>
<antcall target="epub-map"><param name="mapname" value="m_for_m"/></antcall>
<antcall target="epub-map"><param name="mapname" value="m_wives"/></antcall>
<antcall target="epub-map"><param name="mapname" value="macbeth"/></antcall>
<antcall target="epub-map"><param name="mapname" value="merchant"/></antcall>
<antcall target="epub-map"><param name="mapname" value="much_ado"/></antcall>
<antcall target="epub-map"><param name="mapname" value="othello"/></antcall>
<antcall target="epub-map"><param name="mapname" value="pericles"/></antcall>
<antcall target="epub-map"><param name="mapname" value="r_and_j"/></antcall>
<antcall target="epub-map"><param name="mapname" value="rich_ii"/></antcall>
<antcall target="epub-map"><param name="mapname" value="rich_iii"/></antcall>
<antcall target="epub-map"><param name="mapname" value="t_night"/></antcall>
<antcall target="epub-map"><param name="mapname" value="taming"/></antcall>
<antcall target="epub-map"><param name="mapname" value="tempest"/></antcall>
<antcall target="epub-map"><param name="mapname" value="timon"/></antcall>
<antcall target="epub-map"><param name="mapname" value="titus"/></antcall>
<antcall target="epub-map"><param name="mapname" value="troilus"/></antcall>
<antcall target="epub-map"><param name="mapname" value="two_gent"/></antcall>
<antcall target="epub-map"><param name="mapname" value="win_tale"/></antcall>
</target>
<target name="epub-wizard-of-oz" description="Generate epub for the Wizard of Oz">
<antcall target="epub-map">
<param name="mapname" value="wizard-of-oz"/>
<param name="sampleRootDir" location="${sampledata}"/>
</antcall>
</target>
<!-- this builds wizard of oz with only three chapters to save processing time -->
<target name="epub-epub-test" description="Generate epub for EPUB test document">
<antcall target="epub-map">
<param name="mapname" value="epub-test"/>
<param name="sampleRootDir" location="${sampledata}"/>
</antcall>