-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathdocumentation.build
190 lines (159 loc) · 6.65 KB
/
documentation.build
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
<?xml version="1.0" ?>
<project
name="doc"
default="build"
xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd"
>
<!--
Required properties:
* build.dir - (path) root level to build documentation to. If this is not supplied
then it will be built to a folder named build under the doc folder.
-->
<!--
I have not figured out a way to modify the Path through NAnt so you
need to make sure that xsltproc is in the path.
2005-05-03: probably is doable with nant-0.85 but I'm not going to mess with
it since the easy solution is put xsltproc in the path.
-->
<!--
if Visual Studio Help Integration Kit has been installed
then change this to true or include -D:vshik.installed=true in the command line.
It generates Visual Studio.NET 2003 documentation.
-->
<property name="vshik.installed" value="false" overwrite="false" />
<!--
The path to the VSHIK executable files. If VSHIK is installed in a different path, then
specify the path in the command line using -D:vshik.path=<path>
-->
<property name="vshik.path" value="${environment::get-folder-path('ProgramFiles')}\Microsoft Help 2.0 SDK" overwrite="false" />
<property name="lang" value="en" />
<!--
set the default for where all the files are output to, if this file is being
run as part of the NHSolution build then a build.dir property will be passed
in that specifies a location to output all the files
-->
<property name="output.dir" value="build" />
<if test="${property::exists('build.dir')}">
<property name="output.dir" value="${build.dir}/doc" />
</if>
<tstamp property="build.date" pattern="u" verbose="true" />
<target name="init" unless="${target::has-executed('init')}" description="Set the documentation version and the date of generation.">
<copy file="src/Documentation.xml" tofile="src/Documentation.gen" overwrite="true" />
<!--
Modify the file "Documentation.gen" instead of the .xml one because:
- We don't have to remove these changes after building
And it would be hard because the build can fail...
- When doing <xmlpoke>, NAnt also change the layout of the xml file.
-->
<if test="${property::exists('project.version')}">
<xmlpoke
file="src/Documentation.gen"
xpath="/book/bookinfo/title"
value="NHibernate Documentation ${project.version}"
/>
</if>
<xmlpoke
file="src/Documentation.gen"
xpath="/book/bookinfo/releaseinfo"
value="Status: Production/Stable. Generated on ${build.date}."
/>
</target>
<target name="clean" description="Cleans any previous builds">
<delete dir="${output.dir}" failonerror="false" />
</target>
<target name="build" depends="init" description="Generates the documentation in multiple formats from the docbook files.">
<call target="build-html" />
<call target="build-chm" />
<call target="build-help2" />
</target>
<target name="build-html" depends="init" description="Generates html from docbook files.">
<property name="build.html.dir" value="${output.dir}" />
<property name="build.single.dir" value="${build.html.dir}/html_single" />
<property name="build.chunk.dir" value="${build.html.dir}/html" />
<mkdir dir="${build.html.dir}" failonerror="false" />
<mkdir dir="${build.single.dir}" failonerror="false" />
<mkdir dir="${build.chunk.dir}" failonerror="false" />
<exec program="xsltproc" >
<arg value="--output" />
<arg file="${build.single.dir}/index.html" /><!-- file to output transform results to -->
<arg file="html_single.xsl" /><!-- xsl to do the transforming -->
<arg file="src/Documentation.gen" /><!-- xml file to transform -->
</exec>
<exec program="xsltproc" >
<arg value="--output" />
<arg path="${build.chunk.dir}/" /><!-- dir to output transform results to (add the trailing '/' for xsltproc) -->
<arg file="html_chunk.xsl" /><!-- xsl to do the transforming -->
<arg file="src/Documentation.gen" /><!-- xml file to transform -->
</exec>
<!-- Copy the images and the stylesheet -->
<copy todir="${build.single.dir}" overwrite="true" >
<fileset basedir="./src/">
<include name="*.gif" />
<include name="html.css" />
</fileset>
</copy>
<copy todir="${build.chunk.dir}" overwrite="true" >
<fileset basedir="./src/">
<include name="*.gif" />
<include name="html.css" />
</fileset>
</copy>
</target>
<target name="build-chm" depends="init" description="Generates chm file from docbook files." unless="${target::has-executed('build-chm')}">
<!-- default install location -->
<property name="hhc.exe" value="${environment::get-folder-path('ProgramFiles')}\HTML Help Workshop\hhc" />
<property name="build.chm.dir" value="${output.dir}/chm" />
<mkdir dir="${build.chm.dir}" failonerror="false" />
<!-- make the htmlhelp version of the helpfile -->
<exec program="xsltproc">
<arg value="--output" />
<arg path="${build.chm.dir}/" /><!-- dir to output transform results to (add the trailing '/' for xsltproc) -->
<arg file="chm_help.xsl" /> <!-- xsl to do the transforming -->
<arg file="src/Documentation.gen" /> <!-- xml file to transform -->
</exec>
<!-- Copy the images and the stylesheet -->
<copy todir="${build.chm.dir}" overwrite="true" >
<fileset basedir="./src/">
<include name="*.gif" />
<include name="html.css" />
</fileset>
</copy>
<!-- TODO: Don't know why its return code is 1 (stop NAnt, if failonerror="true") -->
<exec program="${hhc.exe}" failonerror="false">
<arg file="${build.chm.dir}/htmlhelp.hhp" />
</exec>
<copy file="${build.chm.dir}/htmlhelp.chm" tofile="${output.dir}/NHibernate.Documentation.chm" />
<delete dir="${build.chm.dir}" />
</target>
<target name="build-help2" if="${vshik.installed}" depends="build-chm" description="Generates help2 file from chm file.">
<property name="build.help2.dir" value="${output.dir}/help2" />
<!-- convert the chm into the HxC -->
<exec program="HxConv.exe" basedir="${vshik.path}">
<arg path="${output.dir}/NHibernate.Documentation.chm" />
<arg value="-o" />
<arg path="${build.help2.dir}" />
<arg value="-y" />
</exec>
<!--
Compile the HxC into an HxS that can be included
in a Help2 collection
-->
<exec program="HxComp.exe" basedir="${vshik.path}">
<arg value="-p" />
<arg path="${build.help2.dir}/NHibernate.Documentation.HxC" />
<arg value="-o" />
<arg path="${output.dir}/NHibernate.Documentation.HxS" />
</exec>
<delete dir="${build.help2.dir}" />
<!--
copying the Help2 files from cvs that describe the
Help collection, not the files generated by the build
that contain the content
-->
<copy todir="${output.dir}" overwrite="true" >
<fileset basedir="Help2/">
<include name="*" />
</fileset>
</copy>
</target>
</project>