buildframework/helium/tools/common/helium_docs.ant.xml
branchwip
changeset 380 db59fc762214
parent 217 0f5e3a7fb6af
child 587 85df38eb4012
equal deleted inserted replaced
369:1248e8f6a72d 380:db59fc762214
       
     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">
       
    37         <fmpp sourceFile="${helium.doc.src.dir}/src/helium_overview.html.ftl"
       
    38               outputFile="${docs.build.dir}/temp/doc/helium_overview.html"
       
    39               replaceExtension="html.ftl, html" expert="true">
       
    40             <data expandProperties="yes">
       
    41                 doc: xml(${helium.doc.src.dir}/src/helium_overview.xml)
       
    42             </data>
       
    43         </fmpp>
       
    44     </target>
       
    45 
       
    46     
       
    47     <!-- Macro to generate the tools dependency xml output. -->
       
    48     <macrodef name="createToolsTableMacro" uri="http://www.nokia.com/helium">
       
    49         <attribute name="dir"/>
       
    50         <attribute name="failonerror"/>
       
    51         <attribute name="configs"/>
       
    52         <sequential>
       
    53             <ivy:configure file="${tools.ivy.config.file}" override="true"/>
       
    54             <ivy:resolve file="${helium.dir}/config/ivy/ivy.xml" conf="@{configs}" haltonfailure="@{failonerror}"/>
       
    55             <ivy:report todir="@{dir}" outputpattern="tool-dependencies-[conf].xml"
       
    56                         conf="@{configs}" xml="true" graph="false" xsl="false"/>
       
    57         </sequential>
       
    58     </macrodef>
       
    59 
       
    60     
       
    61     <!-- Generates the tools dependency xml output. used in the retrieving Helium section to
       
    62     list the tools used within Helium. -->
       
    63     <target name="tools-rst-table">
       
    64         <hlm:createToolsTableMacro dir="${docs.build.dir}/ivy" failonerror="false" 
       
    65             configs="core,ido"/>
       
    66         <fmpp sourceFile="${helium.doc.src.dir}/src/manual/tool-dependencies.rst.ftl" includes="*.dot.ftl"
       
    67               outputFile="${docs.build.dir}/temp/doc/nokia/tool-dependencies.rst_include"
       
    68               replaceExtension="dot.ftl, dot">
       
    69             <data expandProperties="yes">
       
    70                 doc: xml(${docs.build.dir}/ivy/tool-dependencies-ido.xml)
       
    71             </data>
       
    72         </fmpp>
       
    73     </target>
       
    74     
       
    75     
       
    76     <!-- Create a complete dependency graph of Helium libraries. 
       
    77         
       
    78     Currently this does not work correctly but it is useful for future testing of repreport. -->
       
    79     <target name="libraries-dependencies">
       
    80         <ivy:settings file="${tools.ivy.config.file}"/>
       
    81         <!--<ivy:resolve file="${helium.dir}/config/ivy/ivy.xml" conf="" haltonfailure="false"/>-->
       
    82         <delete file="@{dir}/ivy-repository-report.xml"/>
       
    83         <ivy:repreport todir="${docs.build.dir}/ivy" organisation="S60_SAM"
       
    84                     xml="true" graph="false" xsl="false"/>
       
    85         <!--<fmpp sourceFile="${doc.src.dir}/src/manual/tool-dependencies.rst.ftl" includes="*.dot.ftl"
       
    86               outputFile="${docs.build.dir}/temp/doc/manual/tool-dependencies.rst_include"
       
    87               replaceExtension="dot.ftl, dot">
       
    88             <data expandProperties="yes">
       
    89                 doc: xml(${docs.build.dir}/doc/ivy/tool-dependencies-ido.xml)
       
    90             </data>
       
    91         </fmpp>-->
       
    92     </target>
       
    93 
       
    94     
       
    95     <!-- Generate Python API documentation using epydoc. -->
       
    96     <target name="python-apidocs">
       
    97         <mkdir dir="${docs.build.dir}/api/python"/>
       
    98         <pathconvert pathsep=" " property="epydoc.python.modules.path">
       
    99             <fileset refid="python.library.files"/>
       
   100         </pathconvert>
       
   101         <echo>Python modules path: ${epydoc.python.modules.path}</echo>
       
   102         <exec executable="python" dir="${docs.build.dir}" failonerror="true">        
       
   103             <arg line="${python.tools}/epydoc"/>
       
   104             <arg value="-v"/>
       
   105             <arg value="--config=${helium.dir}/config/epydoc.conf"/>
       
   106             <arg value="--exclude=sgmllib"/>
       
   107             <arg line="${epydoc.python.modules.path}"/>
       
   108         </exec>
       
   109     </target>
       
   110     
       
   111     
       
   112     <!-- Generate Java API documentation using javadoc. -->
       
   113     <target name="java-apidocs" depends="install-cruisecontrol">
       
   114         <path id="classpath-javadoc">
       
   115             <fileset dir="${helium.dir}/external/CruiseControl/lib" includes="*.jar"/>
       
   116             <fileset dir="${helium.dir}/external" includes="**/*.jar"/>
       
   117             <pathelement path="${helium.dir}/external/CruiseControl/webapps/dashboard/WEB-INF/classes"/>
       
   118         </path>
       
   119         <javadoc classpathref="classpath-javadoc" 
       
   120             destdir="${docs.build.dir}/api/java" useexternalfile="true">
       
   121             <packageset dir="tools/common/java/src" defaultexcludes="yes"/>
       
   122             <packageset dir="tools/common/java/test" defaultexcludes="yes"/>
       
   123             <doctitle><![CDATA[<h1>API Documentation</h1>]]></doctitle>
       
   124         </javadoc>
       
   125     </target>
       
   126     
       
   127     
       
   128     <!-- Generate Ant API documentation using antdoclet. -->
       
   129     <target name="antdoclet">
       
   130         <path id="doclet-classpath">
       
   131             <pathelement path="${java.class.path}/"/>
       
   132             <pathelement path="${helium.dir}/external/CruiseControl/webapps/dashboard/WEB-INF/classes"/>
       
   133         </path>
       
   134         <mkdir dir="${docs.build.dir}/api/ant"/>
       
   135 
       
   136         <!-- First copy the "static" resources (images, static html files) -->
       
   137         <copy todir="${docs.build.dir}/api/ant" overwrite="true">
       
   138             <fileset dir="${helium.dir}/doc/src/antdoclet/html">
       
   139                 <exclude name="*.vm"/>
       
   140             </fileset>
       
   141         </copy>
       
   142       
       
   143         <!-- Now invoke AntDoclet to generate the "dynamic" content from the templates -->
       
   144         <javadoc access="private" sourcepath="${helium.dir}/tools/common/java/src/"
       
   145                  destdir="${docs.build.dir}/api/ant"
       
   146                  packagenames="com.nokia.ant,com.nokia.ant.filters,com.nokia.ant.types.imaker,com.nokia.ant.types,com.nokia.ant.listerner,com.nokia.ant.taskdefs,com.nokia.ant.taskdefs.ccm.commands,com.nokia.cruisecontrol,com.nokia.cruisecontrol.sourcecontrol,com.nokia.fmpp,nokia.ivy"
       
   147                  docletpathref="doclet-classpath" source="1.6"
       
   148                  useexternalfile="true">
       
   149             <doclet name="com.neuroning.antdoclet.AntDoclet">
       
   150                 <param name="-doctitle" value="${build.name}" />
       
   151                 <param name="-templatesdir" value="${doc.src.dir}/src/antdoclet/html"/>
       
   152                 <param name="-templates" value="main.vm"/>
       
   153             </doclet>
       
   154         </javadoc>
       
   155         <move file="velocity.log" tofile="build/velocity.log" failonerror="false"/>
       
   156     </target>
       
   157 
       
   158         
       
   159     <!-- Builds the Helium API documentation. -->
       
   160     <target name="helium-apidocs" depends="clean-helium-apidocs,database,
       
   161                     find-python-dependencies,helium-api-dependency-images,helium-api-html-docs"/>
       
   162     
       
   163     
       
   164     <target name="helium-prep-textdocs">
       
   165         <copy todir="${docs.build.dir}/temp/doc/nokia" failonerror="false">
       
   166             <fileset dir="${nokia.dir}/doc/src">
       
   167                 <include name="**/*.rst"/>
       
   168                 <include name="**/*.css"/>
       
   169                 <include name="**/*.jpg"/>
       
   170             </fileset>
       
   171         </copy>
       
   172         
       
   173         <mkdir dir="${docs.build.dir}/temp/doc/minibuilds"/>
       
   174         <copy todir="${docs.build.dir}/temp/doc/minibuilds" failonerror="false">
       
   175             <fileset dir="${helium.dir}/tests/minibuilds/">
       
   176                 <include name="*/doc/**/*"/>
       
   177             </fileset>
       
   178         </copy>
       
   179 
       
   180         <!-- Including Helium antlib doc -->
       
   181         <mkdir dir="${docs.build.dir}/temp/doc/helium-antlib"/>
       
   182         <copy todir="${docs.build.dir}/temp/doc/helium-antlib" failonerror="false" flatten="true">
       
   183             <fileset dir="${helium.dir}/external/helium-antlib">
       
   184                 <include name="**/*.rst"/>
       
   185                 <include name="**/*.css"/>
       
   186                 <include name="**/*.jpg"/>
       
   187             </fileset>
       
   188         </copy>
       
   189     </target>
       
   190     
       
   191         
       
   192     <!-- Generate all documentation. -->
       
   193     <target name="add-policies-to-docs" unless="env.HLM_SUBCON">
       
   194         <hlm:updatePolicy policy="7" filename="distribution.policy.S60">         
       
   195             <dirset dir="${helium.dir}" includes="${docs.build.dir}/**/*"/>        
       
   196         </hlm:updatePolicy>   
       
   197     </target>
       
   198     
       
   199     
       
   200     <!-- Creates XML and .rst documents describing the difference between
       
   201     this version of Helium and the previous major release. -->
       
   202     <target name="release-diff" depends="database" unless="env.HLM_SUBCON">
       
   203         <mkdir dir="${docs.build.dir}"/>
       
   204         <!-- URL for the database.xml of last major release
       
   205         @type string
       
   206         @scope private
       
   207         -->
       
   208         <property name="last.major.release.database.url" value="${documentation.url.root}/${last.major.helium.version}/database.xml"/>
       
   209         <hlm:python>
       
   210 import urllib
       
   211 import helium.documentation
       
   212 
       
   213 old_db_file = urllib.urlopen(r'${last.major.release.database.url}')
       
   214 writer = helium.documentation.APIDeltaWriter(old_db_file, r'${database.file}')
       
   215 writer.write(r'${docs.build.dir}/api_changes.xml')
       
   216         </hlm:python>
       
   217         <if>
       
   218             <available file="${docs.build.dir}/api_changes.xml"/>
       
   219             <then>
       
   220                 <fmpp sourceFile="${helium.doc.src.dir}/src/api_changes.rst.ftl" outputFile="${docs.build.dir}/temp/doc/api_changes.rst">
       
   221                     <data expandProperties="yes">
       
   222                         doc: xml(${docs.build.dir}/api_changes.xml)
       
   223                         old_release: ${last.major.helium.version}
       
   224                         new_release: ${helium.version}
       
   225                     </data>
       
   226                 </fmpp>
       
   227             </then>
       
   228         </if>
       
   229     </target>
       
   230     
       
   231     
       
   232     <!-- Generate docs for Symbian Foundataion -->
       
   233     <target name="docs-sf">
       
   234         <delete dir="${docs.build.dir}"/>
       
   235         <antcall target="helium-subcon-release"/>
       
   236         <unzip src="${docs.build.dir}/helium_${helium.version}_subcon.zip" dest="${docs.build.dir}/helium_${helium.version}_subcon" overwrite="true" />
       
   237         <!---->
       
   238         <exec executable="cmd" dir="${docs.build.dir}/helium_${helium.version}_subcon/helium">
       
   239             <env key="HELIUM_HOME" value="${docs.build.dir}/helium_${helium.version}_subcon/helium"/>
       
   240             <env key="PYTHONPATH" value="${env.PYTHONPATH}"/>
       
   241             <env key="ANT_ARGS" value="${env.ANT_ARGS}"/>
       
   242             <arg line="/C hlm.bat"/>
       
   243             <arg value="docs"/>
       
   244             <arg value="-Dpython.tools=${python.tools}"/>
       
   245             <arg value="-Dsf=true"/>
       
   246         </exec>
       
   247     </target>
       
   248     
       
   249     
       
   250     <!-- Clean old build/doc dir. -->
       
   251     <target name="clean-doc-dir">
       
   252         <delete dir="build/doc"/>
       
   253         <delete dir="build/temp/doc"/>        
       
   254     </target>
       
   255     
       
   256     
       
   257     <!-- Connect to home drive if it is not connected for .netrc file. -->
       
   258     <target name="check-home-drive">
       
   259         <exec executable="cmd">
       
   260             <arg value="/c"/>
       
   261             <arg value="${helium.dir}/tools/common/bin/check_home_drv.bat"/>
       
   262             <arg value=">nul"/>
       
   263         </exec>
       
   264     </target>
       
   265     
       
   266     
       
   267     <!-- Upload generated HTML docs to the Helium server. -->
       
   268     <target name="upload-docs" depends="check-home-drive">
       
   269         <!-- The full path on the host server where the Helium documentation is stored.
       
   270         @type string
       
   271         @scope private
       
   272         -->
       
   273         <property name="documentation.path" value="${documentation.path.root}"/>
       
   274         <property name="docs.zip" value="${docs.build.dir}/helium-docs.zip"/>
       
   275 
       
   276         <!-- Python API docs. -->
       
   277         <delete file="${docs.zip}"/>
       
   278         <zip destfile="${docs.zip}">
       
   279             <fileset dir="${docs.build.dir}" includes="**/*"/>
       
   280         </zip>
       
   281         <sshexec host="${documentation.host}"
       
   282                  username="${user.name}"
       
   283                  keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
       
   284                  trust="true"
       
   285                  command="mkdir -p ${documentation.path}"/>
       
   286         <scp todir="${user.name}@${documentation.host}:${documentation.path}"
       
   287           keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
       
   288           passphrase=""
       
   289           trust="true"
       
   290           sftp="true"
       
   291           file="${docs.zip}"/>
       
   292         <sshexec host="${documentation.host}"
       
   293                  username="${user.name}"
       
   294                  keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
       
   295                  trust="true"
       
   296                  command="cd ${documentation.path}; unzip -u -o helium-docs.zip; chmod -R 777 ."/>
       
   297     </target>
       
   298     
       
   299     
       
   300     <!-- Upload generated HTML docs to the Helium server. -->
       
   301     <target name="upload-release-docs">
       
   302         <!-- The full path on the host server where the Helium documentation is stored.
       
   303         @type string
       
   304         @scope private
       
   305         -->
       
   306         <property name="documentation.path" value="${documentation.path.root}/${helium.version}"/>
       
   307         <antcall target="upload-docs"/>
       
   308     </target>
       
   309     
       
   310     
       
   311     <!-- create slides from images -->
       
   312     <target name="slides">
       
   313         <mkdir dir="${docs.build.dir}/slides"/>
       
   314     
       
   315         <copy todir="${docs.build.dir}/slides">
       
   316             <fileset dir="${doc.src.dir}/slides"/>
       
   317         </copy>
       
   318 
       
   319         <copy todir="${docs.build.dir}/slides/images">
       
   320             <fileset dir="${doc.src.dir}/slides/images"/>
       
   321         </copy>
       
   322     
       
   323         <for param="document">
       
   324             <fileset dir="${docs.build.dir}/slides" includes="**/*.rst"/>
       
   325             <sequential>
       
   326                 <propertyregex property="document.no.ext" input="@{document}" regexp="\.rst$" replace="" override="true"/>
       
   327                 <if>
       
   328                     <not>
       
   329                         <uptodate srcfile="@{document}" targetfile="${document.no.ext}.html"/>
       
   330                     </not>
       
   331                     <then>
       
   332                         <echo>Building doc: @{document}</echo>
       
   333                         <exec executable="python" dir="${doc.src.dir}" failonerror="${failonerror}">
       
   334                             <arg value="${nokia.python.tools}/rst2s5.py"/>
       
   335                             <arg value="@{document}"/>
       
   336                             <arg value="${document.no.ext}.html"/>
       
   337                         </exec>
       
   338                     </then>
       
   339                 </if>
       
   340             </sequential>
       
   341         </for>
       
   342     </target>
       
   343 
       
   344         
       
   345     <!-- Generate HTML documentation from .rst documents. Used for DP
       
   346     
       
   347     TODO: Refactor to just have one target. -->
       
   348     <target name="textdocs-old" depends="overview-to-html">
       
   349         <mkdir dir="${docs.build.dir}"/>
       
   350         <copy todir="${docs.build.dir}-old">
       
   351             <fileset dir="${doc.src.dir}/src" excludes="cover.rst"/>
       
   352             <fileset dir="${nokia.dir}/doc/src"/>
       
   353         </copy>
       
   354         
       
   355         <copy todir="${docs.build.dir}-old/images">
       
   356             <fileset dir="${doc.src.dir}/images"/>
       
   357         </copy>
       
   358         
       
   359         <for param="document">
       
   360             <fileset dir="${docs.build.dir}-old">
       
   361                 <include name="**/*.rst" />
       
   362                 <exclude name="index.rst" /><!-- index.rst is the top-level doc for new-style docs -->
       
   363             </fileset>
       
   364             <sequential>
       
   365                 <propertyregex property="document.no.ext" input="@{document}" regexp="\.rst$" replace="" override="true"/>
       
   366                 <if>
       
   367                     <not>
       
   368                         <uptodate srcfile="@{document}" targetfile="${document.no.ext}.html"/>
       
   369                     </not>
       
   370                     <then>
       
   371                         <echo>Building doc: @{document}</echo>                        
       
   372                         <exec executable="python" dir="${doc.src.dir}" failonerror="${failonerror}">
       
   373                             <!--<env key="PYTHONPATH" value="${helium.dir}\${python25.lib};tools\common\python\lib"/>-->
       
   374                             <arg value="${nokia.python.tools}\rst2html.py"/>
       
   375                             <arg line="--traceback --no-toc-backlinks"/>
       
   376                             <!-- -stylesheet-path nokia_style.css -->
       
   377                             <arg value="@{document}"/>
       
   378                             <arg value="${document.no.ext}.html"/>
       
   379                         </exec>
       
   380                     </then>
       
   381                 </if>
       
   382             </sequential>
       
   383         </for>
       
   384     </target>
       
   385     
       
   386     
       
   387     <!-- Search Python internal module used in helium -->
       
   388     <target name="find-python-dependencies" depends="database">    
       
   389         <hlm:assertPropertySet property="helium.dir" message="Property helium.dir is not defined." />
       
   390         <hlm:assertPropertySet property="database.file" message="Property database.file is not defined."/>
       
   391         <hlm:python failonerror="true">
       
   392 import re
       
   393 import os
       
   394 import amara
       
   395 import codecs
       
   396 import ant
       
   397 import docs
       
   398 
       
   399 setpath = r'${helium.dir}'+'/tools'
       
   400 
       
   401 print "Searching under "+setpath
       
   402 
       
   403 dbPath = r'${database.file}'
       
   404 dbPath = 'file:///'+ dbPath.replace('\\','/')
       
   405 dbPrj = amara.parse(dbPath)
       
   406 
       
   407 docs.find_python_dependencies(setpath, dbPath, dbPrj)
       
   408 
       
   409 file_object = codecs.open(r'${database.file}', 'w', "utf_8")
       
   410 file_object.write(dbPrj.xml(indent=u"yes"))
       
   411 file_object.close()
       
   412         </hlm:python>
       
   413     </target>
       
   414     
       
   415     
       
   416     <!-- Reads the Java libraries and extracts a list of their versions. -->
       
   417     <target name="library-versions">    
       
   418         <script language="jython" setbeans="false">
       
   419 import java.io
       
   420 import java.util.jar
       
   421 antlibsDir = java.io.File('external/antlibs')
       
   422 print antlibsDir
       
   423 jarFiles = antlibsDir.listFiles()
       
   424 for jar in jarFiles:
       
   425     if jar.getName().endswith('jar'):
       
   426         jarFile = java.util.jar.JarFile(jar)
       
   427         manifest = jarFile.getManifest()
       
   428         attributes = manifest.getMainAttributes()
       
   429         implementationVersion = attributes.getValue('Implementation-Version')
       
   430         print jar.getName() + ': ' + str(implementationVersion)
       
   431         </script>
       
   432     </target>
       
   433     
       
   434     
       
   435     <!-- Generates a subcon dependancy diagram based on Egg and Jars files -->
       
   436     <target name="dependency-diagram-subcon">
       
   437         <fileset id="subcon.jar.files" dir="${helium.dir}">
       
   438             <include name="external/antlibs/*.jar"/>
       
   439             <include name="external/jep/**/*.jar"/>
       
   440             <include name="external/helium-antlib/bin/**/*.jar"/>
       
   441             <include name="tools/**/*.jar"/>
       
   442         </fileset>
       
   443         <antcall target="dependency-diagram">
       
   444             <reference refid="subcon.jar.files" torefid="jar.files"/>
       
   445             <param name="python.exclude.dir" value="${helium.dir}\external\python\lib\2.5\internal"/>
       
   446             <param name="dependency.grph" value="${docs.build.dir}/images/dependencies_subcon.grph"/>
       
   447             <param name="subcon" value="true"/>
       
   448         </antcall>
       
   449     </target>
       
   450     
       
   451     
       
   452     <fileset id="jar.files" dir="${helium.dir}">
       
   453         <include name="external/antlibs/**/*.jar"/>
       
   454         <include name="external/jep/**/*.jar"/>
       
   455         <include name="external/helium-antlib/**/*.jar"/>
       
   456         <include name="tools/**/*.jar"/>
       
   457         <include name="extensions/nokia/external/antlibs/**/*.jar"/>
       
   458     </fileset>
       
   459     
       
   460     
       
   461     <!-- Generates a dependancy diagram based on Egg and Jars files -->
       
   462     <target name="dependency-diagram">
       
   463         <mkdir dir="${docs.build.dir}/images"/>
       
   464         <mkdir dir="${temp.build.dir}"/>
       
   465         <!-- Location of dependency.grph
       
   466         @type string
       
   467         @scope private
       
   468         -->
       
   469         <property name="dependency.grph" value="${docs.build.dir}/images/dependencies.grph"/>
       
   470         
       
   471         <!---->
       
   472         <copy todir="${temp.build.dir}/dependencylibs" flatten="true">
       
   473             <fileset refid="jar.files"/>
       
   474         </copy>
       
   475         
       
   476         <hlm:antdependency outputFile="${temp.build.dir}/antdependencies.grph">
       
   477             <fileset dir="${temp.build.dir}/dependencylibs" includes="*.jar"/>
       
   478         </hlm:antdependency>
       
   479         
       
   480         <taskdef name="jaranalyzer" classname="com.kirkk.analyzer.textui.JarAnalyzerTask"/>
       
   481         <jaranalyzer srcdir="${temp.build.dir}/dependencylibs" destfile="${dependency.grph}" summaryclass="com.kirkk.analyzer.textui.DOTSummary"/>
       
   482         
       
   483         <loadfile srcfile="${temp.build.dir}/antdependencies.grph" property="antdependencies"/>
       
   484         <replace file="${dependency.grph}" token="}" value="${antdependencies}}"/>
       
   485         
       
   486         <antcall target="dependency-grouping"/>
       
   487         
       
   488         <exec executable="dot">
       
   489             <arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.grph} -O"/>
       
   490         </exec>
       
   491         
       
   492         <delete dir="${temp.build.dir}/dependencylibs"/>
       
   493     </target>
       
   494     
       
   495     
       
   496     <!-- @scope private -->
       
   497     <target name="dependency-grouping">
       
   498         <!-- Location of dependency.grph
       
   499         @type string
       
   500         @scope private
       
   501         -->
       
   502         <property name="dependency.grph" value="${docs.build.dir}/images/dependencies.grph"/>
       
   503         <mkdir dir="${docs.build.dir}/images"/>
       
   504         <!-- Location of nokia internal python library
       
   505         @type string
       
   506         -->
       
   507         <property name="python.internal.dir" value="${nokia.dir}\external\python\lib\2.5"/>
       
   508         <!-- subcon
       
   509         @type string
       
   510         -->
       
   511         <property name="subcon" value=""/>
       
   512         <!-- Ivy configuration file
       
   513         @type string
       
   514         @scope private
       
   515         -->
       
   516         <property name="ivy.xml.file" value="${helium.dir}/config/ivy/ivy.xml"/>
       
   517         <hlm:python>
       
   518 import os
       
   519 import dependancygraph
       
   520 
       
   521 dependancygraph.createGraph(r'${ivy.xml.file}', r'${dependency.grph}', r'${python.dir}', r'${python.internal.dir}', r'${subcon}')
       
   522         </hlm:python>
       
   523         <!--
       
   524         <exec executable="dot">
       
   525             <arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.egg.grph} -O"/>
       
   526         </exec>
       
   527         -->
       
   528     </target>
       
   529     
       
   530     
       
   531     <!-- Generates a dependancy diagram of ant projects to helium external files -->
       
   532     <target name="dependency-external">
       
   533         <!-- Location of dependencies_external.grph
       
   534         @type string
       
   535         @scope private
       
   536         -->
       
   537         <property name="dependency.external.grph" value="${docs.build.dir}/images/dependencies_external.grph"/>
       
   538         <copy file="${database.file}" tofile="${database.file}.parsed" overwrite="true">
       
   539             <filterchain>
       
   540                 <expandproperties/>
       
   541             </filterchain>
       
   542         </copy>
       
   543         <hlm:python>
       
   544 import os
       
   545 import dependancygraph
       
   546 
       
   547 dependancygraph.externalDependancies(r'${database.file}.parsed', r'${dependency.external.grph}')
       
   548         </hlm:python>
       
   549         <!---->
       
   550         <exec executable="dot">
       
   551             <arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.external.grph} -O"/>
       
   552         </exec>
       
   553     </target>
       
   554     
       
   555     
       
   556     <!-- Convert db file. @scope private-->
       
   557     <target name="dependency-db-convert" depends="database">
       
   558         <copy file="${database.file}" tofile="${database.file}.parsed" overwrite="true">
       
   559             <filterchain>
       
   560                 <expandproperties/>
       
   561             </filterchain>
       
   562         </copy>
       
   563     </target>
       
   564     
       
   565     
       
   566     <!-- Generates a dependancy diagram of log files -->
       
   567     <target name="dependency-logs">
       
   568         <!-- Location of dependencies_external.grph
       
   569         @type string
       
   570         @scope private
       
   571         -->
       
   572         <property name="dependency.external.grph" value="${docs.build.dir}/images/dependencies_log.grph"/>
       
   573         
       
   574         <antcall target="dependency-db-convert" inheritAll="false">
       
   575             <param name="build.drive" value="build.drive"/>
       
   576             <param name="build.id" value="build.id"/>
       
   577             <param name="build.log.dir" value="/output/logs"/>
       
   578         </antcall>
       
   579         
       
   580         <hlm:python>
       
   581 import os
       
   582 import dependancygraph
       
   583 
       
   584 dependancygraph.findLogFiles(r'${database.file}.parsed', r'${dependency.external.grph}')
       
   585         </hlm:python>
       
   586         <!---->
       
   587         <exec executable="dot">
       
   588             <arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.external.grph} -O"/>
       
   589         </exec>
       
   590     </target>
       
   591     
       
   592 
       
   593     <!-- Creates user flow diagram -->
       
   594     <target name="helium-user-graph">
       
   595         <mkdir dir="${docs.build.dir}/api"/>
       
   596         <fmpp sourcefile="${helium.dir}/doc/src/user-graph.dot.ftl" outputfile="${docs.build.dir}/temp/doc/user-graph.dot">
       
   597             <data expandProperties="yes">
       
   598               ant: antProperties()
       
   599             </data>
       
   600         </fmpp>
       
   601         <for param="dot.file">
       
   602             <fileset dir="${docs.build.dir}/temp/doc" includes="user-graph.dot"/>
       
   603             <sequential>
       
   604                 <echo>Processing dot file: @{dot.file}</echo>
       
   605                 <exec executable="dot" dir="${docs.build.dir}/temp/doc/">
       
   606                     <arg line="-Tcmap @{dot.file} -O"/>
       
   607                 </exec>
       
   608                 <exec executable="dot" dir="${docs.build.dir}/api">
       
   609                     <arg line="-Tpng @{dot.file} -O"/>
       
   610                 </exec>
       
   611             </sequential>
       
   612         </for>
       
   613         <move todir="${docs.build.dir}/images" overwrite="true">
       
   614             <fileset dir="${docs.build.dir}/temp/doc" includes="user-graph.dot.png"/>
       
   615         </move>
       
   616     </target>
       
   617 
       
   618 </project>