buildframework/helium/helium.ant.xml
changeset 1 be27ed110b50
child 179 d8ac696cc51f
equal deleted inserted replaced
0:044383f39525 1:be27ed110b50
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!-- 
       
     3 ============================================================================ 
       
     4 Name        : helium.ant.xml 
       
     5 Part of     : Helium 
       
     6 
       
     7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     8 All rights reserved.
       
     9 This component and the accompanying materials are made available
       
    10 under the terms of the License "Eclipse Public License v1.0"
       
    11 which accompanies this distribution, and is available
       
    12 at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    13 
       
    14 Initial Contributors:
       
    15 Nokia Corporation - initial contribution.
       
    16 
       
    17 Contributors:
       
    18 
       
    19 Description:
       
    20 
       
    21 ============================================================================
       
    22 -->
       
    23 <project name="helium" xmlns:hlm="http://www.nokia.com/helium">
       
    24     <description>
       
    25     Main full build targets and properties
       
    26     </description>
       
    27 
       
    28     <!-- Check the Ant version is what we expect. -->
       
    29     <property name="required.ant.version" value="1.7.0"/>
       
    30     <fail message="Incorrect version of Ant found. Please check you have Ant ${required.ant.version}.">
       
    31         <condition>
       
    32             <and>
       
    33                 <os family="windows"/>
       
    34                 <not>
       
    35                     <antversion exactly="${required.ant.version}"/>
       
    36                 </not>
       
    37             </and>
       
    38         </condition>
       
    39     </fail>
       
    40     
       
    41     
       
    42     <!-- Load the current Helium version. -->
       
    43     <property file="${helium.dir}/config/version.txt"/>
       
    44 
       
    45     <!-- Libraries
       
    46     ======================================================================-->
       
    47     <import file="helium_preinclude.ant.xml"/>
       
    48     
       
    49     <property name="cache.dir" location="${env.TEMP}/helium/${env.USERNAME}"/>
       
    50     <property name="helium.build.dir" location="${helium.dir}/build"/>
       
    51     
       
    52     <hlm:typedef file="${helium.dir}/tools/common/common.antlib.xml" uri="http://www.nokia.com/helium"/> 
       
    53     
       
    54     <property name="logging.output.file" location="${cache.dir}/logging.${env.PID}.conf" />
       
    55     <fmpp sourceFile="${helium.dir}/config/logging.conf.ftl" outputFile="${logging.output.file}" quiet="true">
       
    56         <data expandProperties="yes">
       
    57             ant: antProperties()
       
    58         </data>
       
    59     </fmpp>
       
    60      
       
    61     <!-- Properties
       
    62     ======================================================================-->
       
    63     <property name="team" value="${env.TEAM}"/>
       
    64 
       
    65     <!-- See if 'bn' is defined as a shortcut for build.number. -->
       
    66     <if>
       
    67         <isset property="bn"/>
       
    68         <then>
       
    69             <property name="build.number" value="${bn}"/>
       
    70         </then>
       
    71     </if>
       
    72     
       
    73     <!-- If build.drive not define then search the next free drive -->
       
    74     <if>
       
    75         <not>
       
    76             <isset property="build.drive"/>        
       
    77         </not>    
       
    78         <then>
       
    79             <property name="build.drive.notdefined" value="true"/> 
       
    80             <exec osfamily="windows" executable="python" failonerror="true" outputproperty="build.drive">
       
    81                 <arg value="${helium.dir}/tools/common/python/scripts/searchnextdrive.py"/>               
       
    82             </exec>
       
    83             <if>
       
    84                 <equals arg1="${build.drive}" arg2="Error: No free drive!"/>
       
    85                 <then>            
       
    86                     <fail message="ERROR: Failed to assign build drive, please check you are not running out of drives." />    
       
    87                 </then>
       
    88             </if>
       
    89             <echo> Using build drive ${build.drive} </echo>
       
    90         </then>
       
    91     </if>
       
    92     
       
    93     <if>
       
    94         <and>
       
    95             <isset property="major.version"/>
       
    96             <isset property="minor.version"/>
       
    97         </and>
       
    98         <then>
       
    99             <property name="core.build.version" value="${major.version}.${minor.version}"/>
       
   100         </then>
       
   101         <else>
       
   102             <property name="core.build.version" value="${env.USERNAME}"/>
       
   103         </else>
       
   104     </if>
       
   105     
       
   106     <if>
       
   107         <and>
       
   108             <isset property="read.build.int"/>
       
   109             <not>
       
   110                 <isset property="build.number"/>
       
   111             </not>
       
   112         </and>
       
   113         <then>
       
   114             <if>
       
   115                 <isset property="build.tag"/>
       
   116                 <then>
       
   117                     <property name="build.tag.ext" value="${build.tag}."/>
       
   118                 </then>
       
   119                 <else>
       
   120                     <property name="build.tag.ext" value=""/>
       
   121                     <property name="build.tag" value=""/>
       
   122                 </else>
       
   123             </if>
       
   124             <!-- Use an internal directory to store text files for assigning build number information. -->
       
   125             <property name="build.int.db.dir" location="${publish.root.dir}/internal/build_int_db"/>
       
   126             <mkdir dir="${build.int.db.dir}"/>
       
   127             <property name="build.int.db.file" value="${build.int.db.dir}/${build.name}_${core.build.version}_${build.tag}_build_int_db.txt"/>
       
   128             <if>
       
   129                 <available file="${build.int.db.file}"/>
       
   130                 <then>
       
   131                     <echo>Reading from existing build number property file.</echo>
       
   132                     <property file="${build.int.db.file}"/>
       
   133                     <echo>Build int = ${build.int}</echo>
       
   134                     <!-- Read the comments in the file too, for history information. -->
       
   135                     <loadfile property="build.int.db.file.comments" srcFile="${build.int.db.file}">
       
   136                         <filterchain>
       
   137                             <linecontains>
       
   138                                 <contains value="# history: "/>
       
   139                             </linecontains>
       
   140                         </filterchain>
       
   141                     </loadfile>
       
   142                     <!-- Set the property in case nothing was found. -->
       
   143                     <property name="build.int.db.file.comments" value=""/>
       
   144                     <echo>History comments:
       
   145 ${build.int.db.file.comments}</echo>
       
   146                     <property name="build.number" value="${build.tag.ext}${build.int}"/>
       
   147                     <echo>Writing incremented build int back to file.</echo>
       
   148                     <propertyfile file="${build.int.db.file}" comment="build.int database file">
       
   149                         <entry key="build.int" type="int" default="001" operation="+" pattern="000"/>
       
   150                     </propertyfile>
       
   151                     <tstamp>
       
   152                         <format property="build.int.db.file.tstamp" pattern="dd/MM/yyyy-HH:mm:ss"/>
       
   153                     </tstamp>
       
   154                     <concat destfile="${build.int.db.file}" append="true">
       
   155 ${build.int.db.file.comments}
       
   156 # history: ${env.COMPUTERNAME};${env.USERNAME};${build.int.db.file.tstamp};${build.int}
       
   157                     </concat>
       
   158                 </then>
       
   159                 <else>
       
   160                     <echo>Build number property file not found. Creating a new one.</echo>
       
   161                     <property name="new.build.int" value="001"/>
       
   162                     <property name="build.number" value="${build.tag.ext}${new.build.int}"/>
       
   163                     <echo>Build number = ${build.number}</echo>
       
   164                     <propertyfile file="${build.int.db.file}" comment="build.int database file">
       
   165                         <entry key="build.int" type="int" default="001" operation="+" pattern="000"/>
       
   166                     </propertyfile>
       
   167                 </else>
       
   168             </if>
       
   169         </then>
       
   170     </if>
       
   171 
       
   172 
       
   173     <!-- Define a number of properties that should be consistent amongst all builds. They can be overridden
       
   174     within any config or team Ant file though. -->
       
   175     <property name="build.name" value="helium"/>
       
   176     <if>
       
   177         <and>
       
   178             <isset property="core.build.version"/>
       
   179             <isset property="build.number"/>
       
   180         </and>
       
   181         <then>
       
   182             <property name="build.version" value="${core.build.version}.${build.number}"/>
       
   183         </then>
       
   184         <else>
       
   185             <property name="build.version" value="${env.USERNAME}"/>
       
   186         </else>
       
   187     </if>
       
   188     
       
   189     <property name="build.id" value="${build.name}_${build.version}"/>
       
   190     <property name="build.type" value="core"/>
       
   191     <property name="epocroot" value="\"/>
       
   192     <property name="data.model.file" location="${helium.dir}/config/helium_data_model.xml"/>
       
   193     <property name="data.model.parsed" location="${helium.build.dir}/datamodel.out"/>
       
   194     <condition property="data.model.xsl" value="${helium.dir}/extensions/nokia/config/helium_nokia_data_model.xsl" else="${helium.dir}/config/helium_data_model.xsl">
       
   195         <available file="${helium.dir}/extensions/nokia/config/helium_nokia_data_model.xsl"/>
       
   196     </condition>
       
   197     <property name="database.file" location="${helium.dir}/build/database.xml"/>
       
   198     <property name="ccm.base.dir" location="${ccm.home.dir}\${minor.version}"/>
       
   199     <property name="prep.build.dir" location="${prep.root.dir}/${build.id}"/>
       
   200     <property name="build.output.dir" location="${build.drive}/output"/>
       
   201     <property name="build.sisfiles.dir" location="${build.output.dir}/sisfiles"/>
       
   202     <property name="zips.build.dir" location="${build.output.dir}/build_area/engineering_english"/>
       
   203     <property name="zips.loc.dir" location="${build.output.dir}/build_area/localised"/>
       
   204     <property name="subcon.zips.dir" location="${build.output.dir}/build_area/subcon"/>
       
   205     <property name="zips.flashfiles.dir" location="${build.output.dir}/zips_flashfiles"/>
       
   206     <property name="build.log.dir" location="${build.output.dir}/logs"/>
       
   207     <property name="build.signal.status.dir" location="${build.log.dir}/signals"/>
       
   208     <property name="build.status.email.template" location="${helium.dir}/tools/common/templates/log/email_status.html.ftl" />
       
   209     <property name="metadata.dbfile" location="${build.log.dir}/${build.id}_metadata.sqlite"/>
       
   210     <property name="temp.build.dir" location="${build.output.dir}/temp_build_files"/>
       
   211     <property name="failonerror" value="false"/>
       
   212     <property name="build.errors.limit" value="0"/>
       
   213     <property name="unsubst.after.build" value="no"/>
       
   214     <property name="validate.properties.at.startup" value="yes"/>
       
   215     <property name="zip.wa.file" value="${build.drive}/output/src/${build.id}_sources.zip"/>
       
   216 
       
   217     <!-- Cache related properties. -->
       
   218     <property name="build.cache.dir" location="${cache.dir}/${build.id}"/>
       
   219     <property name="build.cache.log.dir" location="${build.cache.dir}/logs"/>
       
   220     <mkdir dir="${build.cache.log.dir}"/>
       
   221     
       
   222     <property name="tracing.csv.file" location="${build.cache.dir}/logs/${build.id}_traces.csv"/>
       
   223     
       
   224     <!-- Publish dir configuration. Defines subdir first and next toplevel properties. -->
       
   225     <property name="publish.subdir" value="${build.name}/builds/${core.build.version}/${build.id}"/>
       
   226     <property name="publish.release.subdir" value="${build.name}/releases/${core.build.version}/${build.id}"/>
       
   227     <property name="publish.dir" location="${publish.root.dir}/${publish.subdir}"/>
       
   228     <property name="publish.release.dir" location="${publish.root.dir}/${publish.release.subdir}"/>
       
   229     <condition property="is.published" else="false">
       
   230         <isset property="publish"/>
       
   231     </condition>
       
   232     
       
   233     <property name="release.images.dir" value="${build.output.dir}/release_flash_images"/>
       
   234     <property name="binary.root" value="${build.drive}/epoc32/release/armv5/urel" />
       
   235     <property name="python.dir" value="${helium.dir}/external/python/lib/2.5"/>
       
   236     <property name="python.tools" value="${helium.dir}/external/python/bin"/>
       
   237 
       
   238     <!-- EBS is selected as the default build system, but ec for Electric Cloud could be used. -->
       
   239     <property name="build.system" value="ebs"/>
       
   240     <property name="genxml.output.file" location="${temp.build.dir}/${build.id}.${sysdef.configuration}.xml" />
       
   241     <property name="canonical.sysdef.file" value="${build.output.dir}/build/canonical_system_definition.xml"/>
       
   242     <property name="build.system.${build.system}" value="Not used"/>
       
   243     <property name="build.summary.file" location="${build.log.dir}/summary/${build.id}_summary.log.xml"/>
       
   244     <property name="error.summary.file" location="${build.log.dir}/summary/${build.id}_error_summary.log.xml"/>
       
   245     <property name="build.logging.start.stage" value="check-env-prep"/>
       
   246     <property name="build.logging.key.stages" value="prep,build-ebs-main,postbuild,flashfiles,java-certification-rom,zip-main,publish-generic,variants-core,variants-elaf,variants-china,variants-thai,variants-japan,variants,mobilecrash-prep,localise-tutorial-content,hdd-images,zip-flashfiles,zip-localisation,data-packaging-prep"/>
       
   247     <property name="build.log" value="${build.log.dir}/${build.id}_ant_build.log"/>
       
   248     <property name="overlays.log.file" location="${build.log.dir}/${build.id}_overlays.xml"/>
       
   249     <property name="diamonds.listener.configuration.file" location="${helium.dir}/config/diamonds_config.xml.ftl"/>
       
   250     <property name="antlib.import.module.path" location="${helium.dir}/tools/hlm-antlib-imports"/>
       
   251     
       
   252     <!-- Following are temporarily defined here until global tools available-->
       
   253     <property name="ec.scripts.dir" location="${helium.dir}/external/symbiantools/ectools/"/>
       
   254     <property name="ec.history.dir" location="${publish.root.dir}\${product.family}\ec_history"/>
       
   255     <property name="ec.tools.dir" location="${helium.dir}/external/symbiantools/ectools/tools/"/>
       
   256     <property name="release.label" value="${build.version}"/>
       
   257     <property name="ec.mode" value="parallel" />
       
   258     <property name="ec.allow.duplicates" value="0" />
       
   259     <property name="roms.spec.name" value=""/>
       
   260     <property name="zip.ee.log.file" location="${build.log.dir}/${build.id}_ee_zip.log" />
       
   261     <property name="zip.localised.log.file" location="${build.log.dir}/${build.id}_localised_zip.log" />
       
   262     <property name="zip.subcon.log.file" value="${build.log.dir}/${build.id}_subcon_zip.log" />
       
   263     <property name="zip.subcon_roms.log.file" location="${build.log.dir}/${build.id}_subcon_roms_zip.log" />
       
   264     <property name="zip.trace_roms.log.file" location="${build.log.dir}/${build.id}_trace_roms_zip.log" />
       
   265     <property name="zip.uda_roms.log.file" location="${build.log.dir}/${build.id}_uda_roms_zip.log" />
       
   266     <property name="rombuild.makefile.name" value="image_conf_helium.mk" />
       
   267     <property name="loc.temp.dir" location="${temp.build.dir}/locfiles"/>
       
   268     <property name="loc.output.dir" location="${build.output.dir}/build_area/localised"/>
       
   269     <property name="loc.output.filename" location="${build.id}_locfiles.zip"/>
       
   270     
       
   271     <property name="tools.ivy.config.file" location="${helium.dir}/config/ivy/tools_ivy_settings.xml" />
       
   272     
       
   273     <property name="build.property.cache.file" location="${build.log.dir}/build_properties_cache.txt" />
       
   274     <property name="ccmtask.python.script.file" location="${helium.dir}/tools/preparation/synergy/ccmtask.jep" />
       
   275 
       
   276     <if>
       
   277         <available file="${build.property.cache.file}"/>
       
   278         <then>
       
   279             <property file="${build.property.cache.file}"/>
       
   280         </then>
       
   281     </if>
       
   282 
       
   283     
       
   284 
       
   285     <!-- Default number of threads is 2 * NUMBER_OF_PROCESSORS, but this can be overridden by defining the
       
   286     property manually. -->
       
   287     <if>
       
   288         <not>
       
   289             <isset property="number.of.threads"/>
       
   290         </not>
       
   291         <then>
       
   292             <if>
       
   293                 <isset property="env.NUMBER_OF_PROCESSORS"/>
       
   294                 <then>
       
   295                     <math result="number.of.threads" operand1="${env.NUMBER_OF_PROCESSORS}" operation="*" operand2="2" datatype="int"/>
       
   296                 </then>
       
   297                 <else>
       
   298                     <property name="number.of.threads" value="2"/>
       
   299                 </else>
       
   300             </if>
       
   301         </then>
       
   302     </if>
       
   303      
       
   304 
       
   305     <!-- Import basic targets.
       
   306         
       
   307     The intention would be to split the targets into separate files somewhat
       
   308     matching the build phases located inside \nbuild and import each one here.
       
   309     -->
       
   310     <import file="extensions/nokia/build.xml" optional="true"/>
       
   311     <import file="tools/preparation/preparation.ant.xml"/>
       
   312     <import file="tools/common/common.ant.xml"/>
       
   313     <import file="tools/common/testing.ant.xml"/>
       
   314     <import file="tools/compile/compile.ant.xml"/>
       
   315     <import file="tools/common/docs.ant.xml"/>
       
   316     <import file="tools/localisation/localisation.ant.xml"/>
       
   317     <import file="tools/publish/publish.ant.xml"/>
       
   318     <import file="tools/metadata/metadata.ant.xml"/>
       
   319     <import file="tools/release/release.ant.xml"/>
       
   320     <import file="tools/rombuild/rombuild.ant.xml"/>
       
   321     <import file="tools/uda/uda.ant.xml"/>
       
   322     <import file="tools/quality/quality.ant.xml"/>
       
   323     <import file="tools/relnotes/relnotes.ant.xml"/>
       
   324     <import file="tools/integration/integration.ant.xml"/>
       
   325     <import file="tools/startup/antserver/remote.ant.xml" />
       
   326     <import file="tools/testing/testing.ant.xml" />
       
   327     <import file="tools/startup/bootstrap/bootstrap.ant.xml"/>
       
   328     <import file="tools/iad/iad.ant.xml"/>
       
   329     <import file="config/signaling_config_default.ant.xml"/>
       
   330     <import file="config/metadata_filter_config_default.ant.xml"/>
       
   331 
       
   332     <!-- Checking required properties from datamodel if "validate.properties.at.startup=yes" 
       
   333         
       
   334     Comment this out until it is done more correctly.-->
       
   335     <!--<if>
       
   336         <and>
       
   337             <isset property="validate.properties.at.startup"/>
       
   338             <equals arg1="${validate.properties.at.startup}" arg2="yes"/>
       
   339         </and>
       
   340         <then>
       
   341             <runtarget target="validate-at-startup"/>
       
   342         </then>
       
   343     </if>-->
       
   344     
       
   345     <!-- Top level build execution targets.
       
   346         
       
   347     All of these should simply depend on other targets. They should not contain any tasks.
       
   348     -->
       
   349     
       
   350     <!-- Top-level target for platform builds. -->
       
   351     <target name="platform-build"
       
   352             depends="prep,prebuild,compile-main,postbuild,ee-roms,zip-ee,publish-generic,
       
   353                      report,final"
       
   354             description="The default platform build"/>
       
   355     
       
   356     <!-- Top-level target for IBUSAL builds. -->
       
   357     <target name="ibusal-build"
       
   358             depends="prep-drive,init-build-area,prebuild,build-info,log-build-env,
       
   359                      check-env-prep,diamonds,prep-copy,set-arm-version,
       
   360                      create-canonical-sysdef-file,compile-main,zip-ee"
       
   361             description="The default IBUSAL build"/>
       
   362 
       
   363     <!-- Top-level target for IDO builds. -->
       
   364     <target name="ido-build"
       
   365             depends="diamonds,compile-clean,compile-main,ee-roms"
       
   366             description="IDO build"/>
       
   367 </project>