buildframework/helium/builder/build.xml
changeset 645 b8d81fa19e7d
parent 628 7c4a911dc066
equal deleted inserted replaced
643:27cf35f95864 645:b8d81fa19e7d
    18 
    18 
    19 Description:
    19 Description:
    20 
    20 
    21 ============================================================================
    21 ============================================================================
    22 -->
    22 -->
    23 <project name="helium-builder" default="build" xmlns:au="antlib:org.apache.ant.antunit" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:ac="antlib:net.sf.antcontrib">
    23 <project name="helium-builder" default="build" xmlns:au="antlib:org.apache.ant.antunit" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:ac="antlib:net.sf.antcontrib" xmlns:hlm="http://www.nokia.com/helium">
    24     <property environment="env" />
    24     <property environment="env" />
    25     <taskdef name="fmpp" classname="fmpp.tools.AntTask" />
    25     <taskdef name="fmpp" classname="fmpp.tools.AntTask" />
    26     <import file="delivery.ant.xml" />
    26     <import file="delivery.ant.xml" />
    27 
    27 
    28     <!-- Ensuring that only Ant 1.7.0 is in use. 
    28     <!-- Ensuring that only Ant 1.7.0 is in use. 
    47     <property name="component.type" value="*" />
    47     <property name="component.type" value="*" />
    48     <property name="component.root" value="*" />
    48     <property name="component.root" value="*" />
    49     <property name="config" value="sf" />
    49     <property name="config" value="sf" />
    50     <property name="sf.delivery.zip" location="${build.temp.dir}/helium-sf-src.zip" />
    50     <property name="sf.delivery.zip" location="${build.temp.dir}/helium-sf-src.zip" />
    51     <property name="binary.delivery.zip" location="${build.temp.dir}/helium-bin.zip" />
    51     <property name="binary.delivery.zip" location="${build.temp.dir}/helium-bin.zip" />
       
    52     <property name="doc.build.dir" location="${build.temp.dir}/doc/api" />
    52     
    53     
    53     <fileset id="ant.build.files" dir="${source.root.dir}">
    54     <fileset id="ant.build.files" dir="${source.root.dir}">
    54         <include name="${component.root}/${component.type}/${component}/build.xml" />
    55         <include name="${component.root}/${component.type}/${component}/build.xml" />
    55         <exclude name="*builder/**" />
    56         <exclude name="*builder/**" />
    56         <exclude name="*/*builder/**" />
    57         <exclude name="*/*builder/**" />
    62         <exclude name="licences/**" />
    63         <exclude name="licences/**" />
    63         <exclude name="tests/**" />
    64         <exclude name="tests/**" />
    64         <exclude name="build/**" />
    65         <exclude name="build/**" />
    65     </fileset>
    66     </fileset>
    66   
    67   
    67     
    68     <!-- Add macro in order to avoid the use of failonerror="false" in the delete task -->
       
    69     <macrodef name="deleteIfDirExists">
       
    70         <attribute name="dir"/>
       
    71         <sequential>
       
    72             <ac:if>
       
    73                 <available file="@{dir}" type="dir" />
       
    74                 <then>
       
    75                     <delete dir="@{dir}" />
       
    76                 </then> 
       
    77             </ac:if>        
       
    78         </sequential>
       
    79     </macrodef>
       
    80 
       
    81    
    68     <target name="cleanup" description="Cleanup (delete the temp build directory)">
    82     <target name="cleanup" description="Cleanup (delete the temp build directory)">
    69         <delete dir="${build.temp.dir}" failonerror="false"/>
    83         <deleteIfDirExists dir="${build.temp.dir}" />
    70         <delete dir="${source.root.dir}/external/antlibs2" failonerror="false" />
    84         <deleteIfDirExists dir="${source.root.dir}/external/antlibs2" />
    71         <delete dir="${source.root.dir}/external/python/lib/auto" failonerror="false" />
    85         <deleteIfDirExists dir="${source.root.dir}/external/python/lib/auto" />
    72     </target>
    86     </target>
    73     
    87     
    74     
    88     
    75     <target name="get-build-list">
    89     <target name="get-build-list">
    76         <ivy:buildlist reference="ivy.buildlist.path">
    90         <ivy:buildlist reference="ivy.buildlist.path">
   234         <ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
   248         <ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
   235             module="helium-${config}-config" revision="1.0"
   249             module="helium-${config}-config" revision="1.0"
   236             inline="true" type="jar"
   250             inline="true" type="jar"
   237             pattern="${source.root.dir}/external/antlibs2/[artifact]-[revision].[ext]" />
   251             pattern="${source.root.dir}/external/antlibs2/[artifact]-[revision].[ext]" />
   238         <delete>
   252         <delete>
   239            <fileset dir="${source.root.dir}" includes="external/python/lib/auto/zipnotsafe/**" />
   253             <fileset dir="${source.root.dir}" includes="external/python/lib/auto/zipnotsafe/**" />
   240         </delete>
   254         </delete>
   241         <ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
   255         <ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
   242             module="helium-${config}-config" revision="1.0"
   256             module="helium-${config}-config" revision="1.0"
   243             inline="true" type="egg"
   257             inline="true" type="egg"
   244             pattern="${source.root.dir}/external/python/lib/auto/zipsafe/[artifact]-[revision].[ext]" />
   258             pattern="${source.root.dir}/external/python/lib/auto/zipsafe/[artifact]-[revision].[ext]" />
   360     
   374     
   361     <target name="create-releasable" depends="get-deps,update-version,build-helium-docs,zip-releasable,restore-version" description="Create releasable binary package"/>
   375     <target name="create-releasable" depends="get-deps,update-version,build-helium-docs,zip-releasable,restore-version" description="Create releasable binary package"/>
   362     
   376     
   363     
   377     
   364     <target name="textdoc">
   378     <target name="textdoc">
   365         <delete dir="${build.temp.dir}/doc/doctmp" failonerror="false"/>
   379         <deleteIfDirExists dir="${build.temp.dir}/doc/doctmp" />
   366         <copy todir="${build.temp.dir}/doc/doctmp" overwrite="true">
   380         <copy todir="${build.temp.dir}/doc/doctmp" overwrite="true">
   367             <fileset dir="${source.root.dir}/sf/doc/src"/>
   381             <fileset dir="${source.root.dir}/sf/doc/src"/>
   368         </copy>
   382         </copy>
   369         <copy todir="${build.temp.dir}/doc/doctmp" overwrite="true" flatten="true">
   383         <copy todir="${build.temp.dir}/doc/doctmp" overwrite="true" flatten="true">
   370             <fileset dir="${source.root.dir}" includes="*/java/*/**/*.rst" excludes="*/java/*/doc/**/*.rst" />
   384             <fileset dir="${source.root.dir}" includes="*/java/*/**/*.rst" excludes="*/java/*/doc/**/*.rst" />
   381         <attribute name="version"/>
   395         <attribute name="version"/>
   382         <attribute name="src" default="${source.root.dir}/sf/doc/src"/>
   396         <attribute name="src" default="${source.root.dir}/sf/doc/src"/>
   383         <attribute name="output" default="${build.temp.dir}/doc/text"/>
   397         <attribute name="output" default="${build.temp.dir}/doc/text"/>
   384         <sequential>
   398         <sequential>
   385             <property name="sphinx.lib.dir" location="${builder.dir}/tools/sphinx/Sphinx-0.5.1-py2.5.egg/sphinx" />
   399             <property name="sphinx.lib.dir" location="${builder.dir}/tools/sphinx/Sphinx-0.5.1-py2.5.egg/sphinx" />
   386             <exec executable="python" failonerror="${failonerror}">
   400             <exec executable="python" failonerror="true">
   387                 <env key="PYTHONPATH" path="${builder.dir}/tools/sphinx" />
   401                 <env key="PYTHONPATH" path="${builder.dir}/tools/sphinx" />
   388                 <arg file="${builder.dir}/tools/sphinx/sphinx-build.py"/>
   402                 <arg file="${builder.dir}/tools/sphinx/sphinx-build.py"/>
   389                 <arg value="-b" />
   403                 <arg value="-b" />
   390                 <arg value="html" />            
   404                 <arg value="html" />            
   391                 <arg value="-D" />
   405                 <arg value="-D" />
   395                 <arg file="@{src}" />
   409                 <arg file="@{src}" />
   396                 <arg file="@{output}" />
   410                 <arg file="@{output}" />
   397             </exec>
   411             </exec>
   398         </sequential>
   412         </sequential>
   399     </macrodef>
   413     </macrodef>
       
   414 
       
   415     <!-- Generate Ant API documentation using jeldoclet. -->
       
   416     <target name="jeldoclet">
       
   417         <path id="doclet-classpath">
       
   418             <fileset dir="${build.temp.dir}" includes="**/*.jar"/>
       
   419             <pathelement path="${java.class.path}/"/>
       
   420         </path>
       
   421         <javadoc destdir="${build.temp.dir}"
       
   422            docletpathref="doclet-classpath"
       
   423            useexternalfile="true"
       
   424            failonerror="true">
       
   425             <sourcepath>
       
   426                 <dirset dir="${source.root.dir}">
       
   427                     <include name="*/java/*/src"/>
       
   428                 </dirset>
       
   429             </sourcepath>
       
   430             <doclet name="com.jeldoclet.JELDoclet"/>
       
   431         </javadoc>
       
   432         <fmpp sourceFile="${builder.dir}/tools/antdoclet/doclet_list.rst.ftl"
       
   433             outputFile="${build.temp.dir}/temp/doc/helium-antlib/tasks.rst">
       
   434             <data expandProperties="yes">
       
   435                 doc: xml(${build.temp.dir}/jel.xml)
       
   436                 ant: antProperties()
       
   437             </data>
       
   438         </fmpp>
       
   439     </target>
   400     
   440     
   401 </project>
   441 </project>
   402 
   442 
   403 
   443