summaryrefslogtreecommitdiff
path: root/doc/book/build.xml
blob: 5acd97f982c6e89764828cbfaed3b7e2ab9ccda6 (plain)
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
<!--
 -
 - Licensed to the Apache Software Foundation (ASF) under one
 - or more contributor license agreements.  See the NOTICE file
 - distributed with this work for additional information
 - regarding copyright ownership.  The ASF licenses this file
 - to you under the Apache License, Version 2.0 (the
 - "License"); you may not use this file except in compliance
 - with the License.  You may obtain a copy of the License at
 - 
 -   http://www.apache.org/licenses/LICENSE-2.0
 - 
 - Unless required by applicable law or agreed to in writing,
 - software distributed under the License is distributed on an
 - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 - KIND, either express or implied.  See the License for the
 - specific language governing permissions and limitations
 - under the License.
 -
 -->
<!-- 
     Build Apache Qpid documentation.

     For documentation on using XSLT in ant, see http://ant.apache.org/manual/CoreTasks/style.html

     For documentation on using Apache FOP in ant, see http://xmlgraphics.apache.org/fop/0.94/anttask.html

     Note: Validation is currently off by default, too many dangling references. We will tighten this up as soon as we can.
 -->

<project 
     name="generate"   
     basedir="."
     default="pdf"> 

  <property name="Qpid" value="http://qpid.apache.org"/>


<!--
###########################################################################
# 
# Directories 
#
# Change the directory paths in  this section to the correct paths for
# your machine.
#
###########################################################################
-->

  <property name="src.dir" location="src"/>
  <property name="build.dir" location="build"/>
  <property name="out.dir" location="out"/>

  <!-- Docbook schemas and stylesheets -->
  <property name="schema.dir" location="docbook"/>    
  <property name="style.dir" location="docbook-xsl"/>    
  <property name="fo.stylesheet" location="${style.dir}/fo/docbook.xsl" />
  <property name="html.stylesheet" location="${style.dir}/html/docbook.xsl" />

  <!-- ${lib.dir} has subdirectories for saxon and fop -->
  <property name="lib.dir" location="lib"/>

  <property name="xmllint" location="/usr/bin/xmllint"/>

<!--
###########################################################################
#
# Setting up tasks
#
# You shouldn't need to change anything in this section or following sections.
#
###########################################################################
-->

  <path id="saxon6.classpath">
    <pathelement location="${lib.dir}/saxon/resolver.jar"/>
    <pathelement location="${lib.dir}/saxon/xml-apis.jar"/>
    <pathelement location="${lib.dir}/saxon/xercesImpl.jar"/>
    <pathelement location="${lib.dir}/saxon/saxon.jar"/>
  </path>

<taskdef name="fop" 
         classname="org.apache.fop.tools.anttasks.Fop">
  <classpath>
    <fileset dir="${lib.dir}/fop-0.95/lib">
      <include name="*.jar"/>
    </fileset>
    <fileset dir="${lib.dir}/fop-0.95/build">
      <include name="fop.jar"/>
      <include name="fop-hyph.jar" />
    </fileset>
  </classpath>
</taskdef>

<!--
###########################################################################
#
# Tasks
#
###########################################################################
-->

<!--
    init
-->

<target name="init">
  <mkdir dir="${build.dir}"/>
  <mkdir dir="${out.dir}"/>
</target>

<!--
    XInclude
-->

<target name="xinclude" depends="init">
  <exec executable="${xmllint}">
    <arg value="-o"/>
    <arg value="${build.dir}/xinclude.xml"/>
    <arg value="--xinclude"/>
    <arg value="${src.dir}/Book.xml"/>
  </exec>
</target>



<!--
    FO
-->

 <target name="fo" depends="xinclude" description="Generates qpid-book.fo, which is needed to create a PDF">

    <xslt in="${build.dir}/xinclude.xml" out="${build.dir}/qpid-book.fo"
          style="${fo.stylesheet}" classpathref="saxon6.classpath">
      <param name="specdoc" expression="${spec.code}"/>
      <param name="uri" expression="${spec.uri}"/>
    </xslt>
  </target>


<!--
    PDF
-->

<target name="pdf" depends="fo" description="Generates qpid-book.pdf">
   <fop format="application/pdf" 
        fofile="${build.dir}/qpid-book.fo"
        outfile="${out.dir}/qpid-book.pdf"/>
</target
>
<!--
    HTML
-->

 <target name="html" depends="xinclude" description="Generates qpid-book.html">
    <xslt in="${build.dir}/xinclude.xml" out="${out.dir}/qpid-book.html"
          style="${html.stylesheet}" classpathref="saxon6.classpath">
    </xslt>
 </target>

<!--
    Validate
-->

<target name="validate" depends="xinclude">
  <xmlvalidate file="${build.dir}/xinclude.xml" warn="true">
    <dtd publicId="-//OASIS//DTD DocBook V4.5//EN"
	 location="docbook/docbook.dtd"/>
  </xmlvalidate>
</target>

<!--
    Clean
-->

<target name="clean">
  <delete dir="${build.dir}"/>
</target>

<!-- 
    Check
-->

<target name="check" depends="xinclude">
  <xmlvalidate file="${build.dir}/xinclude.xml" warn="false">
    <dtd publicId="-//OASIS//DTD DocBook V4.5//EN"
	 location="docbook/docbook.dtd"/>
  </xmlvalidate>
</target>


</project>