buildframework/helium/tools/compile/sbs/sbs.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        : sbs.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="compile.sbs" xmlns:hlm="http://www.nokia.com/helium">
       
    24     <description>
       
    25     Executes compilation of a System Model of System Definition file using Symbian SBS (Raptor) tools. 
       
    26 
       
    27     Should not be called directly but through compile-main by setting ${build.system.sbs} property.
       
    28 
       
    29     Example:
       
    30 
       
    31     hlm -Dsysdef.configurations.list=ALL -Dbuild.system=sbs compile-main
       
    32     hlm "-Dsysdef.configurations.list=REALLYCLEAN,ALL" -Dbuild.system=sbs compile-main
       
    33     </description>
       
    34 
       
    35     <!-- Executes compilation  of a System Model of System Definition file using Symbian SBS (Raptor) tools. 
       
    36 
       
    37     Should not be called directly but through compile-main by setting ${build.system.sbs} property.
       
    38 
       
    39     Example: 
       
    40 
       
    41     hlm -Dsysdef.configurations.list=ALL -Dbuild.system=sbs compile-main
       
    42     hlm "-Dsysdef.configurations.list=REALLYCLEAN,ALL" -Dbuild.system=sbs compile-main
       
    43 
       
    44     -->
       
    45 
       
    46     <property name="skip.sbs.layer.generation" value="false" />
       
    47     
       
    48     <!-- This target filters the canonical system definition file compare to the "raptor_${sysdef.configuration}" filter. -->
       
    49     <macrodef name="generate-layers" uri="http://www.nokia.com/helium">
       
    50         <sequential>
       
    51             <echo message="canno-file:${canonical.sysdef.file}" />
       
    52             <echo message="raptor-filters:raptor_${sysdef.configuration}" />
       
    53             <if>
       
    54                 <istrue value="${skip.sbs.layer.generation}" />
       
    55                 <then>
       
    56                     <copy file="${canonical.sysdef.file}" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
       
    57                 </then>
       
    58                 <else>
       
    59                     <hlm:compileGenxmlFilterMacro input="${canonical.sysdef.file}" filter="raptor_${sysdef.configuration}"
       
    60                         output="${build.output.dir}/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
       
    61                 </else>
       
    62             </if>
       
    63             <copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"
       
    64                     tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml">
       
    65                 <filterchain>
       
    66                     <linecontainsregexp negate="true">
       
    67                         <regexp pattern="^\s*$"/>
       
    68                     </linecontainsregexp>
       
    69                 </filterchain>
       
    70             </copy>
       
    71             <delete file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
       
    72         </sequential>
       
    73     </macrodef>
       
    74 
       
    75     <if>
       
    76         <not>
       
    77             <isset property="sbs.config"/>
       
    78         </not>
       
    79         <then>
       
    80             <property name="sbs.config" value="armv5" />
       
    81             <property name="sbs.tools.config" value="tools_rel" />
       
    82         </then>
       
    83     </if>
       
    84 
       
    85     <import file="sbs.settings.ant.xml" />
       
    86 
       
    87     <!-- SBS build with gmake as engine type. Default is using sbs macro, to use old implementation to
       
    88     use using exec task, then sbs.using.exec needs to be set. -->
       
    89     <target name="compile-sbs" description="This is the main build that gets built for ARMV5 and WINSCW platforms">
       
    90         <if>
       
    91             <or>
       
    92                 <equals arg1="${build.system}" arg2="sbs" />
       
    93                 <equals arg1="${build.system}" arg2="sbs-ec" />
       
    94             </or>
       
    95             <then>
       
    96                 <!-- Choosing the right command (either clean or normal command) and 
       
    97                     the default command if no input is specified for sbs -->
       
    98                 <var name="sbs.cmd.reference" value="sbs" />
       
    99                 <var name="sbs.make.reference" value="${build.system}.make.options" />
       
   100                 <hlm:sbsMakeOptions id="sbs.internal.make.options" refid="${sbs.make.reference}" />
       
   101                 <if>
       
   102                     <istrue value="${compile.cmd.clean}"/>
       
   103                     <then>
       
   104                         <var name="sbs.cmd.reference" value="${sbs.cmd.reference}.clean" />
       
   105                     </then>
       
   106                 </if>
       
   107                 <if>
       
   108                     <not>
       
   109                         <isreference refid="${sbs.cmd.reference}.var"/>
       
   110                     </not>
       
   111                     <then>
       
   112                         <var name="sbs.cmd.reference" value="${sbs.cmd.reference}.default" />
       
   113                     </then>
       
   114                 </if>
       
   115                 <if>
       
   116                     <not>
       
   117                         <isreference refid="${sbs.make.reference}"/>
       
   118                     </not>
       
   119                     <then>
       
   120                         <hlm:sbsMakeOptions id="sbs.internal.make.options" refid="${sbs.make.reference}.default" />
       
   121                     </then>
       
   122                 </if>
       
   123                 <var name="sbs.cmd.reference" value="${sbs.cmd.reference}.var" />
       
   124                 <echo message="sbs build:${env.SBS_HOME}/python/plugins/filter_heliumlog.py" />
       
   125 
       
   126                 <!-- Generate the filtered layers -->
       
   127                 <hlm:generate-layers />
       
   128 
       
   129                 <!-- run arm license checking / setting arm version only for arm config --> 
       
   130                 <hlm:getVariableValue name="config" property="compilevalue.var">
       
   131                     <hlm:argSet refid="${sbs.cmd.reference}" />
       
   132                 </hlm:getVariableValue>
       
   133                 <if>
       
   134                     <not>
       
   135                         <equals arg1="${compilevalue.var}" arg2="winscw"/>
       
   136                     </not>
       
   137                     <then>
       
   138                         <runtarget target="set-arm-version"/>
       
   139                     </then>
       
   140                 </if>
       
   141 
       
   142                 <!-- only temporary once config file option starts to work, then no 
       
   143                 need to copy the plugin file -->
       
   144 
       
   145                 <echo message="Copying helium filter plugin to sbs home" />
       
   146                 <copy file="${helium.dir}/tools/common/python/scripts/filter_metadatalog.py" todir="${env.SBS_HOME}/python/plugins/" failonerror="true" />
       
   147                 <copy file="${helium.dir}/tools/common/python/scripts/sbsscanlogmetadata.py" todir="${env.SBS_HOME}/python/plugins/" failonerror="true" />
       
   148 
       
   149 
       
   150                 <echo>Building with SBSv2</echo>
       
   151                 <echo message="build.drive:${build.drive}"/>
       
   152                 <echo message="build.log.dir:${build.log.dir}"/>
       
   153                 <echo message="sysdef.configuration:${sysdef.configuration}"/>
       
   154                 <echo message="canonical.sysdef.file:${canonical.sysdef.file}"/>
       
   155                 <echo message="env.SBS_HOME:${env.SBS_HOME}"/>
       
   156                 <!-- Implicit calls to tools configuration, for temporary once the sbs is working
       
   157                     to execte all configuration at the same time, this could be removed. -->
       
   158                 <if>
       
   159                     <istrue value="${sbs.implicit.tools.build}" />
       
   160                     <then>
       
   161                         <echo message="Implicit tools configuration build" />
       
   162                         <hlm:sbsCompileMacro cmdreference = "sbs.implicit.tools.var" />
       
   163                     </then>
       
   164                 </if>
       
   165                 <hlm:sbsCompileMacro cmdreference = "${sbs.cmd.reference}" />
       
   166             </then>
       
   167         </if>
       
   168     </target>
       
   169 
       
   170     <macrodef name="sbsCompileMacro" uri="http://www.nokia.com/helium">
       
   171         <attribute name="cmdreference" />
       
   172         <sequential>
       
   173             <var name="sbs.log.file" value="" unset="true"/>
       
   174             
       
   175             <delete file="${build.log.dir}/${build.id}.${sysdef.configuration}_sbs_info.xml" failonerror="false"/>
       
   176             <!-- sbs.log.file set by sbs tool execution, temporary -->
       
   177             <hlm:toolMacro name="sbs">
       
   178                 <hlm:toolvarset refid="@{cmdreference}"/>
       
   179             </hlm:toolMacro>
       
   180             
       
   181             <!-- update the resultes to database -->
       
   182             <hlm:assertFileExists file="${build.log.dir}/${build.id}.${sysdef.configuration}_sbs_info.xml"/>
       
   183             <echo message="Metadata enabled, storing build status in database" />
       
   184             <echo message="sbs log file :${sbs.log.file}" />
       
   185             <hlm:metadatarecord database="${metadata.dbfile}">
       
   186                 <hlm:sbsmetadatainput>
       
   187                     <fileset casesensitive="false" file="${sbs.log.file}"/>
       
   188                     <metadatafilterset refid="filterset.sbs" />
       
   189                 </hlm:sbsmetadatainput>
       
   190             </hlm:metadatarecord>
       
   191             <basename property="base.sbs.log.file" file="${sbs.log.file}" suffix=".log"/>
       
   192             <echo message="base sbs log file :${base.sbs.log.file}" />
       
   193             <fmpp sourceFile="${helium.dir}/tools/common/templates/log/scan2.html.ftl"
       
   194                          outputfile="${sbs.log.file}.scan2.html">
       
   195                 <freemarkerLinks expandProperties="yes">
       
   196                     macro: ${helium.dir}/tools/common/templates/macro
       
   197                 </freemarkerLinks>
       
   198                 <data expandProperties="yes">
       
   199                     dbPath: ${metadata.dbfile}
       
   200                     doc: xml(${build.log.dir}/${build.id}.${sysdef.configuration}_sbs_info.xml)
       
   201                     ant: antProperties()
       
   202                 </data>
       
   203             </fmpp>
       
   204             <echo message="generating signal" />
       
   205             <hlm:assertFileExists file="${sbs.log.file}.scan2.html"/>
       
   206             <hlm:calculateErrorsFromLog logfile="${sbs.log.file}" />
       
   207             <hlm:compileLogSignalMacro compile.summary.file="${base.sbs.log.file}" 
       
   208                 error.limit="${build.errors.limit}"/>
       
   209             <!-- Blocks packaging configuration generation. -->
       
   210             <if>
       
   211                 <istrue value="${blocks.enabled}" />
       
   212                 <then>
       
   213                     <mkdir dir="${blocks.config.dir}" />
       
   214                     <exec executable="python">
       
   215                         <arg value="-m"/>
       
   216                         <arg value="packager.cli"/>
       
   217                         <arg value="--epocroot=${build.drive}/" />
       
   218                         <arg value="--config=${blocks.config.dir}" />
       
   219                         <arg value="--datasource=sbs" />
       
   220                         <arg value="-Dsbslog=${sbs.log.file}" />
       
   221                         <arg value="-Dsysdef=${canonical.sysdef.file}" />
       
   222                         <arg value="-Dthreads=20" />
       
   223                         <arg value="--updateData" />
       
   224                     </exec>
       
   225                 </then>
       
   226             </if>
       
   227         </sequential>
       
   228     </macrodef>
       
   229 
       
   230     <!-- Get the supported configuration(armv5, winscw) from system definition file.  This is 
       
   231     temporary and will be moved to get values from carbon tool. -->
       
   232     <target name="get-sbs-configs">
       
   233         <hlm:getSBSConfigMacro sbs.sysdef.file="${canonical.sysdef.file}"/>
       
   234         <echo message="configs:${sbs.configs}"/>
       
   235     </target>
       
   236 </project>