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