buildframework/helium/tools/common/helium_docs.ant.xml
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 645 b8d81fa19e7d
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
    40             <data expandProperties="yes">
    40             <data expandProperties="yes">
    41                 doc: xml(${helium.doc.src.dir}/helium_custom/helium_overview.xml)
    41                 doc: xml(${helium.doc.src.dir}/helium_custom/helium_overview.xml)
    42             </data>
    42             </data>
    43         </fmpp>
    43         </fmpp>
    44     </target>
    44     </target>
    45 
    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="${doc.build.dir}/ivy" failonerror="false" 
       
    65             configs="core,ido"/>
       
    66         <fmpp sourceFile="${helium.doc.src.dir}/helium_custom/manual/tool-dependencies.rst.ftl" includes="*.dot.ftl"
       
    67               outputFile="${doc.temp.dir}/manual/tool-dependencies.rst_include"
       
    68               replaceExtension="dot.ftl, dot">
       
    69             <data expandProperties="yes">
       
    70                 doc: xml(${doc.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="${doc.build.dir}/ivy" organisation="S60_SAM"
       
    84                     xml="true" graph="false" xsl="false"/>
       
    85     </target>
       
    86     
       
    87     <!-- Generate Python API documentation using epydoc. -->
       
    88     <target name="python-apidocs">
       
    89         <fileset id="python.library.files" dir="${helium.dir}">
       
    90             <include name="extensions/nokia/tools/common/python/lib/**/*.py"/>
       
    91             <include name="sf/python/**/*.py"/>
       
    92             <include name="nokia/python/**/*.py"/>
       
    93         </fileset>
       
    94         <mkdir dir="${doc.build.dir}/api/python"/>
       
    95         <pathconvert pathsep=" " property="epydoc.python.modules.path">
       
    96             <fileset refid="python.library.files"/>
       
    97         </pathconvert>
       
    98         <echo>Python modules path: ${epydoc.python.modules.path}</echo>
       
    99         <exec executable="python" dir="${doc.build.dir}" failonerror="true">        
       
   100             <arg line="${python.tools}/epydoc"/>
       
   101             <arg value="-v"/>
       
   102             <arg value="--config=${helium.dir}/config/epydoc.conf"/>
       
   103             <arg value="--exclude=sgmllib"/>
       
   104             <arg line="${epydoc.python.modules.path}"/>
       
   105         </exec>
       
   106     </target>
       
   107         
    46         
   108     <!-- Builds the Helium API documentation. -->
    47     <!-- Builds the Helium API documentation. -->
   109     <target name="helium-apidocs" depends="clean-helium-apidocs,database,
    48     <target name="helium-apidocs" depends="clean-helium-apidocs,database,
   110                     find-python-dependencies,helium-api-dependency-images,helium-api-html-docs"/>
    49                     find-python-dependencies,helium-api-dependency-images,helium-api-html-docs"/>
   111     
    50     
   136             <dirset dir="${helium.dir}">
    75             <dirset dir="${helium.dir}">
   137                 <include name="*/java/*" />
    76                 <include name="*/java/*" />
   138                 <include name="*/python/*" />
    77                 <include name="*/python/*" />
   139             </dirset>
    78             </dirset>
   140             <sequential>
    79             <sequential>
   141                 <copy todir="${doc.temp.dir}/helium-antlib">
    80                 <copy todir="${doc.temp.dir}/helium-antlib" flatten="true">
   142                     <fileset dir="@{dir}/">
    81                     <fileset dir="@{dir}/">
   143                         <include name="*.rst"/>
    82                         <include name="*.rst"/>
   144                     </fileset>
    83                     </fileset>
       
    84                     <fileset dir="@{dir}/" includes="doc/*" excludes="**/distribution.policy.S60" />
   145                 </copy>
    85                 </copy>
   146             </sequential>
    86             </sequential>
   147         </for>
    87         </for>
   148     </target>
    88     </target>
   149     
    89     
   168         <hlm:python>
   108         <hlm:python>
   169 import urllib
   109 import urllib
   170 import helium.documentation
   110 import helium.documentation
   171 
   111 
   172 old_db_file = urllib.urlopen(r'${last.major.release.database.url}')
   112 old_db_file = urllib.urlopen(r'${last.major.release.database.url}')
   173 writer = helium.documentation.APIDeltaWriter(old_db_file, r'${database.file}')
   113 writer = helium.documentation.APIDeltaWriter(old_db_file.read(), open(r'${database.file}').read())
   174 writer.write(r'${doc.build.dir}/api_changes.xml')
   114 writer.write(r'${doc.build.dir}/api_changes.xml')
   175         </hlm:python>
   115         </hlm:python>
   176         <if>
   116         <if>
   177             <available file="${doc.build.dir}/api_changes.xml"/>
   117             <available file="${doc.build.dir}/api_changes.xml"/>
   178             <then>
   118             <then>
   384     <!-- Reads the Java libraries and extracts a list of their versions. -->
   324     <!-- Reads the Java libraries and extracts a list of their versions. -->
   385     <target name="library-versions">    
   325     <target name="library-versions">    
   386         <script language="jython" setbeans="false">
   326         <script language="jython" setbeans="false">
   387 import java.io
   327 import java.io
   388 import java.util.jar
   328 import java.util.jar
   389 antlibsDir = java.io.File('external/antlibs')
   329 antlibsDir = java.io.File('external/antlibs2')
   390 print antlibsDir
   330 print antlibsDir
   391 jarFiles = antlibsDir.listFiles()
   331 jarFiles = antlibsDir.listFiles()
   392 for jar in jarFiles:
   332 for jar in jarFiles:
   393     if jar.getName().endswith('jar'):
   333     if jar.getName().endswith('jar'):
   394         jarFile = java.util.jar.JarFile(jar)
   334         jarFile = java.util.jar.JarFile(jar)
   413         </antcall>
   353         </antcall>
   414     </target>
   354     </target>
   415     
   355     
   416     
   356     
   417     <fileset id="jar.files" dir="${helium.dir}">
   357     <fileset id="jar.files" dir="${helium.dir}">
   418         <include name="external/antlibs2/**/*.jar"/>
   358         <include name="external/antlibs2/*.jar"/>
   419         <include name="extensions/nokia/external/antlibs/**/*.jar"/>
       
   420     </fileset>
   359     </fileset>
   421     
   360     
   422     
   361     
   423     <!-- Generates a dependancy diagram based on Egg and Jars files -->
   362     <!-- Generates a dependancy diagram based on Egg and Jars files -->
   424     <target name="dependency-diagram">
   363     <target name="dependency-diagram">