buildframework/helium/tools/common/helium_docs.ant.xml
changeset 587 85df38eb4012
parent 217 0f5e3a7fb6af
child 588 c7c26511138f
--- a/buildframework/helium/tools/common/helium_docs.ant.xml	Thu Mar 04 15:10:37 2010 +0200
+++ b/buildframework/helium/tools/common/helium_docs.ant.xml	Tue Apr 27 08:33:08 2010 +0300
@@ -34,11 +34,11 @@
     
     <!-- Generate an overview of Helium as HTML tables. -->
     <target name="overview-to-html">
-        <fmpp sourceFile="${helium.doc.src.dir}/src/helium_overview.html.ftl"
-              outputFile="${docs.build.dir}/temp/doc/helium_overview.html"
+        <fmpp sourceFile="${helium.doc.src.dir}/helium_custom/helium_overview.html.ftl"
+              outputFile="${doc.temp.dir}/helium_overview.html"
               replaceExtension="html.ftl, html" expert="true">
             <data expandProperties="yes">
-                doc: xml(${helium.doc.src.dir}/src/helium_overview.xml)
+                doc: xml(${helium.doc.src.dir}/helium_custom/helium_overview.xml)
             </data>
         </fmpp>
     </target>
@@ -61,13 +61,13 @@
     <!-- Generates the tools dependency xml output. used in the retrieving Helium section to
     list the tools used within Helium. -->
     <target name="tools-rst-table">
-        <hlm:createToolsTableMacro dir="${docs.build.dir}/ivy" failonerror="false" 
+        <hlm:createToolsTableMacro dir="${doc.build.dir}/ivy" failonerror="false" 
             configs="core,ido"/>
-        <fmpp sourceFile="${helium.doc.src.dir}/src/manual/tool-dependencies.rst.ftl" includes="*.dot.ftl"
-              outputFile="${docs.build.dir}/temp/doc/nokia/tool-dependencies.rst_include"
+        <fmpp sourceFile="${helium.doc.src.dir}/helium_custom/manual/tool-dependencies.rst.ftl" includes="*.dot.ftl"
+              outputFile="${doc.temp.dir}/manual/tool-dependencies.rst_include"
               replaceExtension="dot.ftl, dot">
             <data expandProperties="yes">
-                doc: xml(${docs.build.dir}/ivy/tool-dependencies-ido.xml)
+                doc: xml(${doc.build.dir}/ivy/tool-dependencies-ido.xml)
             </data>
         </fmpp>
     </target>
@@ -80,26 +80,23 @@
         <ivy:settings file="${tools.ivy.config.file}"/>
         <!--<ivy:resolve file="${helium.dir}/config/ivy/ivy.xml" conf="" haltonfailure="false"/>-->
         <delete file="@{dir}/ivy-repository-report.xml"/>
-        <ivy:repreport todir="${docs.build.dir}/ivy" organisation="S60_SAM"
+        <ivy:repreport todir="${doc.build.dir}/ivy" organisation="S60_SAM"
                     xml="true" graph="false" xsl="false"/>
-        <!--<fmpp sourceFile="${doc.src.dir}/src/manual/tool-dependencies.rst.ftl" includes="*.dot.ftl"
-              outputFile="${docs.build.dir}/temp/doc/manual/tool-dependencies.rst_include"
-              replaceExtension="dot.ftl, dot">
-            <data expandProperties="yes">
-                doc: xml(${docs.build.dir}/doc/ivy/tool-dependencies-ido.xml)
-            </data>
-        </fmpp>-->
     </target>
-
     
     <!-- Generate Python API documentation using epydoc. -->
     <target name="python-apidocs">
-        <mkdir dir="${docs.build.dir}/api/python"/>
+        <fileset id="python.library.files" dir="${helium.dir}">
+            <include name="extensions/nokia/tools/common/python/lib/**/*.py"/>
+            <include name="sf/python/**/*.py"/>
+            <include name="nokia/python/**/*.py"/>
+        </fileset>
+        <mkdir dir="${doc.build.dir}/api/python"/>
         <pathconvert pathsep=" " property="epydoc.python.modules.path">
             <fileset refid="python.library.files"/>
         </pathconvert>
         <echo>Python modules path: ${epydoc.python.modules.path}</echo>
-        <exec executable="python" dir="${docs.build.dir}" failonerror="true">        
+        <exec executable="python" dir="${doc.build.dir}" failonerror="true">        
             <arg line="${python.tools}/epydoc"/>
             <arg value="-v"/>
             <arg value="--config=${helium.dir}/config/epydoc.conf"/>
@@ -107,54 +104,6 @@
             <arg line="${epydoc.python.modules.path}"/>
         </exec>
     </target>
-    
-    
-    <!-- Generate Java API documentation using javadoc. -->
-    <target name="java-apidocs" depends="install-cruisecontrol">
-        <path id="classpath-javadoc">
-            <fileset dir="${helium.dir}/external/CruiseControl/lib" includes="*.jar"/>
-            <fileset dir="${helium.dir}/external" includes="**/*.jar"/>
-            <pathelement path="${helium.dir}/external/CruiseControl/webapps/dashboard/WEB-INF/classes"/>
-        </path>
-        <javadoc classpathref="classpath-javadoc" 
-            destdir="${docs.build.dir}/api/java" useexternalfile="true">
-            <packageset dir="tools/common/java/src" defaultexcludes="yes"/>
-            <packageset dir="tools/common/java/test" defaultexcludes="yes"/>
-            <doctitle><![CDATA[<h1>API Documentation</h1>]]></doctitle>
-        </javadoc>
-    </target>
-    
-    
-    <!-- Generate Ant API documentation using antdoclet. -->
-    <target name="antdoclet">
-        <path id="doclet-classpath">
-            <pathelement path="${java.class.path}/"/>
-            <pathelement path="${helium.dir}/external/CruiseControl/webapps/dashboard/WEB-INF/classes"/>
-        </path>
-        <mkdir dir="${docs.build.dir}/api/ant"/>
-
-        <!-- First copy the "static" resources (images, static html files) -->
-        <copy todir="${docs.build.dir}/api/ant" overwrite="true">
-            <fileset dir="${helium.dir}/doc/src/antdoclet/html">
-                <exclude name="*.vm"/>
-            </fileset>
-        </copy>
-      
-        <!-- Now invoke AntDoclet to generate the "dynamic" content from the templates -->
-        <javadoc access="private" sourcepath="${helium.dir}/tools/common/java/src/"
-                 destdir="${docs.build.dir}/api/ant"
-                 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"
-                 docletpathref="doclet-classpath" source="1.6"
-                 useexternalfile="true">
-            <doclet name="com.neuroning.antdoclet.AntDoclet">
-                <param name="-doctitle" value="${build.name}" />
-                <param name="-templatesdir" value="${doc.src.dir}/src/antdoclet/html"/>
-                <param name="-templates" value="main.vm"/>
-            </doclet>
-        </javadoc>
-        <move file="velocity.log" tofile="build/velocity.log" failonerror="false"/>
-    </target>
-
         
     <!-- Builds the Helium API documentation. -->
     <target name="helium-apidocs" depends="clean-helium-apidocs,database,
@@ -162,37 +111,47 @@
     
     
     <target name="helium-prep-textdocs">
-        <copy todir="${docs.build.dir}/temp/doc/nokia" failonerror="false">
-            <fileset dir="${nokia.dir}/doc/src">
-                <include name="**/*.rst"/>
-                <include name="**/*.css"/>
-                <include name="**/*.jpg"/>
-            </fileset>
-        </copy>
-        
-        <mkdir dir="${docs.build.dir}/temp/doc/minibuilds"/>
-        <copy todir="${docs.build.dir}/temp/doc/minibuilds" failonerror="false">
+        <mkdir dir="${doc.temp.dir}/minibuilds"/>
+        <copy todir="${doc.temp.dir}/development/minibuilds" failonerror="false">
             <fileset dir="${helium.dir}/tests/minibuilds/">
                 <include name="*/doc/**/*"/>
             </fileset>
         </copy>
-
-        <!-- Including Helium antlib doc -->
-        <mkdir dir="${docs.build.dir}/temp/doc/helium-antlib"/>
-        <copy todir="${docs.build.dir}/temp/doc/helium-antlib" failonerror="false" flatten="true">
-            <fileset dir="${helium.dir}/external/helium-antlib">
-                <include name="**/*.rst"/>
-                <include name="**/*.css"/>
-                <include name="**/*.jpg"/>
-            </fileset>
-        </copy>
+        
+        <mkdir dir="${doc.temp.dir}/helium-antlib" />
+        <for param="dir">
+            <dirset dir="${helium.dir}" includes="*/doc/src" />
+            <sequential>
+                <copy todir="${doc.temp.dir}/helium-antlib">
+                    <fileset dir="@{dir}/">
+                        <include name="**/*.rst"/>
+                        <include name="**/*.css"/>
+                        <include name="**/*.dot"/>
+                        <include name="**/*.png"/>
+                    </fileset>
+                </copy>
+            </sequential>
+        </for>
+        <for param="dir">
+            <dirset dir="${helium.dir}">
+                <include name="*/java/*" />
+                <include name="*/python/*" />
+            </dirset>
+            <sequential>
+                <copy todir="${doc.temp.dir}/helium-antlib">
+                    <fileset dir="@{dir}/">
+                        <include name="*.rst"/>
+                    </fileset>
+                </copy>
+            </sequential>
+        </for>
     </target>
     
         
     <!-- Generate all documentation. -->
     <target name="add-policies-to-docs" unless="env.HLM_SUBCON">
         <hlm:updatePolicy policy="7" filename="distribution.policy.S60">         
-            <dirset dir="${helium.dir}" includes="${docs.build.dir}/**/*"/>        
+            <dirset dir="${helium.dir}" includes="${doc.build.dir}/**/*"/>        
         </hlm:updatePolicy>   
     </target>
     
@@ -200,7 +159,7 @@
     <!-- Creates XML and .rst documents describing the difference between
     this version of Helium and the previous major release. -->
     <target name="release-diff" depends="database" unless="env.HLM_SUBCON">
-        <mkdir dir="${docs.build.dir}"/>
+        <mkdir dir="${doc.build.dir}"/>
         <!-- URL for the database.xml of last major release
         @type string
         @scope private
@@ -212,14 +171,14 @@
 
 old_db_file = urllib.urlopen(r'${last.major.release.database.url}')
 writer = helium.documentation.APIDeltaWriter(old_db_file, r'${database.file}')
-writer.write(r'${docs.build.dir}/api_changes.xml')
+writer.write(r'${doc.build.dir}/api_changes.xml')
         </hlm:python>
         <if>
-            <available file="${docs.build.dir}/api_changes.xml"/>
+            <available file="${doc.build.dir}/api_changes.xml"/>
             <then>
-                <fmpp sourceFile="${helium.doc.src.dir}/src/api_changes.rst.ftl" outputFile="${docs.build.dir}/temp/doc/api_changes.rst">
+                <fmpp sourceFile="${helium.doc.src.dir}/helium_custom/api_changes.rst.ftl" outputFile="${doc.temp.dir}/api_changes.rst">
                     <data expandProperties="yes">
-                        doc: xml(${docs.build.dir}/api_changes.xml)
+                        doc: xml(${doc.build.dir}/api_changes.xml)
                         old_release: ${last.major.helium.version}
                         new_release: ${helium.version}
                     </data>
@@ -231,12 +190,12 @@
     
     <!-- Generate docs for Symbian Foundataion -->
     <target name="docs-sf">
-        <delete dir="${docs.build.dir}"/>
+        <delete dir="${helium.build.dir}"/>
         <antcall target="helium-subcon-release"/>
-        <unzip src="${docs.build.dir}/helium_${helium.version}_subcon.zip" dest="${docs.build.dir}/helium_${helium.version}_subcon" overwrite="true" />
+        <unzip src="${helium.build.dir}/helium_${helium.version}_subcon.zip" dest="${helium.build.dir}/helium_${helium.version}_subcon" overwrite="true" />
         <!---->
-        <exec executable="cmd" dir="${docs.build.dir}/helium_${helium.version}_subcon/helium">
-            <env key="HELIUM_HOME" value="${docs.build.dir}/helium_${helium.version}_subcon/helium"/>
+        <exec executable="cmd" dir="${helium.build.dir}/helium_${helium.version}_subcon/helium">
+            <env key="HELIUM_HOME" value="${helium.build.dir}/helium_${helium.version}_subcon/helium"/>
             <env key="PYTHONPATH" value="${env.PYTHONPATH}"/>
             <env key="ANT_ARGS" value="${env.ANT_ARGS}"/>
             <arg line="/C hlm.bat"/>
@@ -247,13 +206,6 @@
     </target>
     
     
-    <!-- Clean old build/doc dir. -->
-    <target name="clean-doc-dir">
-        <delete dir="build/doc"/>
-        <delete dir="build/temp/doc"/>        
-    </target>
-    
-    
     <!-- Connect to home drive if it is not connected for .netrc file. -->
     <target name="check-home-drive">
         <exec executable="cmd">
@@ -271,12 +223,14 @@
         @scope private
         -->
         <property name="documentation.path" value="${documentation.path.root}"/>
-        <property name="docs.zip" value="${docs.build.dir}/helium-docs.zip"/>
+        <property name="docs.zip" value="${doc.build.dir}/helium-docs.zip"/>
+        
+        <echo>Uploading docs to ${documentation.path}</echo>
 
         <!-- Python API docs. -->
         <delete file="${docs.zip}"/>
         <zip destfile="${docs.zip}">
-            <fileset dir="${docs.build.dir}" includes="**/*"/>
+            <fileset dir="${doc.build.dir}" includes="**/*"/>
         </zip>
         <sshexec host="${documentation.host}"
                  username="${user.name}"
@@ -293,7 +247,13 @@
                  username="${user.name}"
                  keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
                  trust="true"
-                 command="cd ${documentation.path}; unzip -u -o helium-docs.zip; chmod -R 777 ."/>
+                 command="cd ${documentation.path}; unzip -u -o helium-docs.zip"/>
+        <sshexec host="${documentation.host}"
+                 username="${user.name}"
+                 keyfile="${env.HOME}/.ssh/id_rsa_openssh.ppk"
+                 trust="true"
+                 failonerror="false"
+                 command="cd ${documentation.path}; chmod -f -R 777 ."/>
     </target>
     
     
@@ -310,18 +270,18 @@
     
     <!-- create slides from images -->
     <target name="slides">
-        <mkdir dir="${docs.build.dir}/slides"/>
+        <mkdir dir="${doc.build.dir}/slides"/>
     
-        <copy todir="${docs.build.dir}/slides">
+        <copy todir="${doc.build.dir}/slides">
             <fileset dir="${doc.src.dir}/slides"/>
         </copy>
 
-        <copy todir="${docs.build.dir}/slides/images">
+        <copy todir="${doc.build.dir}/slides/images">
             <fileset dir="${doc.src.dir}/slides/images"/>
         </copy>
     
         <for param="document">
-            <fileset dir="${docs.build.dir}/slides" includes="**/*.rst"/>
+            <fileset dir="${doc.build.dir}/slides" includes="**/*.rst"/>
             <sequential>
                 <propertyregex property="document.no.ext" input="@{document}" regexp="\.rst$" replace="" override="true"/>
                 <if>
@@ -346,18 +306,18 @@
     
     TODO: Refactor to just have one target. -->
     <target name="textdocs-old" depends="overview-to-html">
-        <mkdir dir="${docs.build.dir}"/>
-        <copy todir="${docs.build.dir}-old">
-            <fileset dir="${doc.src.dir}/src" excludes="cover.rst"/>
+        <mkdir dir="${doc.build.dir}"/>
+        <copy todir="${doc.build.dir}-old">
+            <fileset dir="${doc.src.dir}" excludes="cover.rst"/>
             <fileset dir="${nokia.dir}/doc/src"/>
         </copy>
-        
-        <copy todir="${docs.build.dir}-old/images">
+        <!--
+        <copy todir="${doc.build.dir}-old/images">
             <fileset dir="${doc.src.dir}/images"/>
         </copy>
-        
+        -->
         <for param="document">
-            <fileset dir="${docs.build.dir}-old">
+            <fileset dir="${doc.build.dir}-old">
                 <include name="**/*.rst" />
                 <exclude name="index.rst" /><!-- index.rst is the top-level doc for new-style docs -->
             </fileset>
@@ -435,52 +395,45 @@
     <!-- Generates a subcon dependancy diagram based on Egg and Jars files -->
     <target name="dependency-diagram-subcon">
         <fileset id="subcon.jar.files" dir="${helium.dir}">
-            <include name="external/antlibs/*.jar"/>
-            <include name="external/jep/**/*.jar"/>
-            <include name="external/helium-antlib/bin/**/*.jar"/>
-            <include name="tools/**/*.jar"/>
+            <include name="external/antlibs2/*.jar"/>
         </fileset>
         <antcall target="dependency-diagram">
             <reference refid="subcon.jar.files" torefid="jar.files"/>
             <param name="python.exclude.dir" value="${helium.dir}\external\python\lib\2.5\internal"/>
-            <param name="dependency.grph" value="${docs.build.dir}/images/dependencies_subcon.grph"/>
+            <param name="dependency.grph" value="${doc.build.dir}/images/dependencies_subcon.grph"/>
             <param name="subcon" value="true"/>
         </antcall>
     </target>
     
     
     <fileset id="jar.files" dir="${helium.dir}">
-        <include name="external/antlibs/**/*.jar"/>
-        <include name="external/jep/**/*.jar"/>
-        <include name="external/helium-antlib/**/*.jar"/>
-        <include name="tools/**/*.jar"/>
+        <include name="external/antlibs2/**/*.jar"/>
         <include name="extensions/nokia/external/antlibs/**/*.jar"/>
     </fileset>
     
     
     <!-- Generates a dependancy diagram based on Egg and Jars files -->
     <target name="dependency-diagram">
-        <mkdir dir="${docs.build.dir}/images"/>
-        <mkdir dir="${temp.build.dir}"/>
+        <mkdir dir="${doc.temp.dir}"/>
         <!-- Location of dependency.grph
         @type string
         @scope private
         -->
-        <property name="dependency.grph" value="${docs.build.dir}/images/dependencies.grph"/>
+        <property name="dependency.grph" value="${doc.temp.dir}/dependencies.grph"/>
         
         <!---->
-        <copy todir="${temp.build.dir}/dependencylibs" flatten="true">
+        <copy todir="${doc.temp.dir}/dependencylibs" flatten="true">
             <fileset refid="jar.files"/>
         </copy>
         
-        <hlm:antdependency outputFile="${temp.build.dir}/antdependencies.grph">
-            <fileset dir="${temp.build.dir}/dependencylibs" includes="*.jar"/>
+        <hlm:antdependency outputFile="${doc.temp.dir}/antdependencies.grph">
+            <fileset dir="${doc.temp.dir}/dependencylibs" includes="*.jar"/>
         </hlm:antdependency>
         
         <taskdef name="jaranalyzer" classname="com.kirkk.analyzer.textui.JarAnalyzerTask"/>
-        <jaranalyzer srcdir="${temp.build.dir}/dependencylibs" destfile="${dependency.grph}" summaryclass="com.kirkk.analyzer.textui.DOTSummary"/>
+        <jaranalyzer srcdir="${doc.temp.dir}/dependencylibs" destfile="${dependency.grph}" summaryclass="com.kirkk.analyzer.textui.DOTSummary"/>
         
-        <loadfile srcfile="${temp.build.dir}/antdependencies.grph" property="antdependencies"/>
+        <loadfile srcfile="${doc.temp.dir}/antdependencies.grph" property="antdependencies"/>
         <replace file="${dependency.grph}" token="}" value="${antdependencies}}"/>
         
         <antcall target="dependency-grouping"/>
@@ -489,7 +442,7 @@
             <arg line="-Tpng -Grankdir=LR -Nshape=box -Nfontsize=9 -Nwidth=0.3 -Nheight=0.2 ${dependency.grph} -O"/>
         </exec>
         
-        <delete dir="${temp.build.dir}/dependencylibs"/>
+        <delete dir="${doc.temp.dir}/dependencylibs"/>
     </target>
     
     
@@ -499,8 +452,7 @@
         @type string
         @scope private
         -->
-        <property name="dependency.grph" value="${docs.build.dir}/images/dependencies.grph"/>
-        <mkdir dir="${docs.build.dir}/images"/>
+        <property name="dependency.grph" value="${doc.temp.dir}/dependencies.grph"/>
         <!-- Location of nokia internal python library
         @type string
         -->
@@ -534,7 +486,7 @@
         @type string
         @scope private
         -->
-        <property name="dependency.external.grph" value="${docs.build.dir}/images/dependencies_external.grph"/>
+        <property name="dependency.external.grph" value="${doc.temp.dir}/dependencies_external.grph"/>
         <copy file="${database.file}" tofile="${database.file}.parsed" overwrite="true">
             <filterchain>
                 <expandproperties/>
@@ -565,19 +517,21 @@
     
     <!-- Generates a dependancy diagram of log files -->
     <target name="dependency-logs">
+        <mkdir dir="${doc.temp.dir}/manual"/>
         <!-- Location of dependencies_external.grph
         @type string
         @scope private
         -->
-        <property name="dependency.external.grph" value="${docs.build.dir}/images/dependencies_log.grph"/>
+        <property name="dependency.external.grph" value="${doc.temp.dir}/manual/dependencies_log.grph"/>
         
         <antcall target="dependency-db-convert" inheritAll="false">
             <param name="build.drive" value="build.drive"/>
             <param name="build.id" value="build.id"/>
             <param name="build.log.dir" value="/output/logs"/>
         </antcall>
-        
-        <hlm:python>
+        <delete dir="${helium.dir}/build.drive"/>
+
+        <hlm:python failonerror="true">
 import os
 import dependancygraph
 
@@ -592,26 +546,27 @@
 
     <!-- Creates user flow diagram -->
     <target name="helium-user-graph">
-        <mkdir dir="${docs.build.dir}/api"/>
-        <fmpp sourcefile="${helium.dir}/doc/src/user-graph.dot.ftl" outputfile="${docs.build.dir}/temp/doc/user-graph.dot">
+        <mkdir dir="${doc.build.dir}/api"/>
+        <fmpp sourcefile="${helium.dir}/doc/src/user_graph.dot.ftl" outputfile="${doc.temp.dir}/user_graph.dot">
             <data expandProperties="yes">
               ant: antProperties()
             </data>
         </fmpp>
         <for param="dot.file">
-            <fileset dir="${docs.build.dir}/temp/doc" includes="user-graph.dot"/>
+            <fileset dir="${doc.temp.dir}" includes="user_graph.dot"/>
             <sequential>
                 <echo>Processing dot file: @{dot.file}</echo>
-                <exec executable="dot" dir="${docs.build.dir}/temp/doc/">
+                <exec executable="dot" dir="${doc.temp.dir}/">
                     <arg line="-Tcmap @{dot.file} -O"/>
                 </exec>
-                <exec executable="dot" dir="${docs.build.dir}/api">
+                <exec executable="dot" dir="${doc.build.dir}/api">
                     <arg line="-Tpng @{dot.file} -O"/>
                 </exec>
             </sequential>
         </for>
-        <move todir="${docs.build.dir}/images" overwrite="true">
-            <fileset dir="${docs.build.dir}/temp/doc" includes="user-graph.dot.png"/>
+        <!-- This must have special handling because the rst file uses raw HTML to include it. -->
+        <move todir="${doc.build.dir}" overwrite="true">
+            <fileset dir="${doc.temp.dir}" includes="user_graph.dot.png"/>
         </move>
     </target>