217
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : helium-docs.ant.xml
|
|
5 |
Part of : Helium
|
|
6 |
|
|
7 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
8 |
All rights reserved.
|
|
9 |
This component and the accompanying materials are made available
|
|
10 |
under the terms of the License "Eclipse Public License v1.0"
|
|
11 |
which accompanies this distribution, and is available
|
|
12 |
at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
13 |
|
|
14 |
Initial Contributors:
|
|
15 |
Nokia Corporation - initial contribution.
|
|
16 |
|
|
17 |
Contributors:
|
|
18 |
|
|
19 |
Description:
|
|
20 |
|
|
21 |
============================================================================
|
|
22 |
-->
|
|
23 |
<!--* @package framework -->
|
|
24 |
<project name="internal.helium.docs" xmlns:hlm="http://www.nokia.com/helium" xmlns:ivy="antlib:org.apache.ivy.ant">
|
|
25 |
<description>
|
|
26 |
Documentation generation targets specific to Helium.
|
|
27 |
</description>
|
|
28 |
|
|
29 |
<!-- Location of documentation source that is specific to Helium.
|
|
30 |
@type string
|
|
31 |
@scope private
|
|
32 |
-->
|
|
33 |
<property name="helium.doc.src.dir" location="${helium.dir}/doc" />
|
|
34 |
|
|
35 |
<!-- Generate an overview of Helium as HTML tables. -->
|
|
36 |
<target name="overview-to-html">
|
587
|
37 |
<fmpp sourceFile="${helium.doc.src.dir}/helium_custom/helium_overview.html.ftl"
|
|
38 |
outputFile="${doc.temp.dir}/helium_overview.html"
|
217
|
39 |
replaceExtension="html.ftl, html" expert="true">
|
|
40 |
<data expandProperties="yes">
|
587
|
41 |
doc: xml(${helium.doc.src.dir}/helium_custom/helium_overview.xml)
|
217
|
42 |
</data>
|
|
43 |
</fmpp>
|
|
44 |
</target>
|
|
45 |
|
|
46 |
|
|
47 |
<!-- Builds the Helium API documentation. -->
|
|
48 |
<target name="helium-apidocs" depends="clean-helium-apidocs,database,
|
|
49 |
find-python-dependencies,helium-api-dependency-images,helium-api-html-docs"/>
|
|
50 |
|
|
51 |
|
|
52 |
<target name="helium-prep-textdocs">
|
587
|
53 |
<mkdir dir="${doc.temp.dir}/minibuilds"/>
|
|
54 |
<copy todir="${doc.temp.dir}/development/minibuilds" failonerror="false">
|
217
|
55 |
<fileset dir="${helium.dir}/tests/minibuilds/">
|
|
56 |
<include name="*/doc/**/*"/>
|
|
57 |
</fileset>
|
|
58 |
</copy>
|
587
|
59 |
|
|
60 |
<mkdir dir="${doc.temp.dir}/helium-antlib" />
|
|
61 |
<for param="dir">
|
|
62 |
<dirset dir="${helium.dir}" includes="*/doc/src" />
|
|
63 |
<sequential>
|
|
64 |
<copy todir="${doc.temp.dir}/helium-antlib">
|
|
65 |
<fileset dir="@{dir}/">
|
|
66 |
<include name="**/*.rst"/>
|
|
67 |
<include name="**/*.css"/>
|
|
68 |
<include name="**/*.dot"/>
|
|
69 |
<include name="**/*.png"/>
|
|
70 |
</fileset>
|
|
71 |
</copy>
|
|
72 |
</sequential>
|
|
73 |
</for>
|
|
74 |
<for param="dir">
|
|
75 |
<dirset dir="${helium.dir}">
|
|
76 |
<include name="*/java/*" />
|
|
77 |
<include name="*/python/*" />
|
|
78 |
</dirset>
|
|
79 |
<sequential>
|
628
|
80 |
<copy todir="${doc.temp.dir}/helium-antlib" flatten="true">
|
587
|
81 |
<fileset dir="@{dir}/">
|
|
82 |
<include name="*.rst"/>
|
|
83 |
</fileset>
|
628
|
84 |
<fileset dir="@{dir}/" includes="doc/*" excludes="**/distribution.policy.S60" />
|
587
|
85 |
</copy>
|
|
86 |
</sequential>
|
|
87 |
</for>
|
217
|
88 |
</target>
|
|
89 |
|
|
90 |
|
|
91 |
<!-- Generate all documentation. -->
|
|
92 |
<target name="add-policies-to-docs" unless="env.HLM_SUBCON">
|
|
93 |
<hlm:updatePolicy policy="7" filename="distribution.policy.S60">
|
587
|
94 |
<dirset dir="${helium.dir}" includes="${doc.build.dir}/**/*"/>
|
217
|
95 |
</hlm:updatePolicy>
|
|
96 |
</target>
|
|
97 |
|
|
98 |
|
|
99 |
<!-- Creates XML and .rst documents describing the difference between
|
|
100 |
this version of Helium and the previous major release. -->
|
|
101 |
<target name="release-diff" depends="database" unless="env.HLM_SUBCON">
|
587
|
102 |
<mkdir dir="${doc.build.dir}"/>
|
217
|
103 |
<!-- URL for the database.xml of last major release
|
|
104 |
@type string
|
|
105 |
@scope private
|
|
106 |
-->
|
|
107 |
<property name="last.major.release.database.url" value="${documentation.url.root}/${last.major.helium.version}/database.xml"/>
|
|
108 |
<hlm:python>
|
|
109 |
import urllib
|
|
110 |
import helium.documentation
|
|
111 |
|
|
112 |
old_db_file = urllib.urlopen(r'${last.major.release.database.url}')
|
628
|
113 |
writer = helium.documentation.APIDeltaWriter(old_db_file.read(), open(r'${database.file}').read())
|
587
|
114 |
writer.write(r'${doc.build.dir}/api_changes.xml')
|
217
|
115 |
</hlm:python>
|
|
116 |
<if>
|
587
|
117 |
<available file="${doc.build.dir}/api_changes.xml"/>
|
217
|
118 |
<then>
|
587
|
119 |
<fmpp sourceFile="${helium.doc.src.dir}/helium_custom/api_changes.rst.ftl" outputFile="${doc.temp.dir}/api_changes.rst">
|
217
|
120 |
<data expandProperties="yes">
|
587
|
121 |
doc: xml(${doc.build.dir}/api_changes.xml)
|
217
|
122 |
old_release: ${last.major.helium.version}
|
|
123 |
new_release: ${helium.version}
|
|
124 |
</data>
|
|
125 |
</fmpp>
|
|
126 |
</then>
|
|
127 |
</if>
|
|
128 |
</target>
|
|
129 |
|
|
130 |
|
|
131 |
<!-- Generate docs for Symbian Foundataion -->
|
|
132 |
<target name="docs-sf">
|
587
|
133 |
<delete dir="${helium.build.dir}"/>
|
217
|
134 |
<antcall target="helium-subcon-release"/>
|
587
|
135 |
<unzip src="${helium.build.dir}/helium_${helium.version}_subcon.zip" dest="${helium.build.dir}/helium_${helium.version}_subcon" overwrite="true" />
|
217
|
136 |
<!---->
|
587
|
137 |
<exec executable="cmd" dir="${helium.build.dir}/helium_${helium.version}_subcon/helium">
|
|
138 |
<env key="HELIUM_HOME" value="${helium.build.dir}/helium_${helium.version}_subcon/helium"/>
|
217
|
139 |
<env key="PYTHONPATH" value="${env.PYTHONPATH}"/>
|
|
140 |
<env key="ANT_ARGS" value="${env.ANT_ARGS}"/>
|
|
141 |
<arg line="/C hlm.bat"/>
|
|
142 |
<arg value="docs"/>
|
|
143 |
<arg value="-Dpython.tools=${python.tools}"/>
|
|
144 |
<arg value="-Dsf=true"/>
|
|
145 |
</exec>
|
|
146 |
</target>
|
|
147 |
|
|
148 |
|
|
149 |
<!-- Connect to home drive if it is not connected for .netrc file. -->
|
|
150 |
<target name="check-home-drive">
|
|
151 |
<exec executable="cmd">
|
|
152 |
<arg value="/c"/>
|
|
153 |
<arg value="${helium.dir}/tools/common/bin/check_home_drv.bat"/>
|
|
154 |
<arg value=">nul"/>
|
|
155 |
</exec>
|
|
156 |
</target>
|
|
157 |
|
|
158 |
|
|
159 |
<!-- Upload generated HTML docs to the Helium server. -->
|
|
160 |
<target name="upload-docs" depends="check-home-drive">
|
|
161 |
<!-- The full path on the host server where the Helium documentation is stored.
|
|
162 |
@type string
|
|
163 |
@scope private
|
|
164 |
-->
|
|
165 |
<property name="documentation.path" value="${documentation.path.root}"/>
|
587
|
166 |
<property name="docs.zip" value="${doc.build.dir}/helium-docs.zip"/>
|
|
167 |
|
|
168 |
<echo>Uploading docs to ${documentation.path}</echo>
|
217
|
169 |
|
|
170 |
<!-- Python API docs. -->
|
|
171 |
<delete file="${docs.zip}"/>
|
588
|
172 |
<mkdir dir="${doc.build.dir}/javadoc" />
|
|
173 |
<mkdir dir="${doc.build.dir}/doclet" />
|
217
|
174 |
<zip destfile="${docs.zip}">
|
588
|
175 |
<fileset dir="${doc.build.dir}" >
|
|
176 |
<include name="**/*" />
|
|
177 |
<exclude name="doclet/*" />
|
|
178 |
<exclude name="javadoc/*" />
|
|
179 |
</fileset>
|
|
180 |
<zipfileset dir="${doc.build.dir}/javadoc" prefix="helium-antlib/api/javadoc"/>
|
|
181 |
<zipfileset dir="${doc.build.dir}/doclet" prefix="helium-antlib/api/doclet"/>
|
217
|
182 |
</zip>
|
|
183 |
<sshexec host="${documentation.host}"
|
|
184 |
username="${user.name}"
|
|
185 |
keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
|
|
186 |
trust="true"
|
|
187 |
command="mkdir -p ${documentation.path}"/>
|
|
188 |
<scp todir="${user.name}@${documentation.host}:${documentation.path}"
|
|
189 |
keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
|
|
190 |
passphrase=""
|
|
191 |
trust="true"
|
|
192 |
sftp="true"
|
|
193 |
file="${docs.zip}"/>
|
|
194 |
<sshexec host="${documentation.host}"
|
|
195 |
username="${user.name}"
|
|
196 |
keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
|
|
197 |
trust="true"
|
587
|
198 |
command="cd ${documentation.path}; unzip -u -o helium-docs.zip"/>
|
|
199 |
<sshexec host="${documentation.host}"
|
|
200 |
username="${user.name}"
|
|
201 |
keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
|
|
202 |
trust="true"
|
|
203 |
failonerror="false"
|
|
204 |
command="cd ${documentation.path}; chmod -f -R 777 ."/>
|
217
|
205 |
</target>
|
|
206 |
|
|
207 |
|
|
208 |
<!-- Upload generated HTML docs to the Helium server. -->
|
|
209 |
<target name="upload-release-docs">
|
|
210 |
<!-- The full path on the host server where the Helium documentation is stored.
|
|
211 |
@type string
|
|
212 |
@scope private
|
|
213 |
-->
|
|
214 |
<property name="documentation.path" value="${documentation.path.root}/${helium.version}"/>
|
|
215 |
<antcall target="upload-docs"/>
|
|
216 |
</target>
|
|
217 |
|
|
218 |
|
|
219 |
<!-- create slides from images -->
|
|
220 |
<target name="slides">
|
587
|
221 |
<mkdir dir="${doc.build.dir}/slides"/>
|
217
|
222 |
|
587
|
223 |
<copy todir="${doc.build.dir}/slides">
|
217
|
224 |
<fileset dir="${doc.src.dir}/slides"/>
|
|
225 |
</copy>
|
|
226 |
|
587
|
227 |
<copy todir="${doc.build.dir}/slides/images">
|
217
|
228 |
<fileset dir="${doc.src.dir}/slides/images"/>
|
|
229 |
</copy>
|
|
230 |
|
|
231 |
<for param="document">
|
587
|
232 |
<fileset dir="${doc.build.dir}/slides" includes="**/*.rst"/>
|
217
|
233 |
<sequential>
|
|
234 |
<propertyregex property="document.no.ext" input="@{document}" regexp="\.rst$" replace="" override="true"/>
|
|
235 |
<if>
|
|
236 |
<not>
|
|
237 |
<uptodate srcfile="@{document}" targetfile="${document.no.ext}.html"/>
|
|
238 |
</not>
|
|
239 |
<then>
|
|
240 |
<echo>Building doc: @{document}</echo>
|
|
241 |
<exec executable="python" dir="${doc.src.dir}" failonerror="${failonerror}">
|
|
242 |
<arg value="${nokia.python.tools}/rst2s5.py"/>
|
|
243 |
<arg value="@{document}"/>
|
|
244 |
<arg value="${document.no.ext}.html"/>
|
|
245 |
</exec>
|
|
246 |
</then>
|
|
247 |
</if>
|
|
248 |
</sequential>
|
|
249 |
</for>
|
|
250 |
</target>
|
|
251 |
|
|
252 |
|
|
253 |
<!-- Generate HTML documentation from .rst documents. Used for DP
|
|
254 |
|
|
255 |
TODO: Refactor to just have one target. -->
|
|
256 |
<target name="textdocs-old" depends="overview-to-html">
|
587
|
257 |
<mkdir dir="${doc.build.dir}"/>
|
|
258 |
<copy todir="${doc.build.dir}-old">
|
|
259 |
<fileset dir="${doc.src.dir}" excludes="cover.rst"/>
|
217
|
260 |
<fileset dir="${nokia.dir}/doc/src"/>
|
|
261 |
</copy>
|
587
|
262 |
<!--
|
|
263 |
<copy todir="${doc.build.dir}-old/images">
|
217
|
264 |
<fileset dir="${doc.src.dir}/images"/>
|
|
265 |
</copy>
|
587
|
266 |
-->
|
217
|
267 |
<for param="document">
|
587
|
268 |
<fileset dir="${doc.build.dir}-old">
|
217
|
269 |
<include name="**/*.rst" />
|
|
270 |
<exclude name="index.rst" /><!-- index.rst is the top-level doc for new-style docs -->
|
|
271 |
</fileset>
|
|
272 |
<sequential>
|
|
273 |
<propertyregex property="document.no.ext" input="@{document}" regexp="\.rst$" replace="" override="true"/>
|
|
274 |
<if>
|
|
275 |
<not>
|
|
276 |
<uptodate srcfile="@{document}" targetfile="${document.no.ext}.html"/>
|
|
277 |
</not>
|
|
278 |
<then>
|
|
279 |
<echo>Building doc: @{document}</echo>
|
|
280 |
<exec executable="python" dir="${doc.src.dir}" failonerror="${failonerror}">
|
|
281 |
<!--<env key="PYTHONPATH" value="${helium.dir}\${python25.lib};tools\common\python\lib"/>-->
|
|
282 |
<arg value="${nokia.python.tools}\rst2html.py"/>
|
|
283 |
<arg line="--traceback --no-toc-backlinks"/>
|
|
284 |
<!-- -stylesheet-path nokia_style.css -->
|
|
285 |
<arg value="@{document}"/>
|
|
286 |
<arg value="${document.no.ext}.html"/>
|
|
287 |
</exec>
|
|
288 |
</then>
|
|
289 |
</if>
|
|
290 |
</sequential>
|
|
291 |
</for>
|
|
292 |
</target>
|
|
293 |
|
|
294 |
|
|
295 |
<!-- Search Python internal module used in helium -->
|
|
296 |
<target name="find-python-dependencies" depends="database">
|
|
297 |
<hlm:assertPropertySet property="helium.dir" message="Property helium.dir is not defined." />
|
|
298 |
<hlm:assertPropertySet property="database.file" message="Property database.file is not defined."/>
|
|
299 |
<hlm:python failonerror="true">
|
|
300 |
import re
|
|
301 |
import os
|
|
302 |
import amara
|
|
303 |
import codecs
|
|
304 |
import ant
|
|
305 |
import docs
|
|
306 |
|
|
307 |
setpath = r'${helium.dir}'+'/tools'
|
|
308 |
|
|
309 |
print "Searching under "+setpath
|
|
310 |
|
|
311 |
dbPath = r'${database.file}'
|
|
312 |
dbPath = 'file:///'+ dbPath.replace('\\','/')
|
|
313 |
dbPrj = amara.parse(dbPath)
|
|
314 |
|
|
315 |
docs.find_python_dependencies(setpath, dbPath, dbPrj)
|
|
316 |
|
|
317 |
file_object = codecs.open(r'${database.file}', 'w', "utf_8")
|
|
318 |
file_object.write(dbPrj.xml(indent=u"yes"))
|
|
319 |
file_object.close()
|
|
320 |
</hlm:python>
|
|
321 |
</target>
|
|
322 |
|
|
323 |
|
|
324 |
<!-- Reads the Java libraries and extracts a list of their versions. -->
|
|
325 |
<target name="library-versions">
|
|
326 |
<script language="jython" setbeans="false">
|
|
327 |
import java.io
|
|
328 |
import java.util.jar
|
628
|
329 |
antlibsDir = java.io.File('external/antlibs2')
|
217
|
330 |
print antlibsDir
|
|
331 |
jarFiles = antlibsDir.listFiles()
|
|
332 |
for jar in jarFiles:
|
|
333 |
if jar.getName().endswith('jar'):
|
|
334 |
jarFile = java.util.jar.JarFile(jar)
|
|
335 |
manifest = jarFile.getManifest()
|
|
336 |
attributes = manifest.getMainAttributes()
|
|
337 |
implementationVersion = attributes.getValue('Implementation-Version')
|
|
338 |
print jar.getName() + ': ' + str(implementationVersion)
|
|
339 |
</script>
|
|
340 |
</target>
|
|
341 |
|
|
342 |
|
|
343 |
<!-- Generates a subcon dependancy diagram based on Egg and Jars files -->
|
|
344 |
<target name="dependency-diagram-subcon">
|
|
345 |
<fileset id="subcon.jar.files" dir="${helium.dir}">
|
587
|
346 |
<include name="external/antlibs2/*.jar"/>
|
217
|
347 |
</fileset>
|
|
348 |
<antcall target="dependency-diagram">
|
|
349 |
<reference refid="subcon.jar.files" torefid="jar.files"/>
|
|
350 |
<param name="python.exclude.dir" value="${helium.dir}\external\python\lib\2.5\internal"/>
|
587
|
351 |
<param name="dependency.grph" value="${doc.build.dir}/images/dependencies_subcon.grph"/>
|
217
|
352 |
<param name="subcon" value="true"/>
|
|
353 |
</antcall>
|
|
354 |
</target>
|
|
355 |
|
|
356 |
|
|
357 |
<fileset id="jar.files" dir="${helium.dir}">
|
628
|
358 |
<include name="external/antlibs2/*.jar"/>
|
217
|
359 |
</fileset>
|
|
360 |
|
|
361 |
|
|
362 |
<!-- Generates a dependancy diagram based on Egg and Jars files -->
|
|
363 |
<target name="dependency-diagram">
|
587
|
364 |
<mkdir dir="${doc.temp.dir}"/>
|
217
|
365 |
<!-- Location of dependency.grph
|
|
366 |
@type string
|
|
367 |
@scope private
|
|
368 |
-->
|
587
|
369 |
<property name="dependency.grph" value="${doc.temp.dir}/dependencies.grph"/>
|
217
|
370 |
|
|
371 |
<!---->
|
587
|
372 |
<copy todir="${doc.temp.dir}/dependencylibs" flatten="true">
|
217
|
373 |
<fileset refid="jar.files"/>
|
|
374 |
</copy>
|
|
375 |
|
587
|
376 |
<hlm:antdependency outputFile="${doc.temp.dir}/antdependencies.grph">
|
|
377 |
<fileset dir="${doc.temp.dir}/dependencylibs" includes="*.jar"/>
|
217
|
378 |
</hlm:antdependency>
|
|
379 |
|
|
380 |
<taskdef name="jaranalyzer" classname="com.kirkk.analyzer.textui.JarAnalyzerTask"/>
|
587
|
381 |
<jaranalyzer srcdir="${doc.temp.dir}/dependencylibs" destfile="${dependency.grph}" summaryclass="com.kirkk.analyzer.textui.DOTSummary"/>
|
217
|
382 |
|
587
|
383 |
<loadfile srcfile="${doc.temp.dir}/antdependencies.grph" property="antdependencies"/>
|
217
|
384 |
<replace file="${dependency.grph}" token="}" value="${antdependencies}}"/>
|
|
385 |
|
|
386 |
<antcall target="dependency-grouping"/>
|
|
387 |
|
|
388 |
<exec executable="dot">
|
|
389 |
<arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.grph} -O"/>
|
|
390 |
</exec>
|
|
391 |
|
587
|
392 |
<delete dir="${doc.temp.dir}/dependencylibs"/>
|
217
|
393 |
</target>
|
|
394 |
|
|
395 |
|
|
396 |
<!-- @scope private -->
|
|
397 |
<target name="dependency-grouping">
|
|
398 |
<!-- Location of dependency.grph
|
|
399 |
@type string
|
|
400 |
@scope private
|
|
401 |
-->
|
587
|
402 |
<property name="dependency.grph" value="${doc.temp.dir}/dependencies.grph"/>
|
217
|
403 |
<!-- Location of nokia internal python library
|
|
404 |
@type string
|
|
405 |
-->
|
|
406 |
<property name="python.internal.dir" value="${nokia.dir}\external\python\lib\2.5"/>
|
|
407 |
<!-- subcon
|
|
408 |
@type string
|
|
409 |
-->
|
|
410 |
<property name="subcon" value=""/>
|
|
411 |
<!-- Ivy configuration file
|
|
412 |
@type string
|
|
413 |
@scope private
|
|
414 |
-->
|
|
415 |
<property name="ivy.xml.file" value="${helium.dir}/config/ivy/ivy.xml"/>
|
|
416 |
<hlm:python>
|
|
417 |
import os
|
|
418 |
import dependancygraph
|
|
419 |
|
|
420 |
dependancygraph.createGraph(r'${ivy.xml.file}', r'${dependency.grph}', r'${python.dir}', r'${python.internal.dir}', r'${subcon}')
|
|
421 |
</hlm:python>
|
|
422 |
<!--
|
|
423 |
<exec executable="dot">
|
|
424 |
<arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.egg.grph} -O"/>
|
|
425 |
</exec>
|
|
426 |
-->
|
|
427 |
</target>
|
|
428 |
|
|
429 |
|
|
430 |
<!-- Generates a dependancy diagram of ant projects to helium external files -->
|
|
431 |
<target name="dependency-external">
|
|
432 |
<!-- Location of dependencies_external.grph
|
|
433 |
@type string
|
|
434 |
@scope private
|
|
435 |
-->
|
587
|
436 |
<property name="dependency.external.grph" value="${doc.temp.dir}/dependencies_external.grph"/>
|
217
|
437 |
<copy file="${database.file}" tofile="${database.file}.parsed" overwrite="true">
|
|
438 |
<filterchain>
|
|
439 |
<expandproperties/>
|
|
440 |
</filterchain>
|
|
441 |
</copy>
|
|
442 |
<hlm:python>
|
|
443 |
import os
|
|
444 |
import dependancygraph
|
|
445 |
|
|
446 |
dependancygraph.externalDependancies(r'${database.file}.parsed', r'${dependency.external.grph}')
|
|
447 |
</hlm:python>
|
|
448 |
<!---->
|
|
449 |
<exec executable="dot">
|
|
450 |
<arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.external.grph} -O"/>
|
|
451 |
</exec>
|
|
452 |
</target>
|
|
453 |
|
|
454 |
|
|
455 |
<!-- Convert db file. @scope private-->
|
|
456 |
<target name="dependency-db-convert" depends="database">
|
|
457 |
<copy file="${database.file}" tofile="${database.file}.parsed" overwrite="true">
|
|
458 |
<filterchain>
|
|
459 |
<expandproperties/>
|
|
460 |
</filterchain>
|
|
461 |
</copy>
|
|
462 |
</target>
|
|
463 |
|
|
464 |
|
|
465 |
<!-- Generates a dependancy diagram of log files -->
|
|
466 |
<target name="dependency-logs">
|
587
|
467 |
<mkdir dir="${doc.temp.dir}/manual"/>
|
217
|
468 |
<!-- Location of dependencies_external.grph
|
|
469 |
@type string
|
|
470 |
@scope private
|
|
471 |
-->
|
587
|
472 |
<property name="dependency.external.grph" value="${doc.temp.dir}/manual/dependencies_log.grph"/>
|
217
|
473 |
|
|
474 |
<antcall target="dependency-db-convert" inheritAll="false">
|
|
475 |
<param name="build.drive" value="build.drive"/>
|
|
476 |
<param name="build.id" value="build.id"/>
|
|
477 |
<param name="build.log.dir" value="/output/logs"/>
|
|
478 |
</antcall>
|
587
|
479 |
<delete dir="${helium.dir}/build.drive"/>
|
|
480 |
|
|
481 |
<hlm:python failonerror="true">
|
217
|
482 |
import os
|
|
483 |
import dependancygraph
|
|
484 |
|
|
485 |
dependancygraph.findLogFiles(r'${database.file}.parsed', r'${dependency.external.grph}')
|
|
486 |
</hlm:python>
|
|
487 |
<!---->
|
|
488 |
<exec executable="dot">
|
|
489 |
<arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.external.grph} -O"/>
|
|
490 |
</exec>
|
|
491 |
</target>
|
|
492 |
|
|
493 |
|
|
494 |
<!-- Creates user flow diagram -->
|
|
495 |
<target name="helium-user-graph">
|
587
|
496 |
<mkdir dir="${doc.build.dir}/api"/>
|
|
497 |
<fmpp sourcefile="${helium.dir}/doc/src/user_graph.dot.ftl" outputfile="${doc.temp.dir}/user_graph.dot">
|
217
|
498 |
<data expandProperties="yes">
|
|
499 |
ant: antProperties()
|
|
500 |
</data>
|
|
501 |
</fmpp>
|
|
502 |
<for param="dot.file">
|
587
|
503 |
<fileset dir="${doc.temp.dir}" includes="user_graph.dot"/>
|
217
|
504 |
<sequential>
|
|
505 |
<echo>Processing dot file: @{dot.file}</echo>
|
587
|
506 |
<exec executable="dot" dir="${doc.temp.dir}/">
|
217
|
507 |
<arg line="-Tcmap @{dot.file} -O"/>
|
|
508 |
</exec>
|
587
|
509 |
<exec executable="dot" dir="${doc.build.dir}/api">
|
217
|
510 |
<arg line="-Tpng @{dot.file} -O"/>
|
|
511 |
</exec>
|
|
512 |
</sequential>
|
|
513 |
</for>
|
587
|
514 |
<!-- This must have special handling because the rst file uses raw HTML to include it. -->
|
|
515 |
<move todir="${doc.build.dir}" overwrite="true">
|
|
516 |
<fileset dir="${doc.temp.dir}" includes="user_graph.dot.png"/>
|
217
|
517 |
</move>
|
|
518 |
</target>
|
|
519 |
|
|
520 |
</project>
|