Skip to content

Commit 38514e2

Browse files
author
Sergey Koshcheyev
committed
Documentation build - PDF output now works
NDoc output will be named NHibernate.API.* SVN: trunk@1930
1 parent 6dff496 commit 38514e2

9 files changed

+83
-198
lines changed

NHibernateSolution.build

+9-9
Original file line numberDiff line numberDiff line change
@@ -197,23 +197,23 @@
197197

198198
</target>
199199

200-
<target name="doc" depends="init doc-clean doc-manual doc-reference"
200+
<target name="doc" depends="init doc-clean doc-manual doc-api"
201201
description="Builds the Help Documentation and the API documentation" />
202202

203203
<target name="doc-clean">
204-
<nant target="clean" buildfile="doc/documentation.build" />
204+
<nant target="clean" buildfile="doc/reference/documentation.build" />
205205
</target>
206206

207207
<target name="doc-manual" depends="init" description="Builds the Help Documentation" >
208208
<property name="lang" value="en" />
209-
<nant target="build" buildfile="doc/documentation.build">
209+
<nant target="build" buildfile="doc/reference/documentation.build">
210210
<properties>
211211
<property name="lang" value="${lang}" />
212212
</properties>
213213
</nant>
214214
</target>
215215

216-
<target name="doc-reference" depends="init" description="Generates the API documentation (in MSDN style and VS.NET 2003 if available)">
216+
<target name="doc-api" depends="init" description="Generates the API documentation (in MSDN style and VS.NET 2003 if available)">
217217
<ndoc>
218218
<assemblies basedir="${bin.dir}">
219219
<include name="NHibernate.dll" />
@@ -226,7 +226,7 @@
226226
<documenters>
227227
<documenter name="MSDN">
228228
<property name="OutputDirectory" value="${build.dir}/doc/temp" />
229-
<property name="HtmlHelpName" value="NHibernate.Reference" />
229+
<property name="HtmlHelpName" value="NHibernate.API" />
230230
<property name="IncludeFavorites" value="False" />
231231
<property name="Title" value="NHibernate Class Library - v.${project.version}" />
232232
<property name="SplitTOCs" value="False" />
@@ -287,7 +287,7 @@
287287
<documenters>
288288
<documenter name="VS.NET 2003">
289289
<property name="OutputDirectory" value="${build.dir}/doc/temp" />
290-
<property name="HtmlHelpName" value="NHibernate.Reference" />
290+
<property name="HtmlHelpName" value="NHibernate.API" />
291291
<property name="Title" value="NHibernate Class Library - v.${project.version}" />
292292
<property name="HeaderHtml" value="" />
293293
<property name="FooterHtml" value="" />
@@ -319,13 +319,13 @@
319319
</documenters>
320320
</ndoc>
321321

322-
<copy todir="${build.dir}/doc">
322+
<copy todir="${build.dir}/doc/help2">
323323
<fileset basedir="${build.dir}/doc/temp">
324324
<include name="*.HxS" />
325325
</fileset>
326326
</copy>
327-
<copy todir="${build.dir}/doc">
328-
<fileset basedir="doc/Help2">
327+
<copy todir="${build.dir}/doc/help2">
328+
<fileset basedir="doc/reference/support/help2">
329329
<include name="*" />
330330
</fileset>
331331
</copy>

build-common/common.xml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
It generates Visual Studio.NET 2003 documentation.
2323
-->
2424
<property name="vshik.installed" value="false" overwrite="false" />
25+
<property name="vshik.path" value="${environment::get-folder-path('ProgramFiles')}/Microsoft Help 2.0 SDK" />
2526

2627
<!--
2728
if nunit2report tasks from http://nunit2report.sourceforge.net/ has been installed

doc/documentation.build

-168
This file was deleted.

doc/reference/documentation.build

+61-9
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@
1010

1111
<target name="init" depends="common.init">
1212
<property name="lang" value="en" />
13-
<property name="output.dir" value="${build.dir}/doc" />
1413
<tstamp property="build.date" pattern="u" verbose="true" />
1514

15+
<property name="output.dir" value="${build.dir}/doc" />
16+
<property name="output.help2.dir" value="${output.dir}/help2" />
17+
1618
<property name="build.html.dir" value="${output.dir}" />
1719
<property name="build.single.dir" value="${build.html.dir}/html_single" />
1820
<property name="build.chunk.dir" value="${build.html.dir}/html" />
1921
<property name="build.shared.dir" value="${build.html.dir}/shared" />
20-
<property name="build.chm.dir" value="${output.dir}/chm" />
22+
<property name="build.chm.dir" value="${output.dir}/tmp-chm" />
23+
<property name="build.help2.dir" value="${output.dir}/tmp-help2" />
24+
<property name="build.pdf.dir" value="${output.dir}/tmp-pdf" />
2125

2226
<property name="hhc.exe" value="${environment::get-folder-path('ProgramFiles')}\HTML Help Workshop\hhc" />
2327

@@ -38,15 +42,15 @@
3842
<delete dir="${build.html.dir}" failonerror="false" />
3943
</target>
4044

41-
<target name="build" depends="init build-html build-chm build-help2"
45+
<target name="build" depends="init build-html build-chm build-help2 build-pdf"
4246
description="Generates the documentation in multiple formats from the Docbook files." />
4347

4448
<target name="build-html.make-directories" depends="init">
4549
<mkdir dir="${build.single.dir}" failonerror="false" />
4650
<mkdir dir="${build.chunk.dir}" failonerror="false" />
4751
</target>
4852

49-
<target name="build-html.generate" depends="init">
53+
<target name="build-html.generate" depends="init build-html.make-directories">
5054
<exec program="java" workingdir="${build.chunk.dir}">
5155
<arg value="-classpath" />
5256
<arg>
@@ -87,7 +91,7 @@
8791
</target>
8892

8993
<target name="build-html"
90-
depends="init build-html.make-directories build-html.generate build-html.copy-misc-files"
94+
depends="build-html.generate build-html.copy-misc-files"
9195
description="Generates html from docbook files." />
9296

9397
<target name="build-chm" depends="init" description="Generates chm file from docbook files.">
@@ -123,11 +127,11 @@
123127
</exec>
124128

125129
<copy file="${build.chm.dir}/htmlhelp.chm" tofile="${output.dir}/NHibernate.Documentation.chm" />
130+
131+
<delete dir="${build.chm.dir}" />
126132
</target>
127133

128134
<target name="build-help2" if="${vshik.installed}" depends="build-chm" description="Generates HtmlHelp2 file from CHM file.">
129-
<property name="build.help2.dir" value="${output.dir}/help2" />
130-
131135
<!-- convert the chm into the HxC -->
132136
<exec program="HxConv.exe" basedir="${vshik.path}">
133137
<arg path="${output.dir}/NHibernate.Documentation.chm" />
@@ -136,6 +140,8 @@
136140
<arg value="-y" />
137141
</exec>
138142

143+
<mkdir dir="${output.help2.dir}" />
144+
139145
<!--
140146
Compile the HxC into an HxS that can be included
141147
in a Help2 collection
@@ -144,20 +150,66 @@
144150
<arg value="-p" />
145151
<arg path="${build.help2.dir}/NHibernate.Documentation.HxC" />
146152
<arg value="-o" />
147-
<arg path="${output.dir}/NHibernate.Documentation.HxS" />
153+
<arg path="${output.help2.dir}/NHibernate.Documentation.HxS" />
148154
</exec>
149155

150156
<!--
151157
copying the Help2 files from cvs that describe the
152158
Help collection, not the files generated by the build
153159
that contain the content
154160
-->
155-
<copy todir="${output.dir}">
161+
<copy todir="${output.help2.dir}">
156162
<fileset basedir="support/help2/">
157163
<include name="**/*" />
158164
</fileset>
159165
</copy>
160166

167+
<delete dir="${build.help2.dir}" />
161168
</target>
169+
170+
<target name="build-pdf-prepare" depends="init">
171+
172+
<!-- Copy all the images to the output location, will be removed later. -->
173+
<copy todir="${build.pdf.dir}/images">
174+
<fileset basedir="images">
175+
<include name="**/*.png"/>
176+
<include name="**/*.svg"/>
177+
<include name="**/*.gif"/>
178+
</fileset>
179+
</copy>
180+
181+
<!-- Create the XSL/FO temporary file. -->
182+
<exec program="java">
183+
<arg value="-classpath" />
184+
<arg>
185+
<path refid="saxon.classpath"/>
186+
</arg>
187+
<arg value="com.icl.saxon.StyleSheet" />
188+
<arg value="-o"/>
189+
<arg file="${build.pdf.dir}/docbook_fop.tmp"/>
190+
<arg file="master.xml"/>
191+
<arg file="styles/fopdf.xsl"/>
192+
</exec>
193+
194+
</target>
195+
196+
<target name="build-pdf-normal" depends="build-pdf-prepare">
197+
<!-- Create a PDF from the XSL/FO. -->
198+
<exec program="java">
199+
<arg value="-classpath" />
200+
<arg>
201+
<path refid="saxon.classpath"/>
202+
</arg>
203+
<arg value="org.apache.fop.apps.Fop" />
204+
<arg value="${build.pdf.dir}/docbook_fop.tmp"/>
205+
<arg value="${output.dir}/nhibernate_reference.pdf"/>
206+
</exec>
207+
</target>
208+
209+
<target name="build-pdf" depends="build-pdf-normal">
210+
<!-- House keeping, delete temporary files. -->
211+
<delete dir="${build.pdf.dir}" />
212+
</target>
213+
162214
</project>
163215

doc/reference/master.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5b1//EN"
3-
"../docbook-xml/docbookx.dtd" [
3+
"support/docbook-dtd/docbookx.dtd" [
44
<!ENTITY preface SYSTEM "modules/preface.xml">
55
<!ENTITY quickstart SYSTEM "modules/quickstart.xml">
66
<!ENTITY architecture SYSTEM "modules/architecture.xml">

doc/reference/styles/fopdf.xsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<xsl:variable name="Version">
9393
<xsl:choose>
9494
<xsl:when test="//releaseinfo">
95-
<xsl:text>Hibernate </xsl:text>
95+
<xsl:text>NHibernate </xsl:text>
9696
<xsl:value-of select="//releaseinfo"/>
9797
</xsl:when>
9898
<xsl:otherwise>

0 commit comments

Comments
 (0)