|
10 | 10 |
|
11 | 11 | <target name="init" depends="common.init">
|
12 | 12 | <property name="lang" value="en" />
|
13 |
| - <property name="output.dir" value="${build.dir}/doc" /> |
14 | 13 | <tstamp property="build.date" pattern="u" verbose="true" />
|
15 | 14 |
|
| 15 | + <property name="output.dir" value="${build.dir}/doc" /> |
| 16 | + <property name="output.help2.dir" value="${output.dir}/help2" /> |
| 17 | + |
16 | 18 | <property name="build.html.dir" value="${output.dir}" />
|
17 | 19 | <property name="build.single.dir" value="${build.html.dir}/html_single" />
|
18 | 20 | <property name="build.chunk.dir" value="${build.html.dir}/html" />
|
19 | 21 | <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" /> |
21 | 25 |
|
22 | 26 | <property name="hhc.exe" value="${environment::get-folder-path('ProgramFiles')}\HTML Help Workshop\hhc" />
|
23 | 27 |
|
|
38 | 42 | <delete dir="${build.html.dir}" failonerror="false" />
|
39 | 43 | </target>
|
40 | 44 |
|
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" |
42 | 46 | description="Generates the documentation in multiple formats from the Docbook files." />
|
43 | 47 |
|
44 | 48 | <target name="build-html.make-directories" depends="init">
|
45 | 49 | <mkdir dir="${build.single.dir}" failonerror="false" />
|
46 | 50 | <mkdir dir="${build.chunk.dir}" failonerror="false" />
|
47 | 51 | </target>
|
48 | 52 |
|
49 |
| - <target name="build-html.generate" depends="init"> |
| 53 | + <target name="build-html.generate" depends="init build-html.make-directories"> |
50 | 54 | <exec program="java" workingdir="${build.chunk.dir}">
|
51 | 55 | <arg value="-classpath" />
|
52 | 56 | <arg>
|
|
87 | 91 | </target>
|
88 | 92 |
|
89 | 93 | <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" |
91 | 95 | description="Generates html from docbook files." />
|
92 | 96 |
|
93 | 97 | <target name="build-chm" depends="init" description="Generates chm file from docbook files.">
|
|
123 | 127 | </exec>
|
124 | 128 |
|
125 | 129 | <copy file="${build.chm.dir}/htmlhelp.chm" tofile="${output.dir}/NHibernate.Documentation.chm" />
|
| 130 | + |
| 131 | + <delete dir="${build.chm.dir}" /> |
126 | 132 | </target>
|
127 | 133 |
|
128 | 134 | <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 |
| - |
131 | 135 | <!-- convert the chm into the HxC -->
|
132 | 136 | <exec program="HxConv.exe" basedir="${vshik.path}">
|
133 | 137 | <arg path="${output.dir}/NHibernate.Documentation.chm" />
|
|
136 | 140 | <arg value="-y" />
|
137 | 141 | </exec>
|
138 | 142 |
|
| 143 | + <mkdir dir="${output.help2.dir}" /> |
| 144 | + |
139 | 145 | <!--
|
140 | 146 | Compile the HxC into an HxS that can be included
|
141 | 147 | in a Help2 collection
|
|
144 | 150 | <arg value="-p" />
|
145 | 151 | <arg path="${build.help2.dir}/NHibernate.Documentation.HxC" />
|
146 | 152 | <arg value="-o" />
|
147 |
| - <arg path="${output.dir}/NHibernate.Documentation.HxS" /> |
| 153 | + <arg path="${output.help2.dir}/NHibernate.Documentation.HxS" /> |
148 | 154 | </exec>
|
149 | 155 |
|
150 | 156 | <!--
|
151 | 157 | copying the Help2 files from cvs that describe the
|
152 | 158 | Help collection, not the files generated by the build
|
153 | 159 | that contain the content
|
154 | 160 | -->
|
155 |
| - <copy todir="${output.dir}"> |
| 161 | + <copy todir="${output.help2.dir}"> |
156 | 162 | <fileset basedir="support/help2/">
|
157 | 163 | <include name="**/*" />
|
158 | 164 | </fileset>
|
159 | 165 | </copy>
|
160 | 166 |
|
| 167 | + <delete dir="${build.help2.dir}" /> |
161 | 168 | </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 | + |
162 | 214 | </project>
|
163 | 215 |
|
0 commit comments