-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
159 lines (132 loc) · 5.51 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
<?xml version="1.0"?>
<project name="GISCDM-DOCUMENTS" basedir="." default="compile">
<!-- Build Properties -->
<property file="build.properties" />
<!-- Default location of the DocBook XSL library -->
<property name="docbook.home" value="${env.DOCBOOK_HOME}" />
<!-- Default location of Apache FOP -->
<property name="fop.home" value="${env.FOP_HOME}" />
<!-- FOP/Xalan Classpath -->
<path id="fop.classpath">
<fileset dir="${fop.home}/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${fop.home}/build">
<include name="*.jar" />
</fileset>
</path>
<!-- FOP Ant Task -->
<taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
<classpath refid="fop.classpath" />
</taskdef>
<!-- Creates directories for DocBook output -->
<target name="prepare" depends="license,version" description="Creates directories for DocBook output">
<echo message="Creating html directory" />
<mkdir dir="html" />
</target>
<target name="license" description="Creates License.xml">
<echo message="Creating License.xml" />
<exec executable="./make-license"/>
</target>
<target name="version" description="Creates version.xml">
<echo message="Creating version.xml" />
<exec executable="./make-version"/>
</target>
<!-- Copy over static content into output area for HTML output -->
<target name="prepare-html" depends="prepare" description="Prepare for HTML output">
<copy todir="html/images">
<fileset dir="images">
<exclude name="**/.svn" />
<exclude name="**/*.sdr" />
</fileset>
</copy>
<copy todir="html/css">
<fileset dir="css" excludes="**/.svn"/>
</copy>
</target>
<!-- Prepare for PDF output -->
<target name="prepare-pdf" depends="prepare" description="Prepare for PDF output">
<mkdir dir="pdf" />
</target>
<!-- Remove files and directories created during the build process -->
<target name="clean" description="Remove files and directories created during the build process">
<echo message="Removing build files" />
<delete dir="build" />
<delete dir="html" />
<delete dir="pdf" />
<delete dir="tmp" />
<delete file="xsl/custom-titlepage.xsl" />
</target>
<!-- Transform DocBook into single xhtml file -->
<target name="compile-xhtml" depends="prepare-html" description="Transform DocBook into XHTML">
<echo message="Transforming DocBook into XHTML" />
<xslt classpathref="fop.classpath"
basedir="src"
destdir="build/xhtml"
includes="multigraph.xml"
style="xsl/custom-xhtml.xsl" />
</target>
<!-- Transform DocBook into single html file -->
<!--
<target name="compile-html-single" depends="prepare-html" description="Transform DocBook into single html file">
<echo message="Transforming DocBook into HTML (single)" />
<xslt classpathref="fop.classpath"
basedir="src"
destdir="build/html-single"
includes="**/*.xml"
style="xsl/custom-html.xsl" />
</target>
-->
<!-- Transform DocBook into multiple html files (chunked) -->
<target name="compile-html-chunk" depends="prepare-html" description="Transform DocBook into multiple html files (chunked)">
<echo message="Transforming DocBook into HTML (chunk)" />
<xslt classpathref="fop.classpath"
basedir="src"
destdir="tmp"
includes="multigraph.xml"
style="xsl/custom-chunk.xsl">
<param name="base.dir" expression="${basedir}/html/" /> <!-- This parameter must be passed to XSL to set proper output directory -->
<param name="version" expression="THE_VERSION" />
</xslt>
</target>
<!-- Compile DocBook title page customizations from title page spec file (for FO output)
This creates a title page attributes stylesheet that is used to format the title page for XML-FO and PDF output
-->
<target name="compile-titlepage" description="Compile DocBook title page customizations from title page spec file (for FO output)">
<echo message="Creating DocBook title page customizations" />
<xslt classpathref="fop.classpath"
in="xsl/titlepage.spec.xml"
out="xsl/custom-titlepage.xsl"
style="${docbook.home}/template/titlepage.xsl" />
</target>
<!-- Transform DocBook into XML-FO. This is the intermediate format needed to convert DocBook to PDF -->
<target name="compile-fo" depends="prepare, compile-titlepage" description="Transform DocBook into XML-FO (intermediate to PDF)">
<echo message="Transforming DocBook into XML-FO" />
<xslt classpathref="fop.classpath"
basedir="src"
destdir="tmp"
includes="multigraph.xml"
extension=".fo"
style="xsl/custom-fo.xsl" />
</target>
<!-- Transform XML-FO from compile-fo into PDF. This takes the XML-FO generated by compile-fo and converts it into PDF. -->
<target name="compile-pdf" depends="compile-fo, prepare-pdf" description="Transform XML-FO from compile-fo into PDF">
<echo message="Compiling XML-FO into PDF" />
<fop format="application/pdf" basedir="tmp" outdir="pdf">
<fileset dir="tmp">
<include name="*.fo" />
</fileset>
</fop>
</target>
<!-- Compile all output formats -->
<target name="compile" description="Compile all output formats">
<echo message="Compiling All" />
<antcall target="compile-xhtml" />
<antcall target="compile-html-chunk" />
<!--
<antcall target="compile-html-single" />
<antcall target="compile-pdf" />
-->
</target>
<target name="pdf" description="Generate PDF" depends="compile-pdf"/>
</project>