buildframework/helium/tools/common/docs.ant.xml
author Ross Qin <ross.qin@nokia.com>
Tue, 02 Nov 2010 09:31:04 +0800
changeset 671 ff8ff850b0cf
parent 645 b8d81fa19e7d
permissions -rw-r--r--
fix the Serious problem with ROFS on-disk format
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     2
<!-- 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     3
============================================================================ 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     4
Name        : docs.ant.xml 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     5
Part of     : Helium 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     6
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     8
All rights reserved.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     9
This component and the accompanying materials are made available
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    11
which accompanies this distribution, and is available
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    13
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    14
Initial Contributors:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    16
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    17
Contributors:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    18
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    19
Description:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    20
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    21
============================================================================
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    22
-->
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    23
<!--* @package framework -->
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    24
<project name="internal.docs" xmlns:hlm="http://www.nokia.com/helium" xmlns:ivy="antlib:org.apache.ivy.ant">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    25
    <description>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    26
    Documentation generation targets.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    27
    </description>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    28
    
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    29
    <!-- Location of documentation source.
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    30
    This is set to work with IDO docs, to avoid updating their config.
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    31
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    32
    @scope public
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    33
    -->
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    34
    <property name="doc.src.dir" location="${basedir}/docs/src" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    35
    <!-- Location of documentation API source.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    36
    @type string
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    37
    @scope private
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    38
    -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    39
    <property name="api.doc.src.dir" location="${helium.dir}/doc/api" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    40
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    41
    <!-- Location of documentation API source for RST.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    42
    @type string
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    43
    @scope private
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    44
    -->
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    45
    <property name="api.rst.doc.src.dir" location="${helium.dir}/doc/api_rst" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    46
    
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    47
    <!-- Location of helium database
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    48
    @type string
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    49
    @scope private
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    50
    -->
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    51
    <property name="public.database.file" location="${basedir}/build/public_database.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    52
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    53
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    54
    <!-- A list of source paths for RST documentation to be built. -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    55
    <resources id="textdoc.paths">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    56
        <path>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    57
            <pathelement path="${doc.src.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    58
        </path>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    59
    </resources>
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    60
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    61
    <!-- The location where the docs will be built.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    62
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    63
    @scope private -->
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    64
    <property name="doc.build.dir" location="${basedir}/build/doc" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    65
    <!-- A temp location for doc processing.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    66
    @type string
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    67
    @scope private -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    68
    <property name="doc.temp.dir" location="${basedir}/build/temp/doc" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    69
    <!-- A temp location for doc processing.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    70
    @type string
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    71
    @scope private -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    72
    <property name="doc_search.temp.dir" location="${basedir}/build/temp/doc_search" />
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    73
    
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    74
    <fileset id="static.doc.files" dir="${helium.dir}/doc/src">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    75
        <include name="conf.py"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    76
        <include name=".static"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    77
        <include name=".templates/**"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    78
        <include name="*.jpg"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    79
        <include name="*.css"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    80
    </fileset>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    81
        
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    82
    
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    83
    <!-- Cleans the Helium API documentation. -->
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    84
    <target name="clean-helium-apidocs">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    85
        <delete dir="${doc.build.dir}/api/helium"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    86
        <delete dir="${doc.temp.dir}/api/helium"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    87
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    88
    
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    89
    
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    90
    <!-- Generates an Ant XML database file showing only public content.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    91
    @scope private    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    92
    -->    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    93
    <target name="docs-database">
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    94
        <mkdir dir="${basedir}/build"/>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    95
        <hlm:database output="${public.database.file}" scope="public" filesetonly="true">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    96
            <fileset dir=".">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    97
                <include name="**/*.ant.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    98
                <include name="**/build.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    99
            </fileset>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   100
        </hlm:database>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   101
    </target>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   102
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   103
    
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   104
    <!-- Creates images of the dependencies for all Ant targets.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   105
        
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   106
    This includes creating a cmap file that is included in the HTML document,
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   107
    so the boxes in the image are linked to their targets. -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   108
    <target name="helium-api-dependency-images">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   109
        <mkdir dir="${doc.build.dir}/api/helium"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   110
        <mkdir dir="${doc.temp.dir}/api/helium"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   111
        <fmpp sourceRoot="${api.rst.doc.src.dir}" includes="*.dot.ftl" outputRoot="${doc.temp.dir}/api/helium"
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   112
              replaceExtension="dot.ftl, dot">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   113
            <data expandProperties="yes">
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   114
                doc: xml(${public.database.file})
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   115
            </data>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   116
        </fmpp>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   117
        <for param="dot.file" parallel="true" threadCount="${number.of.threads}">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   118
            <fileset dir="${doc.temp.dir}/api/helium" includes="*.dot"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   119
            <sequential>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   120
                <echo>Processing dot file: @{dot.file}</echo>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   121
                <exec executable="dot" dir="${doc.temp.dir}/api/helium" failonerror="true">
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   122
                    <arg line="-Tcmap @{dot.file} -O"/>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   123
                </exec>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   124
                <exec executable="dot" dir="${doc.build.dir}/api" failonerror="true">
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   125
                    <arg line="-Tpng @{dot.file} -O"/>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   126
                </exec>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   127
            </sequential>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   128
        </for>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   129
        <move todir="${doc.build.dir}/api/helium" overwrite="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   130
            <fileset dir="${doc.temp.dir}/api/helium" includes="*.dot.png"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   131
        </move>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   132
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   133
    
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   134
    
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   135
    <!-- Builds the HTML files for the Helium API documentation. -->
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   136
    <target name="helium-api-html-docs">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   137
        <mkdir dir="${doc.build.dir}/api/helium"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   138
        <copy todir="${doc.temp.dir}/api/helium" overwrite="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   139
            <fileset dir="${api.doc.src.dir}"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   140
        </copy>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   141
        <fmpp sourceRoot="${doc.temp.dir}/api/helium" excludes="*.dot.png,*.dot.ftl,**/*.dot,**/*.cmap,*.bak"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   142
              outputRoot="${doc.build.dir}/api/helium"
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   143
              replaceExtension="html.ftl, html">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   144
            <data expandProperties="yes">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   145
                ant: antProperties()
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   146
                doc: xml(${public.database.file})
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   147
            </data>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   148
        </fmpp>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   149
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   150
    
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   151
    
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   152
    <!-- Builds the RST files for the Helium API documentation. -->
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   153
    <target name="helium-api-rst-docs">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   154
        <mkdir dir="${doc.temp.dir}/api/helium"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   155
        <fmpp sourceRoot="${api.rst.doc.src.dir}" excludes="*.dot.png,*.dot.ftl,**/*.dot,**/*.cmap,*.bak"
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   156
              outputRoot="${doc.temp.dir}/api/helium"
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   157
              replaceExtension="rst.ftl, rst">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   158
            <data expandProperties="yes">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   159
                ant: antProperties()
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   160
                doc: xml(${public.database.file})
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   161
            </data>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   162
        </fmpp>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   163
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   164
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   165
    
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   166
    <!-- Builds the Helium API documentation. -->
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   167
    <target name="helium-apidocs" depends="clean-helium-apidocs,docs-database,
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   168
                    helium-api-dependency-images,helium-api-rst-docs"/>
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   169
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   170
    
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   171
    <!-- Generate API documentation from the source code. -->
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   172
    <target name="apidocs" depends="helium-apidocs" unless="env.HLM_SUBCON">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   173
        <exec executable="cmd" osfamily="windows" dir="${helium.dir}/nokia_builder" failonerror="true">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   174
            <arg line="/C bld doc" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   175
        </exec>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   176
    </target>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   177
    
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   178
    <!-- Macro to generate HTML docs from rst. -->
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   179
    <macrodef name="rstPrepMacro" uri="http://www.nokia.com/helium">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   180
        <attribute name="destdir"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   181
        <element name="resources-elements" implicit="yes"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   182
        <sequential>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   183
            <for param="dir">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   184
                <resources-elements/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   185
                <sequential>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   186
                    <echo>Copying textdocs source directory: @{dir}</echo>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   187
                    <fmpp sourceRoot="@{dir}" excludes="**/*.bak"
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   188
                          outputRoot="@{destdir}" removeExtensions="ftl"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   189
                          modes="copy(**/*.rst, **/*.html)">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   190
                        <data expandProperties="yes">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   191
                            ant: antProperties()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   192
                            project: antProject()
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   193
                            doc: xml(${public.database.file})
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   194
                        </data>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   195
                    </fmpp>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   196
                </sequential>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   197
            </for>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   198
        </sequential>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   199
    </macrodef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   200
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   201
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   202
    <!-- Macro to generate HTML docs from rst. -->
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   203
    <macrodef name="rstMacro" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   204
        <attribute name="version" default="${helium.version}"/>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   205
        <attribute name="src" default="${doc.temp.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   206
        <attribute name="output" default="${doc.build.dir}"/>
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   207
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   208
            <property name="sphinx.lib.dir" location="${helium.dir}/external/python/lib/common/Sphinx-0.5.1-py2.5.egg/sphinx" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   209
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   210
                <available file="${nokia.python.tools}/sphinxfixsearch.diff"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   211
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   212
                    <patch patchfile="${nokia.python.tools}/sphinxfixsearch.diff" originalfile="${sphinx.lib.dir}/search.py"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   213
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   214
            </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   215
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   216
                <resourcecount when="greater" count="0">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   217
                    <fileset dir="@{src}" includes="**/*.rst"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   218
                </resourcecount>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   219
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   220
                    <exec executable="python" failonerror="true">        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   221
                        <arg file="${python.dir}/common/sphinx-build.py"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   222
                        <arg value="-b" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   223
                        <arg value="html" />            
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   224
                        <arg value="-D" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   225
                        <arg value="version=@{version}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   226
                        <arg value="-D" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   227
                        <arg value="release=@{version}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   228
                        <arg file="@{src}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   229
                        <arg file="@{output}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   230
                    </exec>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   231
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   232
            </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   233
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   234
                <available file="${nokia.python.tools}/sphinxfixsearch.diff"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   235
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   236
                    <patch reverse="true" patchfile="${nokia.python.tools}/sphinxfixsearch.diff" originalfile="${sphinx.lib.dir}/search.py"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   237
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   238
            </if>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   239
            <copy todir="@{output}" overwrite="true">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   240
                <fileset dir="@{src}">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   241
                    <include name="**/*.zip"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   242
                </fileset>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   243
            </copy>
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   244
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   245
    </macrodef>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   246
    
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   247
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   248
    <!-- Generate search index for apis -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   249
    <target name="apidocs-search">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   250
        <echo>Convert API docs to .rst files</echo>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   251
        <hlm:python>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   252
import html2rest
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   253
import os
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   254
import codecs
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   255
#import traceback
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   256
for root, dirs, files in os.walk(r'${doc.build.dir}/api', topdown=False):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   257
    for fname in files:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   258
        if '.html' in fname:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   259
            filename = os.path.abspath(os.path.join(root, fname))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   260
            rstfilename = filename.replace('.html', '.rst')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   261
            try:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   262
                out = open(rstfilename, 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   263
                html2rest.html2rest(html2rest.readsoup(filename), out)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   264
            except:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   265
                #traceback.print_exc()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   266
                print filename + ' failed to be converted to rst'
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   267
            finally:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   268
                out.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   269
                
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   270
            try:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   271
                rstfile = codecs.open(rstfilename, 'r', 'utf8')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   272
                rstfile.read()
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   273
            except UnicodeError:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   274
                print rstfilename + ' has invalid unicode'
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   275
                rstfile.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   276
                os.remove(rstfilename)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   277
        </hlm:python>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   278
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   279
        <move todir="${doc_search.temp.dir}" overwrite="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   280
            <fileset dir="${doc.build.dir}/api">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   281
                <include name="**/*.rst"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   282
            </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   283
        </move>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   284
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   285
        <move todir="${doc.build.dir}/api_backup" overwrite="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   286
            <fileset dir="${doc.build.dir}/api"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   287
        </move>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   288
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   289
        <hlm:rstPrepMacro destdir="${doc_search.temp.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   290
            <resources>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   291
                <path>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   292
                    <pathelement path="${helium.dir}/doc/default"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   293
                </path>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   294
            </resources>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   295
        </hlm:rstPrepMacro>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   296
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   297
        <copy file="${api.doc.src.dir}/apisearchindex.rst" tofile="${doc_search.temp.dir}/index.rst" overwrite="true"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   298
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   299
        <!--<copy todir="${doc_search.temp.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   300
            <fileset refid="static.doc.files"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   301
        </copy>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   302
        <copy todir="${doc_search.temp.dir}" overwrite="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   303
            <fileset dir="${helium.dir}/doc/src_search" includes="**/*"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   304
        </copy>-->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   305
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   306
        <hlm:rstMacro src="${doc_search.temp.dir}" output="${doc.build.dir}/api"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   307
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   308
        <move todir="${doc.build.dir}/api" overwrite="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   309
            <fileset dir="${doc.build.dir}/api_backup"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   310
        </move>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   311
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   312
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   313
    
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   314
    <!-- Generate rst files for docs -->
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   315
    <target name="prep-textdocs" depends="docs-database">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   316
        <echo>Building docs into ${doc.build.dir}.</echo>
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   317
        
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   318
        <delete dir="${doc.build.dir}/.doctrees"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   319
        <delete file="${doc.build.dir}/searchindex.json"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   320
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   321
        <resources id="textdoc.all.paths">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   322
            <!-- default doc content is always processed first -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   323
            <path>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   324
                <pathelement path="${helium.dir}/doc/default"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   325
            </path>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   326
            <resources refid="textdoc.paths"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   327
        </resources>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   328
        <hlm:rstPrepMacro destdir="${doc.temp.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   329
            <resources refid="textdoc.all.paths"/>    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   330
        </hlm:rstPrepMacro>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   331
    </target>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   332
        
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   333
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   334
    <target name="build-textdocs-dot-images">
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   335
        <for param="dot.file">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   336
            <fileset dir="${doc.temp.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   337
                <include name="**/*.dot"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   338
                <exclude name="api/helium/**/*.dot"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   339
            </fileset>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   340
            <sequential>
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   341
                <echo>Building dot file: @{dot.file}</echo>
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   342
                <exec executable="dot" failonerror="true">
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   343
                    <arg line="-Tpng @{dot.file} -O"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   344
                </exec>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   345
            </sequential>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   346
        </for>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   347
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   348
    
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   349
    
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   350
    <!-- Generate HTML documentation from .rst documents with Sphinx.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   351
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   352
    All doc .rst files should be generated or copied into build/temp/doc before being processed into HTML.    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   353
    -->
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   354
    <target name="build-textdocs">
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   355
        <hlm:rstMacro />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   356
    </target>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   357
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   358
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   359
    <target name="textdocs" depends="prep-textdocs,build-textdocs-dot-images,build-textdocs"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   360
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   361
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   362
    <!-- Cleans only the RST text docs -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   363
    <target name="clean-textdocs">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   364
        <mkdir dir="${doc.build.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   365
        <mkdir dir="${doc.temp.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   366
        <mkdir dir="${doc_search.temp.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   367
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   368
        <delete includeemptydirs="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   369
            <fileset dir="${doc.build.dir}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   370
                <include name="**/*"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   371
                <exclude name="api/helium/**/*"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   372
                <exclude name="doclet/**"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   373
                <exclude name="javadoc/**"/>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   374
            </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   375
            <fileset dir="${doc.temp.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   376
            <fileset dir="${doc_search.temp.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   377
        </delete>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   378
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   379
    
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   380
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   381
    <!-- Cleans all documentation. -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   382
    <target name="clean-docs" depends="clean-helium-apidocs,clean-textdocs"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   383
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   384
    
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
   385
    <!-- generate all the user documentation for helium -->
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   386
    <target name="docs" depends="clean-docs,apidocs,textdocs,docs-check-links"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   387
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   388
    <!-- Check links in docs -->
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   389
    <target name="docs-check-links">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   390
        <hlm:python failonerror="true">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   391
<![CDATA[
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   392
import os
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   393
error = ''
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   394
for root, dirs, files in os.walk(r'${doc.build.dir}', topdown=False):
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   395
    for fname in files:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   396
        if '.htm' in fname:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   397
            filename = os.path.abspath(os.path.join(root, fname))
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   398
            f = open(filename)
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   399
            for line in f:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   400
                if ' src="' in line:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   401
                    line1 = line.split('src="')[1]
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   402
                    line1 = line1.split('"')[0]
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   403
                    os.chdir(root)
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   404
                    if line1 and not os.path.exists(line1) and not ':' in line1 and not '$' in line1:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   405
                        error = error + filename + ' has a broken link ' + line1 + '\n'
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   406
                if ' href="' in line:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   407
                    line = line.split('href="')[1]
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   408
                    line = line.split('"')[0]
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   409
                    if '#' in line:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   410
                        line = line.split('#')[0]
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   411
                    if '?' in line:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   412
                        line = line.split('?')[0]
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   413
                    os.chdir(root)
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   414
                    if line and not os.path.exists(line) and not ':' in line and not '&' in line:
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   415
                        error = error + filename + ' has a broken link ' + line + '\n'
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   416
            f.close()
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   417
if error != '':
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   418
    raise Exception(error)
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   419
]]>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   420
        </hlm:python>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   421
    </target>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   422
</project>