author | kelvzhu |
Wed, 27 Oct 2010 16:03:51 +0800 | |
changeset 662 | 60be34e1b006 |
parent 645 | b8d81fa19e7d |
permissions | -rw-r--r-- |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
2 |
<!-- |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
3 |
============================================================================ |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
4 |
Name : docs.ant.xml |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
5 |
Part of : Helium |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
6 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
7 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
8 |
All rights reserved. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
9 |
This component and the accompanying materials are made available |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
10 |
under the terms of the License "Eclipse Public License v1.0" |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
11 |
which accompanies this distribution, and is available |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
12 |
at the URL "http://www.eclipse.org/legal/epl-v10.html". |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
13 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
14 |
Initial Contributors: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
15 |
Nokia Corporation - initial contribution. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
16 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
17 |
Contributors: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
18 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
19 |
Description: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
20 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
21 |
============================================================================ |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
22 |
--> |
217 | 23 |
<!--* @package framework --> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
24 |
<project name="internal.docs" xmlns:hlm="http://www.nokia.com/helium" xmlns:ivy="antlib:org.apache.ivy.ant"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
25 |
<description> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
26 |
Documentation generation targets. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
27 |
</description> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
28 |
|
217 | 29 |
<!-- Location of documentation source. |
587 | 30 |
This is set to work with IDO docs, to avoid updating their config. |
217 | 31 |
@type string |
32 |
@scope public |
|
33 |
--> |
|
587 | 34 |
<property name="doc.src.dir" location="${basedir}/docs/src" /> |
35 |
<!-- Location of documentation API source. |
|
36 |
@type string |
|
37 |
@scope private |
|
38 |
--> |
|
39 |
<property name="api.doc.src.dir" location="${helium.dir}/doc/api" /> |
|
40 |
||
588 | 41 |
<!-- Location of documentation API source for RST. |
42 |
@type string |
|
43 |
@scope private |
|
44 |
--> |
|
45 |
<property name="api.rst.doc.src.dir" location="${helium.dir}/doc/api_rst" /> |
|
46 |
||
628 | 47 |
<!-- Location of helium database |
48 |
@type string |
|
49 |
@scope private |
|
50 |
--> |
|
51 |
<property name="public.database.file" location="${basedir}/build/public_database.xml"/> |
|
52 |
||
53 |
||
587 | 54 |
<!-- A list of source paths for RST documentation to be built. --> |
55 |
<resources id="textdoc.paths"> |
|
56 |
<path> |
|
57 |
<pathelement path="${doc.src.dir}"/> |
|
58 |
</path> |
|
59 |
</resources> |
|
217 | 60 |
|
61 |
<!-- The location where the docs will be built. |
|
62 |
@type string |
|
63 |
@scope private --> |
|
587 | 64 |
<property name="doc.build.dir" location="${basedir}/build/doc" /> |
65 |
<!-- A temp location for doc processing. |
|
66 |
@type string |
|
67 |
@scope private --> |
|
68 |
<property name="doc.temp.dir" location="${basedir}/build/temp/doc" /> |
|
69 |
<!-- A temp location for doc processing. |
|
70 |
@type string |
|
71 |
@scope private --> |
|
72 |
<property name="doc_search.temp.dir" location="${basedir}/build/temp/doc_search" /> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
73 |
|
217 | 74 |
<fileset id="static.doc.files" dir="${helium.dir}/doc/src"> |
75 |
<include name="conf.py"/> |
|
76 |
<include name=".static"/> |
|
77 |
<include name=".templates/**"/> |
|
78 |
<include name="*.jpg"/> |
|
79 |
<include name="*.css"/> |
|
80 |
</fileset> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
81 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
82 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
83 |
<!-- Cleans the Helium API documentation. --> |
217 | 84 |
<target name="clean-helium-apidocs"> |
587 | 85 |
<delete dir="${doc.build.dir}/api/helium"/> |
86 |
<delete dir="${doc.temp.dir}/api/helium"/> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
87 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
88 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
89 |
|
628 | 90 |
<!-- Generates an Ant XML database file showing only public content. |
91 |
@scope private |
|
92 |
--> |
|
93 |
<target name="docs-database"> |
|
645 | 94 |
<mkdir dir="${basedir}/build"/> |
628 | 95 |
<hlm:database output="${public.database.file}" scope="public" filesetonly="true"> |
96 |
<fileset dir="."> |
|
97 |
<include name="**/*.ant.xml"/> |
|
98 |
<include name="**/build.xml"/> |
|
99 |
</fileset> |
|
100 |
</hlm:database> |
|
101 |
</target> |
|
102 |
||
103 |
||
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
104 |
<!-- Creates images of the dependencies for all Ant targets. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
105 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
106 |
This includes creating a cmap file that is included in the HTML document, |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
107 |
so the boxes in the image are linked to their targets. --> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
108 |
<target name="helium-api-dependency-images"> |
587 | 109 |
<mkdir dir="${doc.build.dir}/api/helium"/> |
110 |
<mkdir dir="${doc.temp.dir}/api/helium"/> |
|
588 | 111 |
<fmpp sourceRoot="${api.rst.doc.src.dir}" includes="*.dot.ftl" outputRoot="${doc.temp.dir}/api/helium" |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
112 |
replaceExtension="dot.ftl, dot"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
113 |
<data expandProperties="yes"> |
628 | 114 |
doc: xml(${public.database.file}) |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
115 |
</data> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
116 |
</fmpp> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
117 |
<for param="dot.file" parallel="true" threadCount="${number.of.threads}"> |
587 | 118 |
<fileset dir="${doc.temp.dir}/api/helium" includes="*.dot"/> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
119 |
<sequential> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
120 |
<echo>Processing dot file: @{dot.file}</echo> |
645 | 121 |
<exec executable="dot" dir="${doc.temp.dir}/api/helium" failonerror="true"> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
122 |
<arg line="-Tcmap @{dot.file} -O"/> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
123 |
</exec> |
645 | 124 |
<exec executable="dot" dir="${doc.build.dir}/api" failonerror="true"> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
125 |
<arg line="-Tpng @{dot.file} -O"/> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
126 |
</exec> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
127 |
</sequential> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
128 |
</for> |
587 | 129 |
<move todir="${doc.build.dir}/api/helium" overwrite="true"> |
130 |
<fileset dir="${doc.temp.dir}/api/helium" includes="*.dot.png"/> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
131 |
</move> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
132 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
133 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
134 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
135 |
<!-- Builds the HTML files for the Helium API documentation. --> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
136 |
<target name="helium-api-html-docs"> |
587 | 137 |
<mkdir dir="${doc.build.dir}/api/helium"/> |
138 |
<copy todir="${doc.temp.dir}/api/helium" overwrite="true"> |
|
139 |
<fileset dir="${api.doc.src.dir}"/> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
140 |
</copy> |
587 | 141 |
<fmpp sourceRoot="${doc.temp.dir}/api/helium" excludes="*.dot.png,*.dot.ftl,**/*.dot,**/*.cmap,*.bak" |
142 |
outputRoot="${doc.build.dir}/api/helium" |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
143 |
replaceExtension="html.ftl, html"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
144 |
<data expandProperties="yes"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
145 |
ant: antProperties() |
628 | 146 |
doc: xml(${public.database.file}) |
587 | 147 |
</data> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
148 |
</fmpp> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
149 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
150 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
151 |
|
588 | 152 |
<!-- Builds the RST files for the Helium API documentation. --> |
153 |
<target name="helium-api-rst-docs"> |
|
154 |
<mkdir dir="${doc.temp.dir}/api/helium"/> |
|
155 |
<fmpp sourceRoot="${api.rst.doc.src.dir}" excludes="*.dot.png,*.dot.ftl,**/*.dot,**/*.cmap,*.bak" |
|
156 |
outputRoot="${doc.temp.dir}/api/helium" |
|
157 |
replaceExtension="rst.ftl, rst"> |
|
158 |
<data expandProperties="yes"> |
|
159 |
ant: antProperties() |
|
628 | 160 |
doc: xml(${public.database.file}) |
588 | 161 |
</data> |
162 |
</fmpp> |
|
163 |
</target> |
|
164 |
||
165 |
||
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
166 |
<!-- Builds the Helium API documentation. --> |
628 | 167 |
<target name="helium-apidocs" depends="clean-helium-apidocs,docs-database, |
588 | 168 |
helium-api-dependency-images,helium-api-rst-docs"/> |
217 | 169 |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
170 |
|
217 | 171 |
<!-- Generate API documentation from the source code. --> |
645 | 172 |
<target name="apidocs" depends="helium-apidocs" unless="env.HLM_SUBCON"> |
173 |
<exec executable="cmd" osfamily="windows" dir="${helium.dir}/nokia_builder" failonerror="true"> |
|
174 |
<arg line="/C bld doc" /> |
|
175 |
</exec> |
|
176 |
</target> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
177 |
|
217 | 178 |
<!-- Macro to generate HTML docs from rst. --> |
587 | 179 |
<macrodef name="rstPrepMacro" uri="http://www.nokia.com/helium"> |
180 |
<attribute name="destdir"/> |
|
181 |
<element name="resources-elements" implicit="yes"/> |
|
182 |
<sequential> |
|
183 |
<for param="dir"> |
|
184 |
<resources-elements/> |
|
185 |
<sequential> |
|
186 |
<echo>Copying textdocs source directory: @{dir}</echo> |
|
588 | 187 |
<fmpp sourceRoot="@{dir}" excludes="**/*.bak" |
587 | 188 |
outputRoot="@{destdir}" removeExtensions="ftl" |
189 |
modes="copy(**/*.rst, **/*.html)"> |
|
190 |
<data expandProperties="yes"> |
|
191 |
ant: antProperties() |
|
192 |
project: antProject() |
|
628 | 193 |
doc: xml(${public.database.file}) |
587 | 194 |
</data> |
195 |
</fmpp> |
|
196 |
</sequential> |
|
197 |
</for> |
|
198 |
</sequential> |
|
199 |
</macrodef> |
|
200 |
||
201 |
||
202 |
<!-- Macro to generate HTML docs from rst. --> |
|
217 | 203 |
<macrodef name="rstMacro" uri="http://www.nokia.com/helium"> |
204 |
<attribute name="version" default="${helium.version}"/> |
|
587 | 205 |
<attribute name="src" default="${doc.temp.dir}"/> |
206 |
<attribute name="output" default="${doc.build.dir}"/> |
|
217 | 207 |
<sequential> |
208 |
<property name="sphinx.lib.dir" location="${helium.dir}/external/python/lib/common/Sphinx-0.5.1-py2.5.egg/sphinx" /> |
|
209 |
<if> |
|
210 |
<available file="${nokia.python.tools}/sphinxfixsearch.diff"/> |
|
211 |
<then> |
|
212 |
<patch patchfile="${nokia.python.tools}/sphinxfixsearch.diff" originalfile="${sphinx.lib.dir}/search.py"/> |
|
213 |
</then> |
|
214 |
</if> |
|
215 |
<if> |
|
216 |
<resourcecount when="greater" count="0"> |
|
217 |
<fileset dir="@{src}" includes="**/*.rst"/> |
|
218 |
</resourcecount> |
|
219 |
<then> |
|
220 |
<exec executable="python" failonerror="true"> |
|
221 |
<arg file="${python.dir}/common/sphinx-build.py"/> |
|
222 |
<arg value="-b" /> |
|
223 |
<arg value="html" /> |
|
224 |
<arg value="-D" /> |
|
225 |
<arg value="version=@{version}" /> |
|
226 |
<arg value="-D" /> |
|
227 |
<arg value="release=@{version}" /> |
|
228 |
<arg file="@{src}" /> |
|
229 |
<arg file="@{output}" /> |
|
230 |
</exec> |
|
231 |
</then> |
|
232 |
</if> |
|
233 |
<if> |
|
234 |
<available file="${nokia.python.tools}/sphinxfixsearch.diff"/> |
|
235 |
<then> |
|
236 |
<patch reverse="true" patchfile="${nokia.python.tools}/sphinxfixsearch.diff" originalfile="${sphinx.lib.dir}/search.py"/> |
|
237 |
</then> |
|
238 |
</if> |
|
645 | 239 |
<copy todir="@{output}" overwrite="true"> |
240 |
<fileset dir="@{src}"> |
|
241 |
<include name="**/*.zip"/> |
|
242 |
</fileset> |
|
243 |
</copy> |
|
217 | 244 |
</sequential> |
245 |
</macrodef> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
246 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
247 |
|
587 | 248 |
<!-- Generate search index for apis --> |
249 |
<target name="apidocs-search"> |
|
250 |
<echo>Convert API docs to .rst files</echo> |
|
251 |
<hlm:python> |
|
252 |
import html2rest |
|
253 |
import os |
|
254 |
import codecs |
|
255 |
#import traceback |
|
256 |
for root, dirs, files in os.walk(r'${doc.build.dir}/api', topdown=False): |
|
257 |
for fname in files: |
|
258 |
if '.html' in fname: |
|
259 |
filename = os.path.abspath(os.path.join(root, fname)) |
|
260 |
rstfilename = filename.replace('.html', '.rst') |
|
261 |
try: |
|
262 |
out = open(rstfilename, 'w') |
|
263 |
html2rest.html2rest(html2rest.readsoup(filename), out) |
|
264 |
except: |
|
265 |
#traceback.print_exc() |
|
266 |
print filename + ' failed to be converted to rst' |
|
267 |
finally: |
|
268 |
out.close() |
|
269 |
||
270 |
try: |
|
271 |
rstfile = codecs.open(rstfilename, 'r', 'utf8') |
|
272 |
rstfile.read() |
|
645 | 273 |
except UnicodeError: |
587 | 274 |
print rstfilename + ' has invalid unicode' |
275 |
rstfile.close() |
|
276 |
os.remove(rstfilename) |
|
277 |
</hlm:python> |
|
278 |
||
279 |
<move todir="${doc_search.temp.dir}" overwrite="true"> |
|
280 |
<fileset dir="${doc.build.dir}/api"> |
|
281 |
<include name="**/*.rst"/> |
|
282 |
</fileset> |
|
283 |
</move> |
|
284 |
||
285 |
<move todir="${doc.build.dir}/api_backup" overwrite="true"> |
|
286 |
<fileset dir="${doc.build.dir}/api"/> |
|
287 |
</move> |
|
288 |
||
289 |
<hlm:rstPrepMacro destdir="${doc_search.temp.dir}"> |
|
290 |
<resources> |
|
291 |
<path> |
|
292 |
<pathelement path="${helium.dir}/doc/default"/> |
|
293 |
</path> |
|
294 |
</resources> |
|
295 |
</hlm:rstPrepMacro> |
|
296 |
||
297 |
<copy file="${api.doc.src.dir}/apisearchindex.rst" tofile="${doc_search.temp.dir}/index.rst" overwrite="true"/> |
|
298 |
||
299 |
<!--<copy todir="${doc_search.temp.dir}"> |
|
300 |
<fileset refid="static.doc.files"/> |
|
301 |
</copy> |
|
302 |
<copy todir="${doc_search.temp.dir}" overwrite="true"> |
|
303 |
<fileset dir="${helium.dir}/doc/src_search" includes="**/*"/> |
|
304 |
</copy>--> |
|
305 |
||
306 |
<hlm:rstMacro src="${doc_search.temp.dir}" output="${doc.build.dir}/api"/> |
|
307 |
||
308 |
<move todir="${doc.build.dir}/api" overwrite="true"> |
|
309 |
<fileset dir="${doc.build.dir}/api_backup"/> |
|
310 |
</move> |
|
311 |
</target> |
|
312 |
||
313 |
||
217 | 314 |
<!-- Generate rst files for docs --> |
628 | 315 |
<target name="prep-textdocs" depends="docs-database"> |
587 | 316 |
<echo>Building docs into ${doc.build.dir}.</echo> |
217 | 317 |
|
587 | 318 |
<delete dir="${doc.build.dir}/.doctrees"/> |
319 |
<delete file="${doc.build.dir}/searchindex.json"/> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
320 |
|
587 | 321 |
<resources id="textdoc.all.paths"> |
322 |
<!-- default doc content is always processed first --> |
|
323 |
<path> |
|
324 |
<pathelement path="${helium.dir}/doc/default"/> |
|
325 |
</path> |
|
326 |
<resources refid="textdoc.paths"/> |
|
327 |
</resources> |
|
328 |
<hlm:rstPrepMacro destdir="${doc.temp.dir}"> |
|
329 |
<resources refid="textdoc.all.paths"/> |
|
330 |
</hlm:rstPrepMacro> |
|
331 |
</target> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
332 |
|
587 | 333 |
|
334 |
<target name="build-textdocs-dot-images"> |
|
217 | 335 |
<for param="dot.file"> |
587 | 336 |
<fileset dir="${doc.temp.dir}"> |
337 |
<include name="**/*.dot"/> |
|
338 |
<exclude name="api/helium/**/*.dot"/> |
|
339 |
</fileset> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
340 |
<sequential> |
217 | 341 |
<echo>Building dot file: @{dot.file}</echo> |
645 | 342 |
<exec executable="dot" failonerror="true"> |
217 | 343 |
<arg line="-Tpng @{dot.file} -O"/> |
344 |
</exec> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
345 |
</sequential> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
346 |
</for> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
347 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
348 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
349 |
|
217 | 350 |
<!-- Generate HTML documentation from .rst documents with Sphinx. |
351 |
||
352 |
All doc .rst files should be generated or copied into build/temp/doc before being processed into HTML. |
|
353 |
--> |
|
587 | 354 |
<target name="build-textdocs"> |
217 | 355 |
<hlm:rstMacro /> |
356 |
</target> |
|
587 | 357 |
|
358 |
||
359 |
<target name="textdocs" depends="prep-textdocs,build-textdocs-dot-images,build-textdocs"/> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
360 |
|
217 | 361 |
|
587 | 362 |
<!-- Cleans only the RST text docs --> |
363 |
<target name="clean-textdocs"> |
|
364 |
<mkdir dir="${doc.build.dir}"/> |
|
365 |
<mkdir dir="${doc.temp.dir}"/> |
|
366 |
<mkdir dir="${doc_search.temp.dir}"/> |
|
367 |
||
368 |
<delete includeemptydirs="true"> |
|
369 |
<fileset dir="${doc.build.dir}"> |
|
370 |
<include name="**/*"/> |
|
371 |
<exclude name="api/helium/**/*"/> |
|
588 | 372 |
<exclude name="doclet/**"/> |
373 |
<exclude name="javadoc/**"/> |
|
587 | 374 |
</fileset> |
375 |
<fileset dir="${doc.temp.dir}"/> |
|
376 |
<fileset dir="${doc_search.temp.dir}"/> |
|
377 |
</delete> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
378 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
379 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
380 |
|
587 | 381 |
<!-- Cleans all documentation. --> |
382 |
<target name="clean-docs" depends="clean-helium-apidocs,clean-textdocs"/> |
|
383 |
||
384 |
||
217 | 385 |
<!-- generate all the user documentation for helium --> |
645 | 386 |
<target name="docs" depends="clean-docs,apidocs,textdocs,docs-check-links"/> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
387 |
|
645 | 388 |
<!-- Check links in docs --> |
389 |
<target name="docs-check-links"> |
|
390 |
<hlm:python failonerror="true"> |
|
391 |
<![CDATA[ |
|
392 |
import os |
|
393 |
error = '' |
|
394 |
for root, dirs, files in os.walk(r'${doc.build.dir}', topdown=False): |
|
395 |
for fname in files: |
|
396 |
if '.htm' in fname: |
|
397 |
filename = os.path.abspath(os.path.join(root, fname)) |
|
398 |
f = open(filename) |
|
399 |
for line in f: |
|
400 |
if ' src="' in line: |
|
401 |
line1 = line.split('src="')[1] |
|
402 |
line1 = line1.split('"')[0] |
|
403 |
os.chdir(root) |
|
404 |
if line1 and not os.path.exists(line1) and not ':' in line1 and not '$' in line1: |
|
405 |
error = error + filename + ' has a broken link ' + line1 + '\n' |
|
406 |
if ' href="' in line: |
|
407 |
line = line.split('href="')[1] |
|
408 |
line = line.split('"')[0] |
|
409 |
if '#' in line: |
|
410 |
line = line.split('#')[0] |
|
411 |
if '?' in line: |
|
412 |
line = line.split('?')[0] |
|
413 |
os.chdir(root) |
|
414 |
if line and not os.path.exists(line) and not ':' in line and not '&' in line: |
|
415 |
error = error + filename + ' has a broken link ' + line + '\n' |
|
416 |
f.close() |
|
417 |
if error != '': |
|
418 |
raise Exception(error) |
|
419 |
]]> |
|
420 |
</hlm:python> |
|
421 |
</target> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
422 |
</project> |