buildframework/helium/builder/build.xml
changeset 588 c7c26511138f
parent 587 85df38eb4012
child 628 7c4a911dc066
equal deleted inserted replaced
587:85df38eb4012 588:c7c26511138f
    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">
    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. 
    29     <ac:if>
    29     <ac:if>
    30         <not>
    30         <not>
    31             <contains string="${ant.version}" substring="1.7.0" />
    31             <contains string="${ant.version}" substring="1.7.0" />
    32         </not>
    32         </not>
    33         <then>
    33         <then>
    34             <fail message="Your current ant version is ${ant.version}, you must use 1.7.0" />
    34             <fail message="Your current ant version is ${ant.version}, you must use 1.7.0" />
    35         </then>
    35         </then>
    36     </ac:if>            
    36     </ac:if>            -->
    37 
    37 
    38     <condition property="platform" value="win32" else="unix">
    38     <condition property="platform" value="win32" else="unix">
    39         <os family="windows"/>
    39         <os family="windows"/>
    40     </condition>
    40     </condition>
       
    41     
    41     <dirname property="builder.dir" file="${ant.file.helium-builder}" />
    42     <dirname property="builder.dir" file="${ant.file.helium-builder}" />
    42     <property name="source.root.dir" location="${builder.dir}/.." />
    43     <property name="source.root.dir" location="${builder.dir}/.." />
    43     <property name="build.temp.dir" location="${source.root.dir}/build" />
    44     <property name="build.temp.dir" location="${source.root.dir}/build" />
    44     <property name="components.temp.dir" location="${build.temp.dir}/components" />
    45     <property name="components.temp.dir" location="${build.temp.dir}/components" />
    45     <property name="component" value="*" />
    46     <property name="component" value="*" />
    61         <exclude name="licences/**" />
    62         <exclude name="licences/**" />
    62         <exclude name="tests/**" />
    63         <exclude name="tests/**" />
    63         <exclude name="build/**" />
    64         <exclude name="build/**" />
    64     </fileset>
    65     </fileset>
    65   
    66   
       
    67     
    66     <target name="cleanup" description="Cleanup (delete the temp build directory)">
    68     <target name="cleanup" description="Cleanup (delete the temp build directory)">
    67         <delete dir="${build.temp.dir}" failonerror="false"/>
    69         <delete dir="${build.temp.dir}" failonerror="false"/>
    68     </target>
    70     </target>
       
    71     
    69     
    72     
    70     <target name="get-build-list">
    73     <target name="get-build-list">
    71         <ivy:buildlist reference="ivy.buildlist.path">
    74         <ivy:buildlist reference="ivy.buildlist.path">
    72             <fileset refid="ant.build.files"/>
    75             <fileset refid="ant.build.files"/>
    73         </ivy:buildlist>
    76         </ivy:buildlist>
    74     </target>
    77     </target>
    75 
    78 
       
    79     
    76     <target name="report" depends="get-build-list" description="Create Ivy report for each component">
    80     <target name="report" depends="get-build-list" description="Create Ivy report for each component">
    77         <subant target="report" buildpathref="ivy.buildlist.path">
    81         <subant target="report" buildpathref="ivy.buildlist.path">
    78             <property name="builder.dir" location="${builder.dir}" />
    82             <property name="builder.dir" location="${builder.dir}" />
    79         </subant>
    83         </subant>
    80     </target>
    84     </target>
    81   
    85   
       
    86     
    82     <target name="compile" depends="get-build-list">
    87     <target name="compile" depends="get-build-list">
    83         <subant target="compile" buildpathref="ivy.buildlist.path">
    88         <subant target="compile" buildpathref="ivy.buildlist.path">
    84             <property name="builder.dir" location="${builder.dir}" />
    89             <property name="builder.dir" location="${builder.dir}" />
    85             <property name="source.root.dir" value="${source.root.dir}"/>
    90             <property name="source.root.dir" value="${source.root.dir}"/>
    86         </subant>
    91         </subant>
    87     </target>
    92     </target>
    88 
    93 
       
    94     
    89     <target name="build" depends="get-build-list" description="Build each component">
    95     <target name="build" depends="get-build-list" description="Build each component">
    90         <subant target="package" buildpathref="ivy.buildlist.path">
    96         <subant target="package" buildpathref="ivy.buildlist.path">
    91             <property name="builder.dir" location="${builder.dir}" />
    97             <property name="builder.dir" location="${builder.dir}" />
    92             <property name="source.root.dir" value="${source.root.dir}"/>
    98             <property name="source.root.dir" value="${source.root.dir}"/>
    93             <property name="platform" value="${platform}"/>
    99             <property name="platform" value="${platform}"/>
    94         </subant>
   100         </subant>
    95     </target>
   101     </target>
    96 
   102 
       
   103     
    97     <target name="clean" depends="get-build-list" description="Run clean on each component">
   104     <target name="clean" depends="get-build-list" description="Run clean on each component">
    98         <subant target="clean" buildpathref="ivy.buildlist.path">
   105         <subant target="clean" buildpathref="ivy.buildlist.path">
    99             <property name="builder.dir" location="${builder.dir}" />
   106             <property name="builder.dir" location="${builder.dir}" />
   100             <property name="source.root.dir" value="${source.root.dir}"/>
   107             <property name="source.root.dir" value="${source.root.dir}"/>
   101         </subant>
   108         </subant>
   102     </target>
   109     </target>
   103   
   110   
       
   111     
   104     <target name="test" depends="get-build-list,build" description="Run test on each component">
   112     <target name="test" depends="get-build-list,build" description="Run test on each component">
   105         <ac:for param="file" keepgoing="true">
   113         <ac:for param="file" keepgoing="true">
   106             <path refid="ivy.buildlist.path" />
   114             <path refid="ivy.buildlist.path" />
   107             <sequential>
   115             <sequential>
   108                 <echo>Testing: @{file}</echo>
   116                 <echo>Testing: @{file}</echo>
   109                 <ant antfile="@{file}" dir="@{file}/.." target="test" inheritAll="false">
   117                 <ant antfile="@{file}" dir="@{file}/.." target="test" inheritAll="false">
   110                     <property name="builder.dir" location="${builder.dir}" />
   118                     <property name="builder.dir" location="${builder.dir}" />
       
   119                     <property name="source.root.dir" location="${source.root.dir}" />
   111                 </ant>
   120                 </ant>
   112             </sequential>
   121             </sequential>
   113         </ac:for>
   122         </ac:for>
   114     </target>
   123     </target>
   115     <!-- TODO: remove after CI tools are cleaned up -->
   124     <!-- TODO: remove after CI tools are cleaned up -->
   116     <target name="unittest" depends="test"/>
   125     <target name="unittest" depends="test"/>
   117     
   126     
   118     <target name="junit" depends="get-build-list" description="Run junit on each component">
   127     
       
   128     <target name="junit" depends="get-build-list" description="Run JUnit tests on each component">
   119         <subant target="junit" buildpathref="ivy.buildlist.path">
   129         <subant target="junit" buildpathref="ivy.buildlist.path">
   120             <property name="builder.dir" location="${builder.dir}" />
   130             <property name="builder.dir" location="${builder.dir}" />
   121         </subant>
   131             <property name="source.root.dir" location="${source.root.dir}" />
   122     </target>
   132         </subant>
   123     
   133     </target>
   124     <target name="antunit" depends="get-build-list" description="Run antunit on each component">
   134     
       
   135     
       
   136     <target name="antunit" depends="get-build-list" description="Run AntUnit tests on each component">
   125         <subant target="antunit" buildpathref="ivy.buildlist.path">
   137         <subant target="antunit" buildpathref="ivy.buildlist.path">
   126             <property name="builder.dir" location="${builder.dir}" />
   138             <property name="builder.dir" location="${builder.dir}" />
   127         </subant>
   139             <property name="source.root.dir" location="${source.root.dir}" />
   128     </target>
   140         </subant>
       
   141     </target>
       
   142     
   129     
   143     
   130     <target name="quality" depends="get-build-list" description="Run quality checks on each component">
   144     <target name="quality" depends="get-build-list" description="Run quality checks on each component">
   131         <ac:for param="file" keepgoing="true">
   145         <ac:for param="file" keepgoing="true">
   132             <path refid="ivy.buildlist.path" />
   146             <path refid="ivy.buildlist.path" />
   133             <sequential>
   147             <sequential>
   139                 </ant>
   153                 </ant>
   140             </sequential>
   154             </sequential>
   141         </ac:for>
   155         </ac:for>
   142     </target>
   156     </target>
   143 
   157 
       
   158     
   144     <target name="checkstyle" depends="get-build-list" description="Run checkstyle on each component">
   159     <target name="checkstyle" depends="get-build-list" description="Run checkstyle on each component">
   145         <ac:for param="file" keepgoing="true">
   160         <ac:for param="file" keepgoing="true">
   146             <path refid="ivy.buildlist.path" />
   161             <path refid="ivy.buildlist.path" />
   147             <sequential>
   162             <sequential>
   148                 <ant antfile="@{file}" dir="@{file}/.." target="checkstyle" inheritAll="false">
   163                 <ant antfile="@{file}" dir="@{file}/.." target="checkstyle" inheritAll="false">
   152                 </ant>
   167                 </ant>
   153             </sequential>
   168             </sequential>
   154         </ac:for>
   169         </ac:for>
   155     </target>
   170     </target>
   156 
   171 
       
   172     
   157     <target name="get-deps" description="Retrieving Helium dependencies">
   173     <target name="get-deps" description="Retrieving Helium dependencies">
   158         <ac:if>
   174         <ac:if>
   159             <not>
   175             <not>
   160                 <isset property="config" />
   176                 <isset property="config" />
   161             </not>
   177             </not>
   177             pattern="${source.root.dir}/external/antlibs2/[artifact]-[revision].[ext]" />        
   193             pattern="${source.root.dir}/external/antlibs2/[artifact]-[revision].[ext]" />        
   178         <ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
   194         <ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
   179             module="helium-${config}-config" revision="1.0"
   195             module="helium-${config}-config" revision="1.0"
   180             inline="true" type="egg"
   196             inline="true" type="egg"
   181             pattern="${source.root.dir}/external/python/lib/auto/[artifact]-[revision].[ext]" />
   197             pattern="${source.root.dir}/external/python/lib/auto/[artifact]-[revision].[ext]" />
   182         <fileset id="egg.deps.fileset" dir="${source.root.dir}/external/python/lib/auto" includes="*.egg" />
   198         <fileset id="egg.deps.fileset" dir="${source.root.dir}/external/python/lib/auto" includes="*.egg" excludes="jython*.egg" />
   183         <fmpp sourceFile="template/easy-install.pth.ftl" outputFile="${source.root.dir}/external/python/lib/auto/easy-install.pth">
   199         <fmpp sourceFile="template/easy-install.pth.ftl" outputFile="${source.root.dir}/external/python/lib/auto/easy-install.pth">
   184             <data>
   200             <data>
   185                 project: antProject()
   201                 project: antProject()
   186             </data>
   202             </data>
   187         </fmpp>
   203         </fmpp>
   252                     replace="\1"
   268                     replace="\1"
   253                     casesensitive="false" />
   269                     casesensitive="false" />
   254         <echo message="Revision set to: ${helium.revision}" />
   270         <echo message="Revision set to: ${helium.revision}" />
   255     </target>
   271     </target>
   256     
   272     
       
   273     
   257     <target name="update-version" depends="get-helium-revision">
   274     <target name="update-version" depends="get-helium-revision">
   258         <ac:if>
   275         <ac:if>
   259             <available file="${source.root.dir}/config/version.txt.orig" />
   276             <available file="${source.root.dir}/config/version.txt.orig" />
   260             <then>
   277             <then>
   261                 <move file="${source.root.dir}/config/version.txt.orig" tofile="${source.root.dir}/config/version.txt" />
   278                 <move file="${source.root.dir}/config/version.txt.orig" tofile="${source.root.dir}/config/version.txt" />
   266         <propertyfile file="${source.root.dir}/config/version.txt" comment="Helium version - DO NOT EDIT">
   283         <propertyfile file="${source.root.dir}/config/version.txt" comment="Helium version - DO NOT EDIT">
   267             <entry key="helium.version" value="${helium.version}-r${helium.revision}"/>
   284             <entry key="helium.version" value="${helium.version}-r${helium.revision}"/>
   268         </propertyfile>
   285         </propertyfile>
   269     </target>
   286     </target>
   270 
   287 
       
   288     
   271     <target name="restore-version">
   289     <target name="restore-version">
   272         <move file="${source.root.dir}/config/version.txt.orig" tofile="${source.root.dir}/config/version.txt" />
   290         <move file="${source.root.dir}/config/version.txt.orig" tofile="${source.root.dir}/config/version.txt" />
   273     </target>
   291     </target>
       
   292     
   274     
   293     
   275     <target name="create-releasable" depends="get-deps,update-version,build-helium-docs,zip-releasable,restore-version" description="Create releasable binary package"/>
   294     <target name="create-releasable" depends="get-deps,update-version,build-helium-docs,zip-releasable,restore-version" description="Create releasable binary package"/>
   276     
   295     
   277     
   296     
   278     <target name="textdoc">
   297     <target name="textdoc">
   284             <fileset dir="${source.root.dir}" includes="*/java/*/**/*.rst"/>
   303             <fileset dir="${source.root.dir}" includes="*/java/*/**/*.rst"/>
   285             <fileset dir="${source.root.dir}" includes="*/python/*/**/*.rst"/>
   304             <fileset dir="${source.root.dir}" includes="*/python/*/**/*.rst"/>
   286         </copy>
   305         </copy>
   287         <rstMacro version="1.0" src="${build.temp.dir}/doc/doctmp"/>
   306         <rstMacro version="1.0" src="${build.temp.dir}/doc/doctmp"/>
   288     </target>
   307     </target>
       
   308     
   289     
   309     
   290     <!-- Macro to generate html docs from rst. -->
   310     <!-- Macro to generate html docs from rst. -->
   291     <macrodef name="rstMacro">
   311     <macrodef name="rstMacro">
   292         <attribute name="version"/>
   312         <attribute name="version"/>
   293         <attribute name="src" default="${source.root.dir}/sf/doc/src"/>
   313         <attribute name="src" default="${source.root.dir}/sf/doc/src"/>
   306                 <arg file="@{src}" />
   326                 <arg file="@{src}" />
   307                 <arg file="@{output}" />
   327                 <arg file="@{output}" />
   308             </exec>
   328             </exec>
   309         </sequential>
   329         </sequential>
   310     </macrodef>
   330     </macrodef>
       
   331     
   311 </project>
   332 </project>
       
   333 
       
   334