-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
957 lines (748 loc) · 34.2 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
<?xml version="1.0" standalone="no"?>
<!-- =====================================================================
NATO Interoperability Standards and Profiles (NISP)
Configuration file for draft editions
All output will be placed in the build/ directory
==========================================================================
The NISP build system is based on the Apache Ant, which is a Java building tool.
Ant uses a file written in XML (this file) as its building instructions.
The only thing that you have to make sure, is the "JAVA_HOME" environment
property should be set to match the JVM you want to use.
First, make sure your current working directory is where this very
file is located. Then type
./build.sh (unix)
.\build.bat (win32)
This will build a HTML and PDF version of the NISP.
To know more about the available targets take a look at this file, which is
pretty self-explanatory or type
[unix] ./build.sh -projecthelp
[win32] .\build.bat -projecthelp
and concentrate on the target descriptions that start with a star '*': these
are the one you should call, the others are internal targets that are called
by the main ones.
For additional help, type
[unix] ./build.sh -help
[win32] .\build.bat -help
$Id$
-->
<!DOCTYPE project PUBLIC "-//Apache//DTD ANT XML 1.8.1 (NISP specific)//EN"
"schema/dtd/ant.dtd" [
<!ENTITY % tools-info SYSTEM "VERSION">
%tools-info;
<!ENTITY % src-info SYSTEM "src/VERSION">
%src-info;
<!ENTITY targets SYSTEM "build.targets">
]>
<project name="NISP" default="all" basedir=".">
<!-- =================================================================== -->
<!-- Project specific parameters -->
<!-- =================================================================== -->
<!-- Project NISP -->
<property name="name" value="nisp"/>
<!-- Version of the NISP tools -->
<property name="tool-version" value="&tools-version;"/>
<property name="style-rev" value="&style-revision;"/>
<property name="doc-rev" value="&document-revision;"/>
<!-- Release date of the NISP tools -->
<property name="tool-date" value="&tools-release-date;"/>
<!-- Version of the NISP XML sources -->
<property name="src-version" value="&src-version;"/>
<property name="src-version-major" value="&src-version-major;"/>
<property name="src-revision" value="&src-revision;"/>
<property name="nato-std-edition" value="&nato-std-edition;"/>
<property name="nato-std-version" value="&nato-std-version;"/>
<!-- Java compiler options -->
<property name="build.compiler" value="modern"/>
<property name="debug" value="off"/>
<!-- Image conversion parameters -->
<property name="nisp.image.ext" value="svg"/>
<property name="nisp.image.mimetype" value="image/svg+xml"/>
<property name="nisp.image.dpi" value="90"/>
<property name="nisp.image.quality" value="0.9"/>
<property name="dpi.raster" value="100"/>
<!-- =================================================================== -->
<!-- Defines paths/names of prerequisite jar files we compile against -->
<!-- =================================================================== -->
<property name="lib.dir" value="${basedir}/lib"/>
<!-- Relative locations of source directories -->
<property name="src.dir" value="${basedir}/src"/>
<!-- Build and distribution output areas -->
<property name="build.dir" value="${basedir}/build"/>
<property name="build.resolve" value="${basedir}/build.src"/>
<property name="build.fo" value="${build.dir}/pdf"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="zip.dir" value="${basedir}/zip"/>
<!-- NISP XSLT stylesheets used in the building process -->
<property file="xsl/user.build.properties"/>
<property file="xsl/xsl.properties"/>
<!-- =================================================================== -->
<!-- User defined properties -->
<!-- =================================================================== -->
<property file="local.user.properties"/>
<property file="user.properties"/>
<!-- =================================================================== -->
<!-- NISP lifecycle parameters (DO NOT MODIFY ANY OF THESE) -->
<!-- =================================================================== -->
<!-- possiple values (draft, final, board, release) -->
<property name="nisp.lifecycle.stage" value="draft"/>
<property name="nisp.lifecycle.postfix" value=""/>
<property name="nisp.class.label" value="'NATO/EAPC UNCLASSIFIED'"/>
<property name="nisp.release.label" value="'RELEASABLE TO AUS, NZL & SGP'"/>
<property name="nisp.draft.watermark" value="'yes'"/>
<property name="nisp.lifecycle.opts"
value="nisp.lifecycle.stage=${nisp.lifecycle.stage}
nisp.class.label=${nisp.class.label}
nisp.release.label=${nisp.release.label}
draft.mode=${nisp.draft.watermark}
nisp.revision=${src-revision}"/>
<!-- =================================================================== -->
<!-- External application specific parameter -->
<!-- =================================================================== -->
<!-- Saxon XSLT extension functions jar -->
<property name="jar-saxon-ext" value="saxon65.jar"/>
<!-- XSLT Processor -->
<property name="xslt.class" value="com.icl.saxon.StyleSheet"/>
<!-- Saxon options -->
<property name="xslt.opts"
value="-x org.apache.xml.resolver.tools.ResolvingXMLReader
-y org.apache.xml.resolver.tools.ResolvingXMLReader
-r org.apache.xml.resolver.tools.CatalogResolver"/>
<!-- Allows XInclude procesing -->
<property name="use.dom"
value="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
<property name="use.sax"
value="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
<property name="use.xinc"
value="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
<!-- Batik Class -->
<property name="batik-class"
value="org.apache.batik.apps.rasterizer.Main"/>
<!-- Validation Class -->
<property name="valid.class"
value="sax.Counter"/>
<property name="fop.message"
value="info"/>
<!-- =================================================================== -->
<!-- Build Classpaths for Xerces, Saxon, Fop and Batik -->
<!-- =================================================================== -->
<path id="lib-xerces-classpath">
<fileset dir="${lib.dir}">
<include name="xercesImpl*.jar"/>
<include name="xml-apis*.jar"/>
</fileset>
</path>
<path id="lib-saxon-classpath">
<pathelement path="${lib.dir}"/>
<fileset dir="${lib.dir}">
<include name="batik*.jar"/>
<include name="xercesImpl*.jar"/>
<include name="xml-apis*.jar"/>
<include name="resolver*.jar"/>
<include name="saxon*.jar"/>
</fileset>
<fileset dir="${docbook-xsl.dir}/extensions/">
<include name="${jar-saxon-ext}"/>
</fileset>
</path>
<path id="lib-fop-classpath">
<fileset dir="${lib.dir}">
<include name="batik*.jar"/>
<include name="xml-apis*.jar"/>
<include name="resolver*.jar"/>
<include name="xercesImpl*.jar"/>
<include name="fop-*.jar"/>
<include name="xmlgraphics-commons-*.jar"/>
<include name="avalon*.jar"/>
<include name="xml*.jar"/>
<include name="common*.jar"/>
<include name="itext*.jar"/>
<include name="bigpdf*.jar"/>
</fileset>
</path>
<path id="lib-batik-classpath">
<fileset dir="${lib.dir}">
<include name="batik-all*.jar"/>
<include name="RasterizerTask*.jar"/>
<include name="xml-apis*.jar"/>
<include name="xmlgraphics-commons-*.jar"/>
</fileset>
</path>
<xmlcatalog id="allcatalogs">
<catalogpath>
<pathelement location="catalog.xml"/>
</catalogpath>
</xmlcatalog>
<!-- Batik Rasterizer Ant Task -->
<taskdef name="rasterize"
classname="org.apache.tools.ant.taskdefs.optional.RasterizerTask"
classpathref="lib-batik-classpath"/>
<!-- FOP Ant task -->
<taskdef name="fop"
classname="org.apache.fop.tools.anttasks.Fop"
classpathref="lib-fop-classpath"/>
<!-- JGit Describe task -->
<taskdef name="git-describe"
classname="org.mdonoughe.JGitDescribeTask"
classpath="lib/jgit-describe.jar:lib/org.eclipse.jgit-1.3.0-SNAPSHOT.jar"/>
<!-- =================================================================== -->
<!-- Creates output build directories and doc prerequistes -->
<!-- =================================================================== -->
<target name="-build-check">
<uptodate property="build-uptodate" targetfile="build.targets">
<srcfiles dir="${src.dir}" includes="documents.xml VERSION"/>
<srcfiles dir="${xsl-styles.dir}" includes="makebuild.xsl"/>
</uptodate>
</target>
<target name="-newbuild" depends="-build-check" unless="build-uptodate">
<fail message="Build file is not uptodate, please run: build -f newbuild.xml"/>
</target>
<target name="checkdb" description="* Show database information">
<mkdir dir="${build.dir}"/>
<java classname="${xslt.class}" fork="yes">
<arg line="-o ${build.dir}/build.uuid
${basedir}/src/standards/standards.xml
${xsl-styles.dir}/checkdb.xsl"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="-newdb" depends="checkdb">
<property file="${build.dir}/build.uuid"/>
<condition property="no-uuids-missing">
<equals arg1="${missing.uuids}" arg2="0"/>
</condition>
<fail message="Please run: build -f uuid-build.xml"
unless="no-uuids-missing"/>
</target>
<target name="-get-describe">
<!-- Get describe parameter -->
<git-describe dir="${basedir}/.git" property="describe"/>
</target>
<target name="init" depends="-newbuild, -newdb, -get-describe">
<echo message="NISP Build system - ver. ${tool-version}. Released on ${tool-date}"/>
<echo message="compiling sources ver. ${src-version}."/>
<tstamp/>
<mkdir dir="${build.dir}"/>
<!-- We do not need this file anymore -->
<delete file="${build.dir}/build.uuid"/>
<mkdir dir="${build.acronyms}"/>
<mkdir dir="${build.resolve}"/>
<mkdir dir="${build.fo}"/>
<mkdir dir="${build.dir}/debug/"/>
<mkdir dir="${build.dir}/rtf/"/>
<copy todir="${build.dir}/css"
preservelastmodified="yes">
<fileset dir="${basedir}/xsl/css"/>
</copy>
<!--
<copy todir="${build.dir}/javascripts"
preservelastmodified="yes">
<fileset dir="${basedir}/xsl/javascripts"/>
</copy>
-->
<copy todir="${build.dir}/fonts"
preservelastmodified="yes">
<fileset dir="${basedir}/xsl/fonts"/>
</copy>
<copy todir="${build.dir}/images"
preservelastmodified="yes">
<fileset dir="${basedir}/xsl/images"/>
</copy>
<available property="hcc.present" file="${hhc}"/>
<condition property="hcc.message" value="Compiling HTMLHelp file">
<equals arg1="${hcc.present}" arg2="true"/>
</condition>
<condition property="hcc.message"
value="WARNING: The HELP Compiler is not located at ${hhc}">
<not>
<equals arg1="${hcc.present}" arg2="true"/>
</not>
</condition>
<echo message="${hcc.message}"/>
<available property="xfc.present" classname="com.xmlmind.fo.converter.Driver"
classpath="lib-xfc-classpath"/>
<mkdir dir="${build.dir}/htmlhelp"/>
<mkdir dir="${build.dir}/htmlhelp/figures"/>
<copy todir="${build.dir}/htmlhelp"
preservelastmodified="yes"
file="${xsl-styles.dir}/css/htmlhelp.css"/>
<copy todir="${build.dir}"
preservelastmodified="yes"
file="${basedir}/src/RFCP-Form.doc"/>
<echo message="Generating NISP with revision ${describe}"/>
</target>
<!-- =================================================================== -->
<!-- Default target and global HTML and PDF targets -->
<!-- =================================================================== -->
<target name="all" description="* Create all volumes for in HTML5 and PDF"
depends="init, html, pdf"/>
<!-- =================================================================== -->
<!-- Various targets to the NISP master documents -->
<!-- =================================================================== -->
<target name="createPDFcoverdoc">
<java classname="${xslt.class}" fork="yes" dir="${basedir}">
<arg line="-o ${basedir}/src/master/PDFcoverdoc.xml ${basedir}/src/documents.xml
${basedir}/xsl/PDFcoverdoc.xsl nisp.lifecycle.stage=${nisp.lifecycle.stage}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="master-check" depends="init, createPDFcoverdoc">
<uptodate property="master.notRequired"
targetfile="${build.dir}/index.html">
<srcfiles dir="${src.dir}/master" includes="*.xml"/>
<srcfiles dir="${src.dir}" includes="documents.xml"/>
<srcfiles dir="${xsl-xhtml.dir}" includes="${xsl-master}"/>
<srcfiles dir="${xsl-styles.dir}" includes="${xsl-all-master}"/>
</uptodate>
</target>
<target name="master" description="* Create the NISP master documents as HTML5 pages"
depends="master-check" unless="master.notRequired">
<echo message="Creating the NISP master documents"/>
<!--
<xslt basedir="${src.dir}/master" destdir="${build.dir}"
style="${xsl-xhtml.dir}/master.xsl"
includes="*.xml">
<param name="nisp.lifecycle.stage" expression="${nisp.lifecycle.stage}"/>
<param name="nisp.lifecycle.postfix" expression="${nisp.lifecycle.postfix}"/>
</xslt>
-->
<java classname="${xslt.class}" fork="yes" dir="${build.dir}">
<arg line="${xslt.opts} -o ${build.dir}/ ${src.dir}/master/
${xsl-xhtml.dir}/master.xsl ${nisp.lifecycle.opts}
datestamp=${DSTAMP}
describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
<!-- After upgrading to Java 1.4 and Saxon 6.5.3 all output files
suddenly have the extension .xml -->
<move todir="${build.dir}">
<fileset dir="${build.dir}"/>
<mapper type="glob" from="*.xml" to="*.html"/>
</move>
</target>
<!-- =================================================================== -->
<!-- Various targets to build the acronyms documents -->
<!-- =================================================================== -->
<property name="src.acronyms" value="${src.dir}/acronyms"/>
<property name="build.acronyms" value="${build.dir}/acronyms"/>
<property name="xsl-acro" value="acronyms.xsl"/>
<target name="acronyms-check" depends="init">
<uptodate property="acronyms.notrequired"
targetfile="${build.acronyms}/index.html">
<srcfiles dir="${src.acronyms}" includes="acronyms.xml"/>
<srcfiles dir="${src.acronyms}/letter" includes="*.xml"/>
<srcfiles dir="${xsl-xhtml.dir}" includes="acronyms.xsl"/>
<srcfiles dir="${xsl-styles.dir}" includes="${xsl-all-acro}"/>
</uptodate>
</target>
<target name="acronyms"
description="* Create the acronyms as chunked HTML5 pages"
depends="init, acronyms-check" unless="acronyms.notrequired">
<echo message="Create the acronyms as chunked XHTML pages"/>
<java classname="${xslt.class}" fork="yes" dir="${build.acronyms}">
<arg line="${xslt.opts} ${src.acronyms}/acronyms.xml
${xsl-xhtml.dir}/acronyms.xsl ${nisp.lifecycle.opts} datestamp=${DSTAMP} describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Layout templates -->
<!-- =================================================================== -->
<target name="layout-fo-check" depends="init">
<uptodate property="layout-fo.notRequired"
targetfile="${xsl-fo.dir}/nisp-titlepages.xsl">
<srcfiles dir="${xsl-fo.dir}" includes="nisp-titlepage-spec.xml"/>
<srcfiles dir="${docbook-xsl.dir}/template" includes="templates.xsl"/>
</uptodate>
</target>
<target name="layout-fo" depends="layout-fo-check"
unless="layout-fo.notRequired">
<echo message="Creating Layout for fo documents"/>
<java classname="${xslt.class}" fork="yes" dir="${xsl-fo.dir}">
<arg line="${xslt.opts} -o nisp-titlepages.xsl
${xsl-fo.dir}/nisp-titlepage-spec.xml
${docbook-xsl.dir}/template/titlepage.xsl"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Targets -->
<!-- =================================================================== -->
<import file="build.targets"/>
<!-- =================================================================== -->
<!-- Utility function -->
<!-- =================================================================== -->
<!-- =================================================================== -->
<!-- Create a HTMLHelp version of all the documents -->
<!-- =================================================================== -->
<target name="merge.check" depends="init">
<uptodate property="merge.notRequired"
targetfile="${build.dir}/htmlhelp/nisp.xml">
<srcfiles dir="${build.resolve}" includes="*.xml"/>
<srcfiles dir="${xsl-htmlhelp.dir}" includes="mkset.xsl"/>
</uptodate>
</target>
<!-- Combine all document into one set -->
<target name="merge"
depends="resolve, merge.check"
unless="merge.notRequired">
<echo message="Merge all volumes into a set"/>
<java classname="${xslt.class}" fork="yes"
dir="${build.dir}/htmlhelp">
<arg line="${xslt.opts} -o nisp.xml ${basedir}/src/documents.xml
${basedir}/xsl/htmlhelp/mkset.xsl"/>
<classpath refid="lib-saxon-classpath"/>
<jvmarg value="${use.sax}"/>
<jvmarg value="${use.dom}"/>
<jvmarg value="${use.xinc}"/>
</java>
</target>
<target name="chunk.check" depends="init">
<uptodate property="chunk.notRequired"
targetfile="${build.dir}/htmlhelp/index.html">
<srcfiles dir="${build.dir}/htmlhelp" includes="nisp.xml"/>
<srcfiles dir="${xsl-htmlhelp.dir}" includes="htmlhelp.xsl"/>
</uptodate>
</target>
<!-- Create a chunked version of the master set -->
<target name="chunk"
depends="init, merge, chunk.check, getfigs"
unless="chunk.notRequired">
<java classname="${xslt.class}" maxmemory="300M" fork="yes"
dir="${build.dir}/htmlhelp">
<jvmarg value="-Xss512k"/>
<arg line="${xslt.opts} ${build.dir}/htmlhelp/nisp.xml
${basedir}/xsl/htmlhelp/htmlhelp.xsl
use.para.numbering=${use.para.numbering}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="chm.check">
</target>
<target name="chm"
depends="chunk, chm.check, svg"
if="hcc.present">
<exec executable="${hhc}"
dir="${build.dir}/htmlhelp">
<arg line="htmlhelp.hhp"/>
</exec>
</target>
<target name="no.chm" unless="hcc.present">
<echo>WARNING: The HELP Compiler is not located at ${hhc}</echo>
</target>
<target name="htmlhelp"
description="* Create HTMLHelp version of the NISP"
if="hcc.present">
<antcall target="chm"/>
<antcall target="no.chm"/>
</target>
<target name="dbvalid">
<xmlvalidate failonerror="no">
<fileset dir="src/standards/" includes="standards.xml"/>
<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
</xmlvalidate>
</target>
<!-- =================================================================== -->
<!-- Create Debugging Reports -->
<!-- =================================================================== -->
<target name="debug" description="* [DEBUG] Create misc. debugging reports"
depends="init, deb-overview, deb-current, deb-dates, deb-upcoming, deb-rp">
</target>
<target name="debug-figs" description="* [DEBUG] Create misc. debugging reports and figure reports"
depends="debug, deb-info, deb-figures">
</target>
<target name="deb-overview" description="* [DEBUG] Create DB Overview"
depends="-get-describe">
<java classname="${xslt.class}" fork="yes"
dir="${build.dir}/debug/">
<arg line="${xslt.opts} -o overview.html
${basedir}/src/standards/standards.xml
${xsl-debug.dir}/deb-overview.xsl
describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="deb-current" description="* [DEBUG] Create DB Overview"
depends="-get-describe">
<java classname="${xslt.class}" fork="yes"
dir="${build.dir}/debug/">
<arg line="${xslt.opts} -o current.html
${basedir}/src/standards/standards.xml
${xsl-debug.dir}/deb-current.xsl
describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="deb-dates" description="* [DEBUG] Create DB Dated list"
depends="-get-describe">
<java classname="${xslt.class}" fork="yes"
dir="${build.dir}/debug/">
<arg line="${xslt.opts} -o dates.html
${basedir}/src/standards/standards.xml
${xsl-debug.dir}/deb-dates.xsl
describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="deb-upcoming" description="* [DEBUG] Create list of upcoming/fading standards/profiles"
depends="-get-describe">
<java classname="${xslt.class}" fork="yes"
dir="${build.dir}/debug/">
<arg line="${xslt.opts} -o upcoming.html
${basedir}/src/standards/standards.xml
${xsl-debug.dir}/deb-upcoming.xsl
describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="deb-rp" description="* [DEBUG] Create list of responsible parties"
depends="-get-describe">
<java classname="${xslt.class}" fork="yes"
dir="${build.dir}/debug/">
<arg line="${xslt.opts} -o responsibleparties.html
${basedir}/src/standards/standards.xml
${xsl-debug.dir}/deb-rp.xsl
describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="deb-info" description="* [DEBUG] Show infomation about all documents"
depends="resolve, svg">
<echo message="Building infofile in debug/info.html"/>
<java classname="${xslt.class}" fork="yes">
<arg line="${xslt.opts} -o ${build.dir}/debug/info.html
${basedir}/src/documents.xml
${xsl-debug.dir}/deb-info.xsl nisp.image.ext=${nisp.image.ext}
describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
</target>
<target name="deb-figures" description="* [DEBUG] Show all figures"
depends="resolve">
<echo message="Building all figures in debug/figures.pdf"/>
<java classname="${xslt.class}" fork="yes">
<arg line="${xslt.opts} -o ${build.dir}/debug/figures.fo
${basedir}/src/documents.xml
${xsl-debug.dir}/deb-figures.xsl nisp.image.ext=${nisp.image.ext}
describe=${describe}"/>
<classpath refid="lib-saxon-classpath"/>
</java>
<fop basedir="${build.dir}/debug" fofile="${build.dir}/debug/figures.fo" outfile="${build.dir}/debug/figures.pdf" format="application/pdf" userconfig="${basedir}/lib/fop.xconf"/>
<delete file="${build.dir}/debug/figures.fo"/>
</target>
<!-- =================================================================== -->
<!-- Create documentation -->
<!-- =================================================================== -->
<macrodef name="makemanpage">
<attribute name="manpage"/>
<sequential>
<echo>Create the @{manpage} manpage</echo>
<exec os="Linux" executable="pandoc" dir="${basedir}/xdocs/">
<arg value="-s"/>
<arg value="-thtml5"/>
<arg value="-cman.css"/>
<arg value="--template=nisp-default.html5"/>
<arg value="-o@{manpage}.html"/>
<arg value="@{manpage}.md"/>
</exec>
</sequential>
</macrodef>
<target name="doc" description="* Create documentation pages">
<makemanpage manpage="index"/>
<makemanpage manpage="nisp-database"/>
<makemanpage manpage="nisp-database-schema"/>
<makemanpage manpage="nisp-install"/>
<makemanpage manpage="nisp-debug"/>
<makemanpage manpage="nisp-build"/>
<move todir="${basedir}/docs/">
<fileset dir="${basedir}/xdocs/" includes="*.html"/>
</move>
<copy todir="${basedir}/docs/"
preservelastmodified="yes"
file="${xsl-styles.dir}/css/man.css"/>
</target>
<!-- =================================================================== -->
<!-- Make Distributions (source, tool, xsl, web, pdf-only) -->
<!-- =================================================================== -->
<!-- Create the source distribution -->
<target name="source" description="* Create a new source distribution">
<mkdir dir="${zip.dir}"/>
<zip zipfile="${zip.dir}/${name}-src-${src-version}.zip">
<zipfileset dir="${src.dir}" includes="**/*"
excludes="**/*~,**/rtf/*.*, **/*/*.ced,
**/*/*.fo, **/.svn
figures/obsolete, figures/obsolete/*"/>
</zip>
</target>
<!-- Create the web distribution -->
<target name="web" description="* Create the website containing the NISP"
depends="all, htmlhelp">
<mkdir dir="${zip.dir}"/>
<zip zipfile="${zip.dir}/${name}-web-${src-version}${nisp.lifecycle.postfix}.zip">
<zipfileset dir="${build.dir}"
prefix="${name}-${src-version}"
excludes="pdf/*.fo,
**/htmlhelp/**/*.xml,
**/htmlhelp/figures/,
**/htmlhelp/*.h*,
**/htmlhelp/*.css,
**/rtf/**,
**/figures/*.svg,
**/.svn,
**/debug/**"/>
</zip>
</target>
<!-- Create archive with the resolved sources -->
<target name="resolve.zip" description="* Create a resolved version of the XML sources"
depends="resolve">
<mkdir dir="${zip.dir}"/>
<zip zipfile="${zip.dir}/${name}-src-resolve-${src-version}.zip">
<zipfileset dir="${build.resolve}"/>
</zip>
</target>
<!-- Create the tools distribution -->
<target name="tool" description="* Create a new tool distribution"
depends="new-dtd">
<mkdir dir="${zip.dir}"/>
<mkdir dir="${dist.dir}/src"/>
<copy todir="${dist.dir}/bin"
preservelastmodified="yes">
<fileset dir="${basedir}/bin"/>
</copy>
<mkdir dir="${dist.dir}/docs"/>
<copy todir="${dist.dir}/docs"
preservelastmodified="yes">
<fileset dir="${basedir}/docs"
includes="manual.pdf, README"/>
</copy>
<mkdir dir="${dist.dir}/xdocs"/>
<copy todir="${dist.dir}/xdocs"
preservelastmodified="yes">
<fileset dir="${basedir}/xdocs"
excludes="*.ced"/>
</copy>
<copy todir="${dist.dir}/extra"
preservelastmodified="yes">
<fileset dir="${basedir}/extra"/>
</copy>
<copy todir="${dist.dir}/lib"
preservelastmodified="yes">
<fileset dir="${basedir}/lib">
<exclude name="java/build/**"/>
</fileset>
</copy>
<copy todir="${dist.dir}/schema"
preservelastmodified="yes">
<fileset dir="${basedir}/schema"/>
</copy>
<copy todir="${dist.dir}/xsl"
preservelastmodified="yes">
<fileset dir="${basedir}/xsl">
<exclude name="**/*.fo"/>
<exclude name="docbook-xsl/doc*/**"/>
<exclude name="docbook-xsl/javahelp/**"/>
<exclude name="docbook-xsl/params/**"/>
<exclude name="docbook-xsl/extensions/doc/**"/>
<exclude name="docbook-xsl/extensions/manpages/**"/>
<exclude name="docbook-xsl/extensions/xalan*/**"/>
<exclude name="docbook-xsl/extensions/saxon5/**"/>
<exclude name="docbook-xsl/extensions/saxon64*/**"/>
<exclude name="docbook-xsl/extensions/xsltproc*/**"/>
<exclude name="docbook-xsl/epub*/**"/>
<exclude name="docbook-xsl/eclipse*/**"/>
<exclude name="docbook-xsl/slides*/**"/>
<exclude name="docbook-xsl/website*/**"/>
<exclude name="docbook-xsl/sxw/**"/>
</fileset>
</copy>
<copy todir="${dist.dir}" preservelastmodified="yes">
<fileset dir="${basedir}"
includes="README, build.xml, build.targets, newbuild.xml,
build.bat, build.sh,
build-internet.xml, user.properties, INSTALL,
VERSION, WhatsNew, catalog.xml"/>
</copy>
<zip zipfile="${zip.dir}/${name}-tools-${tool-version}.zip">
<zipfileset dir="${dist.dir}" includes="**/*" excludes="**/.svn"
prefix="${name}-tools-${tool-version}"/>
</zip>
</target>
<!-- Create a styleheet distribution -->
<target name="xsl">
<mkdir dir="${zip.dir}"/>
<copy todir="${dist.dir}/xsl"
preservelastmodified="yes">
<fileset dir="${basedir}/xsl">
<exclude name="docbook-xsl/doc*/**"/>
<exclude name="docbook-xsl/javahelp/**"/>
<exclude name="docbook-xsl/params/**"/>
<exclude name="docbook-xsl/extensions/doc/**"/>
<exclude name="docbook-xsl/extensions/manpages*/**"/>
<exclude name="docbook-xsl/extensions/xalan*/**"/>
<exclude name="docbook-xsl/extensions/saxon5/**"/>
<exclude name="docbook-xsl/extensions/saxon64*/**"/>
<exclude name="docbook-xsl/extensions/xsltproc*/**"/>
<exclude name="docbook-xsl/epub*/**"/>
<exclude name="docbook-xsl/eclipse*/**"/>
<exclude name="docbook-xsl/slides*/**"/>
<exclude name="docbook-xsl/website*/**"/>
<exclude name="docbook-xsl/sxw/**"/>
</fileset>
</copy>
<zip zipfile="${zip.dir}/${name}-xsl-${tool-version}${style-rev}.zip">
<zipfileset dir="${dist.dir}/xsl" includes="**/*"/>
</zip>
</target>
<!-- Create a pdf-only distribution -->
<target name="pdf-only" description="* Create a zip containing only PDF files"
depends="pdf">
<zip zipfile="${zip.dir}/${name}-pdf-${src-version}${nisp.lifecycle.postfix}.zip">
<zipfileset dir="${build.dir}/pdf" includes="*.pdf"/>
</zip>
</target>
<!-- Create all archive distribution -->
<target name="zip" description="* Create source, tool, xsl, web and pdf archives"
depends="source, tool, xsl, web, pdf-only"/>
<!-- =================================================================== -->
<!-- Various targets to clean -->
<!-- =================================================================== -->
<target name="clean-build" description="* Clean the build directories">
<delete dir="${build.dir}"/>
<delete dir="${build.resolve}"/>
</target>
<target name="clean-dist"
description="* Clean the distribution directories">
<delete dir="${dist.dir}"/>
</target>
<target name="clean-zip"
description="* Clean the distribution zip directories">
<delete dir="${zip.dir}"/>
</target>
<target name="clean" description="* Clean all"
depends="clean-build, clean-dist"/>
<!-- =================================================================== -->
<!-- Internal usage only -->
<!-- =================================================================== -->
<target name="new-dtd">
<antstructure output="schema/dtd/ant.dtd"/>
</target>
<!-- Create a raw version of the stylesheets (Everything except
Norman Walsh's DocBook XSL collection) -->
<target name="raw-xsl">
<mkdir dir="${zip.dir}"/>
<zip zipfile="${zip.dir}/${name}-raw-xsl-${dbxsl-version}.zip">
<zipfileset dir="${basedir}/xsl" prefix="xsl-${dbxsl-version}"
includes="**" excludes="docbook-*/**, sxw*/**"/>
</zip>
</target>
<!-- (use PC style CR/LF) -->
<target name="fixCRLFsource">
<fixcrlf srcdir="${src.dir}" eol="crlf"
excludes="**/*.jpg, **/*.gif,
. dtd/docbkx412/**, dtd/docbkx42CR1/**,
dtd/docbkx42/**"/>
</target>
<target name="fixCRLFtools">
<fixcrlf srcdir="" eol="crlf"
excludes="**/*.jpg, **/*.gif, **/*.jar, **/*.sh"/>
</target>
</project>