buildframework/helium/tools/compile/sbs/sbs.ant.xml
changeset 309 b07719c2dcda
parent 179 d8ac696cc51f
child 587 85df38eb4012
equal deleted inserted replaced
181:59bb7c4d6172 309:b07719c2dcda
    18 
    18 
    19 Description:
    19 Description:
    20 
    20 
    21 ============================================================================
    21 ============================================================================
    22 -->
    22 -->
       
    23 <!--* @package compile -->
    23 <project name="compile.sbs" xmlns:hlm="http://www.nokia.com/helium">
    24 <project name="compile.sbs" xmlns:hlm="http://www.nokia.com/helium">
    24     <description>
    25     <description>
    25     Executes compilation of a System Model of System Definition file using Symbian SBS (Raptor) tools. 
    26     Executes compilation of a System Model of System Definition file using Symbian SBS (Raptor) tools. 
    26 
    27 
    27     Should not be called directly but through compile-main by setting ${build.system.sbs} property.
    28     Should not be called directly but through compile-main by setting ${build.system.sbs} property.
    41     hlm -Dsysdef.configurations.list=ALL -Dbuild.system=sbs compile-main
    42     hlm -Dsysdef.configurations.list=ALL -Dbuild.system=sbs compile-main
    42     hlm "-Dsysdef.configurations.list=REALLYCLEAN,ALL" -Dbuild.system=sbs compile-main
    43     hlm "-Dsysdef.configurations.list=REALLYCLEAN,ALL" -Dbuild.system=sbs compile-main
    43 
    44 
    44     -->
    45     -->
    45 
    46 
       
    47     <!-- skip sbs layer filtering (true) for new schema and false for schema 1.4.0
       
    48     @type boolean
       
    49     -->
    46     <property name="skip.sbs.layer.generation" value="false" />
    50     <property name="skip.sbs.layer.generation" value="false" />
    47     
    51     
    48     <!-- This target filters the canonical system definition file compare to the "raptor_${sysdef.configuration}" filter. -->
    52     <!-- 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">
    53     <macrodef name="generate-layers" uri="http://www.nokia.com/helium">
    50         <sequential>
    54         <sequential>
    87                 <echo message="Copying helium filter plugin to sbs home" />
    91                 <echo message="Copying helium filter plugin to sbs home" />
    88                 <copy file="${helium.dir}/tools/common/python/scripts/filter_metadatalog.py" todir="${env.SBS_HOME}/python/plugins/" failonerror="true" />
    92                 <copy file="${helium.dir}/tools/common/python/scripts/filter_metadatalog.py" todir="${env.SBS_HOME}/python/plugins/" failonerror="true" />
    89                 <copy file="${helium.dir}/tools/common/python/scripts/sbsscanlogmetadata.py" todir="${env.SBS_HOME}/python/plugins/" failonerror="true" />
    93                 <copy file="${helium.dir}/tools/common/python/scripts/sbsscanlogmetadata.py" todir="${env.SBS_HOME}/python/plugins/" failonerror="true" />
    90                 <echo message="sbs.patternset: ${sbs.patternset}" />
    94                 <echo message="sbs.patternset: ${sbs.patternset}" />
    91                 <hlm:generate-layers />
    95                 <hlm:generate-layers />
    92                 <var name="sbs.inputs.list" value="" unset="true"/>
    96                 <var name="sbs.internal.inputs.list" value="" unset="true"/>
    93                 <hlm:getsbsinputs config="sbs.${sysdef.configuration}" outputProperty="sbs.inputs.list"/>
    97                 <if>
    94                 <for list="${sbs.inputs.list}" delimiter="," param="sbs.input">
    98                     <istrue value="${schema.new}" />
       
    99                     <then>
       
   100                         <var name="sbs.internal.inputs.list" value="${sbs.inputs.list}"/>
       
   101                     </then>
       
   102                     <else>
       
   103                         <var name="sbs.internal.inputs.list" value="" unset="true"/>
       
   104                         <hlm:getsbsinputs config="sbs.${sysdef.configuration}" outputProperty="sbs.internal.inputs.list"/>
       
   105                     </else>
       
   106                 </if>
       
   107                 <for list="${sbs.internal.inputs.list}" delimiter="," param="sbs.input">
    95                     <sequential>
   108                     <sequential>
    96                         <echo message="building raptor input: @{sbs.input}" />
   109                         <echo message="building raptor input: @{sbs.input}" />
    97                         <hlm:getVariableValue name="--logfile" property="sbs.log.file">
   110                         <hlm:getVariableValue name="--logfile" property="sbs.log.file">
    98                             <hlm:sbsinput refid="@{sbs.input}" />
   111                             <hlm:sbsinput refid="@{sbs.input}" />
    99                         </hlm:getVariableValue>
   112                         </hlm:getVariableValue>
   110                             <then>
   123                             <then>
   111                                 <runtarget target="set-arm-version"/>
   124                                 <runtarget target="set-arm-version"/>
   112                             </then>
   125                             </then>
   113                         </if>
   126                         </if>
   114                         <var name="sbs.clean.log" value="${sbs.log.file}.clean.log"/>
   127                         <var name="sbs.clean.log" value="${sbs.log.file}.clean.log"/>
       
   128                         <var name="sbs.what.log" value="${sbs.log.file}.whatlog.log"/>
   115                         <!-- Generate the filtered layers -->
   129                         <!-- Generate the filtered layers -->
   116                         <hlm:sbstask sbsinput="@{sbs.input}" sysdefFile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml" 
   130                         <if>
   117                             layerPatternSetRef="${sbs.patternset}" errorOutput="${sbs.log.file}.sbs_error.log" 
   131                             <isset property="run.coverity"/>
   118                             workingDir="${build.drive}/" failOnError="false" outputLog="${sbs.log.file}" cleanLog = "${sbs.clean.log}"
   132                             <then>
   119                              statsLog="${compile.log.dir}/${build.id}_${sysdef.configuration}.info.xml" />
   133                                 <hlm:coveritybuild  sbsinput="@{sbs.input}" 
       
   134                                                     sysdeffile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml"
       
   135                                                     layerpatternsetref="${sbs.patternset}" 
       
   136                                                     workingdir="${build.drive}/" 
       
   137                                                     execute="true"
       
   138                                                     failonerror="false"
       
   139                                                     outputlog="${sbs.log.file}" 
       
   140                                                     cleanlog = "${sbs.clean.log}"
       
   141                                                     whatlog = "${sbs.what.log}"
       
   142                                                     erroroutput="${sbs.log.file}.sbs_error.log"
       
   143                                                     statslog="${sbs.log.file}.info.xml">
       
   144                                     <hlm:coverityoptions refid="coverity.build.options"/>
       
   145                                 </hlm:coveritybuild>
       
   146                             </then>
       
   147                             <elseif>
       
   148                                 <istrue value="${sbs.build.ctc}"/>
       
   149                                 <then>
       
   150                                     <hlm:ctctask sbsinput="@{sbs.input}" 
       
   151                                                     sysdefFile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml" 
       
   152                                                     layerPatternSetRef="${sbs.patternset}" 
       
   153                                                     errorOutput="${sbs.log.file}.sbs_error.log" 
       
   154                                                     workingDir="${build.drive}/" 
       
   155                                                     failOnError="false" 
       
   156                                                     outputLog="${sbs.log.file}" 
       
   157                                                     cleanLog = "${sbs.clean.log}"
       
   158                                                     whatlog = "${sbs.what.log}"
       
   159                                                     statsLog="${sbs.log.file}.info.xml" />                                
       
   160                                 </then>
       
   161                             </elseif>
       
   162                             <else>
       
   163                                 <hlm:sbstask sbsinput="@{sbs.input}" 
       
   164                                                 sysdefFile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml" 
       
   165                                                 layerPatternSetRef="${sbs.patternset}" 
       
   166                                                 errorOutput="${sbs.log.file}.sbs_error.log" 
       
   167                                                 workingDir="${build.drive}/" 
       
   168                                                 failOnError="false" 
       
   169                                                 outputLog="${sbs.log.file}" 
       
   170                                                 cleanLog = "${sbs.clean.log}"
       
   171                                                 whatlog = "${sbs.what.log}"
       
   172                                                 statsLog="${sbs.log.file}.info.xml" />
       
   173                             </else>
       
   174                         </if>
       
   175                         <hlm:assertFileExists file="${sbs.log.file}"/>
       
   176                         <hlm:assertFileExists file="${sbs.clean.log}"/>
       
   177                         <hlm:assertFileExists file="${sbs.what.log}"/>
       
   178                         <hlm:assertFileExists file="${sbs.log.file}.sbs_error.log"/>
       
   179                         <hlm:assertFileExists file="${sbs.log.file}.info.xml"/>
   120                         <!-- run arm license checking / setting arm version only for arm config --> 
   180                         <!-- run arm license checking / setting arm version only for arm config --> 
   121                         <echo message="sbs.log.file: ${sbs.log.file}" />
   181                         <echo message="sbs.log.file: ${sbs.log.file}" />
   122                         <hlm:sbsProcessOutputMacro sbs.log.file="${sbs.log.file}"
   182                         <hlm:sbsProcessOutputMacro sbs.log.file="${sbs.log.file}"
   123                             sbs.clean.log.file="${sbs.clean.log}"  sbs.stats.file="${compile.log.dir}/${build.id}_${sysdef.configuration}.info.xml"
   183                             sbs.clean.log.file="${sbs.clean.log}" sbs.what.log.file="${sbs.what.log}" 
       
   184                             sbs.stats.file="${sbs.log.file}.info.xml"
   124                             sbs.ant.output.file="${sbs.log.file}" sbs.error.output.file="${sbs.log.file}.sbs_error.log"/>
   185                             sbs.ant.output.file="${sbs.log.file}" sbs.error.output.file="${sbs.log.file}.sbs_error.log"/>
   125                     </sequential>
   186                     </sequential>
   126                 </for>
   187                 </for>
   127                 <hlm:assertFileExists file="${sbs.log.file}.sbs_error.log"/>
       
   128                 <hlm:assertFileExists file="${compile.log.dir}/${build.id}_${sysdef.configuration}.info.xml"/>
       
   129                 <hlm:assertFileExists file="${sbs.log.file}"/>
       
   130                 <hlm:assertFileExists file="${sbs.clean.log}"/>
       
   131             </then>
   188             </then>
   132         </if>
   189         </if>
   133     </target>
   190     </target>
   134 
   191     
       
   192     
   135     <macrodef name="sbsProcessOutputMacro" uri="http://www.nokia.com/helium">
   193     <macrodef name="sbsProcessOutputMacro" uri="http://www.nokia.com/helium">
   136         <attribute name="sbs.clean.log.file" />
   194         <attribute name="sbs.clean.log.file" />
       
   195         <attribute name="sbs.what.log.file" />
   137         <attribute name="sbs.log.file" />
   196         <attribute name="sbs.log.file" />
   138         <attribute name="sbs.stats.file" />
   197         <attribute name="sbs.stats.file" />
   139         <attribute name="sbs.error.output.file" />
   198         <attribute name="sbs.error.output.file" />
   140         <attribute name="sbs.ant.output.file" />
   199         <attribute name="sbs.ant.output.file" />
   141         <sequential>
   200         <sequential>
   142             <var name="sbs.scan2.template" value="scan2.html.ftl" />
   201             <var name="sbs.scan2.template" value="scan2_orm.html.ftl" />
   143             <basename property="base.sbs.log" file="@{sbs.log.file}" suffix=".log"/>
   202             <var name="base.sbs.log" value="" unset="true"/>
       
   203             <basename property="base.sbs.log" file="@{sbs.log.file}" />
       
   204             <echo message="base.sbs.log: ${base.sbs.log}" />
   144             <hlm:metadatarecord database="${metadata.dbfile}">
   205             <hlm:metadatarecord database="${metadata.dbfile}">
   145                 <hlm:textmetadatainput>
   206                 <hlm:textmetadatainput>
   146                     <fileset casesensitive="false" file="@{sbs.error.output.file}"/>
   207                     <fileset casesensitive="false" file="@{sbs.error.output.file}"/>
   147                     <metadatafilterset refid="filterset.sbs" />
   208                     <metadatafilterset refid="filterset.sbs" />
   148                 </hlm:textmetadatainput>
   209                 </hlm:textmetadatainput>
   152                 signal.input="raptorErrorSignalInput" phase="compile"/>
   213                 signal.input="raptorErrorSignalInput" phase="compile"/>
   153             <!-- update the resultes to database -->
   214             <!-- update the resultes to database -->
   154             <echo message="Metadata enabled, storing build status in database" />
   215             <echo message="Metadata enabled, storing build status in database" />
   155             <echo message="sbs log file :@{sbs.log.file}" />
   216             <echo message="sbs log file :@{sbs.log.file}" />
   156             <echo message="sbs.clean.log.file :@{sbs.clean.log.file}" />
   217             <echo message="sbs.clean.log.file :@{sbs.clean.log.file}" />
       
   218             <echo message="sbs.what.log.file :@{sbs.what.log.file}" />
   157             <trycatch property="hlm-sbs.parser.thrown">
   219             <trycatch property="hlm-sbs.parser.thrown">
   158                 <try>
   220                 <try>
   159                     <hlm:metadatarecord database="${metadata.dbfile}">
   221                     <hlm:metadatarecord  database="${metadata.dbfile}">
   160                         <hlm:sbsmetadatainput cleanLogFile="@{sbs.clean.log.file}">
   222                         <hlm:sbsmetadatainput whatLogFile="@{sbs.what.log.file}" cleanLogFile="@{sbs.clean.log.file}">
   161                             <fileset casesensitive="false" file="@{sbs.log.file}"/>
   223                             <fileset casesensitive="false" file="@{sbs.log.file}"/>
   162                             <metadatafilterset refid="filterset.sbs" />
   224                             <metadatafilterset refid="filterset.sbs" />
   163                         </hlm:sbsmetadatainput>
   225                         </hlm:sbsmetadatainput>
   164                     </hlm:metadatarecord>
   226                     </hlm:metadatarecord>
   165                 </try>
   227                 </try>
   166                 <catch>
   228                 <catch>
   167                     <if>
   229                     <if>
   168                         <istrue value="${skip.sbs.parser.exception}" />
   230                         <istrue value="${skip.sbs.parser.exception}" />
   169                         <then>
   231                         <then>
   170                             <var name="sbs.scan2.template" value="scan2_text.html.ftl" />
   232                             <var name="sbs.scan2.template" value="scan2_text_orm.html.ftl" />
   171                             <hlm:metadatadelete database="${metadata-read-db}">
   233                             <hlm:metadatadelete database="${metadata.dbfile}">
   172                                 <fileset casesensitive="false" file="@{sbs.log.file}"/>
   234                                 <fileset casesensitive="false" file="@{sbs.log.file}"/>
   173                             </hlm:metadatadelete>
   235                             </hlm:metadatadelete>
   174                             <hlm:metadatarecord database="${metadata-read-db}" >
   236                             <hlm:metadatarecord database="${metadata.dbfile}" >
   175                                 <hlm:textmetadatainput>
   237                                 <hlm:textmetadatainput>
   176                                     <fileset casesensitive="false" file="@{sbs.log.file}"/>
   238                                     <fileset casesensitive="false" file="@{sbs.log.file}"/>
       
   239                                     <metadatafilterset refid="filterset.sbs" />
   177                                 </hlm:textmetadatainput>
   240                                 </hlm:textmetadatainput>
   178                             </hlm:metadatarecord>
   241                             </hlm:metadatarecord>
   179                         </then>
   242                         </then>
   180                         <else>
   243                         <else>
   181                             <fail message="failed during raptor log parsing: might be due to invalid xml output from raptor" />
   244                             <fail message="failed during raptor log parsing: might be due to invalid xml output from raptor" />
   182                         </else>
   245                         </else>
   183                     </if>
   246                     </if>
   184                 </catch>
   247                 </catch>
   185             </trycatch>
   248             </trycatch>
   186             <fmpp sourceFile="${helium.dir}/tools/common/templates/log/${sbs.scan2.template}"
   249             <fmpp sourceFile="${helium.dir}/tools/common/templates/log/${sbs.scan2.template}"
   187                          outputfile="@{sbs.log.file}.scan2.html">
   250                          outputfile="${build.log.dir}/${base.sbs.log}.scan2.html">
   188                 <freemarkerLinks expandProperties="yes">
   251                 <freemarkerLinks expandProperties="yes">
   189                     macro: ${helium.dir}/tools/common/templates/macro
   252                     macro: ${helium.dir}/tools/common/templates/macro
   190                 </freemarkerLinks>
   253                 </freemarkerLinks>
   191                 <data expandProperties="yes">
   254                 <data expandProperties="yes">
   192                     dbPath: ${metadata.dbfile}
   255                     dbPath: ${metadata.dbfile}
   193                     doc: xml(@{sbs.stats.file})
   256                     doc: xml(@{sbs.stats.file})
       
   257                     whatLogPath: @{sbs.what.log.file}
   194                     ant: antProperties()
   258                     ant: antProperties()
   195                 </data>
   259                 </data>
   196             </fmpp>
   260             </fmpp>
   197             <echo message="generating signal" />
   261             <echo message="generating signal" />
   198             <hlm:assertFileExists file="@{sbs.log.file}.scan2.html"/>
   262             <hlm:assertFileExists file="${build.log.dir}/${base.sbs.log}.scan2.html"/>
   199             <hlm:calculateErrorsFromLog logfile="@{sbs.log.file}" />
   263             <hlm:compileLogSignalMacro compile.summary.file="@{sbs.log.file}" 
   200             <hlm:compileLogSignalMacro compile.summary.file="${base.sbs.log}" 
       
   201                 error.limit="${build.errors.limit}" phase="compile"/>
   264                 error.limit="${build.errors.limit}" phase="compile"/>
   202             <!-- Blocks packaging configuration generation. -->
   265             <!-- Blocks packaging configuration generation. -->
   203             <if>
   266             <if>
   204                 <istrue value="${blocks.enabled}" />
   267                 <istrue value="${blocks.enabled}" />
   205                 <then>
   268                 <then>
   217                     </exec>
   280                     </exec>
   218                 </then>
   281                 </then>
   219             </if>
   282             </if>
   220         </sequential>
   283         </sequential>
   221     </macrodef>
   284     </macrodef>
       
   285     
       
   286     <scriptdef language="jython" name="getSbsHome" uri="http://www.nokia.com/helium">
       
   287         <attribute name="property" />
       
   288 if attributes.get("property") is None:
       
   289     raise Exception("property attribute has not been set.")
       
   290 if project.getProperty(attributes.get("property")) is None:
       
   291     import symbian.raptor
       
   292     sbs_home = symbian.raptor.getSBSHome()
       
   293     if sbs_home is not None:
       
   294         #self.log("Found SBS_HOME as " + sbs_home)
       
   295         project.setNewProperty(attributes.get("property"), sbs_home)
       
   296     </scriptdef>
       
   297 
   222 </project>
   298 </project>