buildframework/helium/tests/minibuilds/compile/build.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        : 
       
     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="minibuild.compile" default="mini-build" xmlns:au="org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium" basedir=".">
       
    24 	<property environment="env" />
       
    25     <import file="../site/${env.TEAM}.ant.xml" optional="true"/>
       
    26 	<dirname property="config.dir" file="${ant.file.minibuild.compile}" />
       
    27 
       
    28 	<!-- Enable Helium internal assertion checking. -->
       
    29 	<property name="hlm.enable.asserts" value="1" />
       
    30 
       
    31 	<property name="build.name" value="minibuild_compile" />
       
    32 	<property name="build.family" value="test_minibuilds" />
       
    33 	<property name="major.version" value="0" />
       
    34 	<property name="minor.version" value="0" />
       
    35 	<property name="publish.root.dir" location="${build.drive}/release" />
       
    36 
       
    37 	<!-- For Grace upload-->
       
    38 	<property name="release.grace.service" value="Test_Helium" />
       
    39 	<property name="release.grace.product" value="minibuild_compile" />
       
    40 	<property name="release.label" value="${major.version}.${minor.version}" />
       
    41 
       
    42 	<!-- build configuration -->
       
    43 	<property name="sysdef.configurations.list" value="helium_minibuild_compile" />
       
    44 	<path id="system.definition.files">
       
    45 		<fileset dir="." includes="*.sysdef.xml" />
       
    46 	</path>
       
    47 
       
    48 	<property name="build.system" value="ec-helium" />
       
    49 	<property name="rvct.version" value="22_616" />
       
    50 
       
    51 	<!-- Archiving configuration-->
       
    52 	<property name="zip.config.file" location="archive.cfg.xml" />
       
    53 	<property name="zips.ee.spec.name" value="minibuild_archive" />
       
    54 
       
    55 	<!-- Synergy is not configured -->
       
    56 	<property name="skip.password.validation" value="1" />
       
    57 
       
    58 
       
    59 	<import file="${helium.dir}/helium.ant.xml" />
       
    60 
       
    61 	<!-- Run the full sequence of target for the minibuild. ,mini-build-prep,compile-main,zip-ee,mini-build-check-->
       
    62 	<target name="do-mini-build" depends="mini-build-cleanup,mini-build-install-new-imaker,mini-build-prep,
       
    63                 compile-main,test-ec-history-option,integration-mmp-to-target,mini-build-archive,build-roms,
       
    64                 minibuild-release,mini-build-check" />
       
    65 
       
    66 
       
    67 	<target name="do-mini-build-subcon" depends="mini-build-cleanup,mini-build-install-new-imaker,mini-build-prep,
       
    68                 compile-main,mini-build-archive,mini-build-check" />
       
    69 
       
    70 	<!--ant code coverage for mini-builds-->
       
    71 	<target name="mini-build">
       
    72     <antcall target="database">
       
    73         <param name="home.files.only" value="false"/>
       
    74     </antcall>
       
    75 		<mkdir dir="${helium.build.dir}/temp" />
       
    76 		<hlm:coveragerecord name="${helium.build.dir}/temp/test_minibuild.xml" action="start" />
       
    77 		<runtarget target="do-mini-build" />
       
    78 		<hlm:coveragerecord name="${helium.build.dir}/temp/test_minibuild.xml" action="stop" />
       
    79 		<fmpp sourcefile="${helium.dir}/tools/common/templates/coveragerecord.txt.ftl" outputfile="${helium.build.dir}/temp/test_minibuild.txt">
       
    80 			<data expandProperties="yes">
       
    81                 doc: xml(${helium.build.dir}/temp/test_minibuild.xml)
       
    82                 database: xml(${database.file})
       
    83             </data>
       
    84 		</fmpp>
       
    85 		<loadfile srcfile="${helium.build.dir}/temp/test_minibuild.txt" property="ant.coverage.summary" />
       
    86 		<echo>
       
    87 The summary of Ant code coverage:
       
    88 
       
    89 ${ant.coverage.summary}</echo>
       
    90 		<fmpp sourcefile="${helium.dir}/tools/common/templates/coveragerecord.html.ftl" outputfile="${helium.build.dir}/temp/test_minibuild.html">
       
    91 			<data expandProperties="yes">
       
    92                     doc: xml(${helium.build.dir}/temp/test_minibuild.xml)
       
    93                     database: xml(${database.file})
       
    94              </data>
       
    95 		</fmpp>
       
    96 	</target>
       
    97 	
       
    98     <!-- Test ec history option is create for single node build and merge is for multinode build. -->
       
    99     <target name="test-ec-history-option" if="build.system.ec-helium">
       
   100         <loadfile srcfile="${build.log.dir}/${build.id}.${sysdef.configurations.list}_run_emake.bat" property="emake.bat.file"/>
       
   101         <if>
       
   102             <equals arg1="${ec.maxagents}" arg2="1" />
       
   103             <then>
       
   104                 <au:assertTrue>
       
   105                     <contains string="${emake.bat.file}" substring="--emake-history=create"/>
       
   106                 </au:assertTrue>
       
   107             </then>
       
   108             <else>
       
   109                 <au:assertTrue>
       
   110                     <contains string="${emake.bat.file}" substring="--emake-history=merge"/>
       
   111                 </au:assertTrue>
       
   112             </else>
       
   113         </if>
       
   114         <echo message="ec.mode:${ec.mode}" />
       
   115         <echo message="ec.maxagents:${ec.maxagents}"/>
       
   116         <echo message="ec.history.option:${ec.history.option}"/>
       
   117     </target>
       
   118     
       
   119 	<!-- Prepare the minibuild. -->
       
   120 	<!--target name="mini-build-prep" depends="init-build-area,start-ant-log,diamonds,set-arm-version,prep-copy-symbiantools"/-->
       
   121 	<target name="mini-build-prep" depends="prep" />
       
   122 
       
   123 	<!-- Stubbing few targets for easy testing with dragonfly ... -->
       
   124 	<target name="prep-drive" depends="build-number" />
       
   125 	<target name="dragonfly-prep-drive" />
       
   126 	<target name="do-prep-work-area" />
       
   127 	<target name="create-bom" />
       
   128 	<target name="check-env-prep" />
       
   129 	<target name="prep-copy" />
       
   130 
       
   131 	<target name="minibuild-release">
       
   132 		<mkdir dir="${publish.release.dir}" />
       
   133 		<copy todir="${publish.release.dir}">
       
   134 			<fileset dir="${build.output.dir}">
       
   135 				<include name="release_flash_images/**" />
       
   136 			</fileset>
       
   137 		</copy>
       
   138 		<script language="jython" setbeans="false">
       
   139 			<![CDATA[
       
   140 import os
       
   141 import fileutils
       
   142 import pathaddition.relative
       
   143 result = []
       
   144 rootdir = os.path.normpath(project.getProperty("publish.release.dir") + "/..")
       
   145 
       
   146 def sortbydate(a, b):
       
   147     if os.stat(a)[9] == os.stat(b)[9]:
       
   148 	    return 0
       
   149     elif os.stat(a)[9] < os.stat(b)[9]:
       
   150         return 1
       
   151     return -1
       
   152 			
       
   153 if os.path.exists(rootdir):
       
   154     for name in os.listdir(rootdir):
       
   155         path = os.path.join(rootdir, name)
       
   156         if os.path.isdir(path):
       
   157            result.append(os.path.normpath(path))
       
   158 
       
   159 result.sort(sortbydate)
       
   160 if len(result) > 2:
       
   161     for name in result[2:]:
       
   162         print "Deleting " + name
       
   163         fileutils.rmtree(name)
       
   164 
       
   165 project.setProperty('fota.publish.root.dir', project.getProperty("publish.root.dir"))
       
   166 old = pathaddition.relative.abs2rel(result[0], project.getProperty("publish.root.dir"))
       
   167 new = pathaddition.relative.abs2rel(result[1], project.getProperty("publish.root.dir"))
       
   168 project.setProperty('fota.old.publish.subdir', result[0])
       
   169 project.setProperty('fota.new.publish.subdir', result[1])
       
   170 print "Old subdir: %s" % old
       
   171 print "New subdir: %s" % old
       
   172 ]]>
       
   173 		</script>
       
   174 	</target>
       
   175 
       
   176 	<!-- Upload to Grace -->
       
   177 	<target name="minibuild-grace-upload">
       
   178 		<echo message="Uploading files into Grace ${release.grace.dir}" />
       
   179 		<hlm:retry retryCount="${grace.upload.retryCount}" sleepTime="1000">
       
   180 			<copy file="${build.drive}\output\build_area\engineering_english\ant\sf_app_organizer_clock.zip" tofile="${release.grace.dir}\${build.name}_${major.version}.${minor.version}.${build.id}_sf_app_organizer_clock.zip" />
       
   181 		</hlm:retry>
       
   182 		<antcall target="release-grace-content">
       
   183 			<param name="release-grace-content" value="${cache.dir}" />
       
   184 		</antcall>
       
   185 	</target>
       
   186 
       
   187 
       
   188 	<!-- Check that the XML data returned from Diamonds via the REST interface
       
   189     is the same as what is sent. 
       
   190         
       
   191     Currently there are some differences between the formats so some edits to the
       
   192     XML content are made before using XMLUnit to compare the content.
       
   193     -->
       
   194 	<target name="check-diamonds">
       
   195 		<loadfile srcfile="${build.log.dir}/${build.id}_diamonds-log-start.xml" property="diamonds.log.start">
       
   196 			<filterchain>
       
   197 				<tokenfilter>
       
   198 					<filetokenizer />
       
   199 					<hlm:prettyprintxml />
       
   200 				</tokenfilter>
       
   201 			</filterchain>
       
   202 		</loadfile>
       
   203 		<echo>Data sent to Diamonds:
       
   204             
       
   205 ${diamonds.log.start}</echo>
       
   206 		<loadresource property="diamonds.log.start.output">
       
   207 			<url url="${diamonds.build.url}?fmt=xml" />
       
   208 			<filterchain>
       
   209 				<tokenfilter>
       
   210 					<filetokenizer />
       
   211 					<hlm:prettyprintxml />
       
   212 				</tokenfilter>
       
   213 			</filterchain>
       
   214 		</loadresource>
       
   215 		<echo>Data returned from Diamonds:
       
   216             
       
   217 ${diamonds.log.start.output}</echo>
       
   218 		<echo file="${helium.dir}/diamonds_build.xml">${diamonds.log.start}</echo>
       
   219 		<!--xmltask source="${helium.dir}/diamonds_build.xml" dest="${helium.dir}/diamonds_build_edit.xml">
       
   220             
       
   221             <cut path="/diamonds-build/tool" buffer="toolElements"/>
       
   222             <cut path="/diamonds-build/locations" buffer="temp"/>
       
   223         </xmltask-->
       
   224 		<!--<loadfile srcfile="${helium.dir}/diamonds_build_edit.xml" property="diamonds.log.start.edited"/>
       
   225         <echo>Data sent massaged to match what is received:
       
   226             
       
   227 ${diamonds.log.start.edited}</echo>-->
       
   228 		<!-- TODO: make assertXmlEqual work with direct string input -->
       
   229 		<string id="control.id" value="${diamonds.log.start}" />
       
   230 		<string id="test.id" value="${diamonds.log.start.output}" />
       
   231 		<hlm:assertXmlEqual control="control.id" test="test.id" failonerror="true" />
       
   232 	</target>
       
   233 
       
   234 
       
   235 	<target name="mini-build-archive" depends="mini-build-archive-ant,mini-build-archive-ec-full" />
       
   236 
       
   237 	<!-- This target will copy a part of the tree structure to test policy.remover mapper. -->
       
   238 	<target name="prepare-archiving">
       
   239 		<delete dir="${build.drive}/test_policy" failonerror="false" />
       
   240 		<mkdir dir="${build.drive}/test_policy/os" />
       
   241 		<!-- Creating a policy file under the new s60 test root. -->
       
   242 		<echo file="${build.drive}/test_policy/distribution.policy.s60">0</echo>
       
   243 		<echo file="${build.drive}/test_policy/os/distribution.policy.s60">0</echo>
       
   244 		<!-- Getting some Content -->
       
   245 		<copy todir="${build.drive}/test_policy">
       
   246 			<fileset dir="${build.drive}/sf">
       
   247 				<include name="os/graphics/" />
       
   248 			</fileset>
       
   249 		</copy>
       
   250 	</target>
       
   251 
       
   252 	<target name="mini-build-archive-ec-full">
       
   253 		<antcall target="do-mini-build-archive">
       
   254 			<param name="build.system" value="ec-helium" />
       
   255 			<param name="archive.using.ec" value="true" />
       
   256 			<param name="zipping.type" value="ec" />
       
   257 			<!-- Uses to set the target location -->
       
   258 		</antcall>
       
   259 	</target>
       
   260 
       
   261 	<target name="mini-build-archive-ant">
       
   262 		<antcall target="do-mini-build-archive">
       
   263 			<param name="build.system" value="ebs" />
       
   264 			<param name="archive.using.ec" value="false" />
       
   265 			<param name="zipping.type" value="ant" />
       
   266 			<!-- Uses to set the target location -->
       
   267 		</antcall>
       
   268 	</target>
       
   269 
       
   270 	<target name="do-mini-build-archive">
       
   271 		<runtarget target="prepare-archiving" />
       
   272 		<runtarget target="zip-ee" />
       
   273 		<!-- Checking the zip generation Ant -->
       
   274 		<au:assertFileExists file="${zips.build.dir}/${zipping.type}/release_metadata.xml" />
       
   275 		<au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_app_organizer_clock_binary.zip" />
       
   276 		<au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_app_organizer_clock.zip" />
       
   277         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_mw_classicui_and_app_radio_0.zip" />
       
   278         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_mw_classicui_and_app_radio_1.zip" />
       
   279         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_mw_classicui_and_app_radio_3.zip" />
       
   280 		<au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_mw_classicui_and_app_radio_950.zip" />
       
   281         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_os_0.zip" />
       
   282         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_os_1.zip" />
       
   283         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_os_2.zip" />
       
   284         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_os_3.zip" />
       
   285         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_os_7.zip" />
       
   286         <au:assertFileExists file="${zips.build.dir}/${zipping.type}/sf_os_1308.zip" />
       
   287 	</target>
       
   288 
       
   289 
       
   290 	<target name="mini-build-cleanup">
       
   291 		<delete verbose="true" includeemptydirs="true">		 
       
   292 			<fileset dir="${build.drive}/" casesensitive="false">
       
   293 				<include name="makefile" />
       
   294 				<include name="*.mk" />
       
   295 				<include name="*.make" />
       
   296 				<include name="ecloud_tmp_*/**" />
       
   297 				<include name="emake.*" />
       
   298 				<include name="epoc32/build/**" />
       
   299                 <include name="epoc32/rombuild/imaker_temp/**" />
       
   300                 <include name="epoc32/rombuild/${product.name}/**" />
       
   301 				<include name="epoc32/rom/config/*/**/foti*.*" />
       
   302 				<include name="output/**" />
       
   303 				<include name="timestart.txt" />
       
   304 				<include name="timestop.txt" />
       
   305 				<exclude name="output/build_area/localised/**" />
       
   306 			</fileset>
       
   307 		</delete>
       
   308 	</target>
       
   309 
       
   310 	<target name="mini-build-install-new-imaker">
       
   311 		<!-- Export custom image configuration file. -->
       
   312 		<copy file="config/image_conf_naming.mk" tofile="${build.drive}/epoc32/rom/config/image_conf_naming.mk" />
       
   313 		<property name="imaker.dir" value="${helium.dir}/../external/imaker" />
       
   314 		<!--
       
   315         <delete dir="${build.drive}/imaker_rnd"/>
       
   316         <copy todir="${build.drive}/imaker_rnd">
       
   317             <fileset dir="${imaker.dir}"/>
       
   318         </copy>
       
   319         
       
   320         <hlm:bldmakeBldfilesMacro dir="${build.drive}/imaker_rnd/group"/>
       
   321         <hlm:abldMacro dir="${build.drive}/imaker_rnd/group" command="cleanexport" platform=""/>
       
   322         <hlm:abldMacro dir="${build.drive}/imaker_rnd/group" command="export" platform=""/>
       
   323         -->
       
   324 	</target>
       
   325 
       
   326 	<target name="mini-build-check">
       
   327 		<!-- Check if prep has set some prop correctly... -->
       
   328 		<echo>'${arm.compiler.version}'</echo>
       
   329 		<au:assertMatches string="${arm.compiler.version}" pattern="RVCT2\.2 \[Build 616\]" casesensitive="false" multiline="true" />
       
   330 
       
   331 		<!-- Check if compile-main step did what expected... -->
       
   332 		<au:assertFileExists file="${canonical.sysdef.file}" />
       
   333 		<!--<au:assertFileExists file="${build.drive}/Makefile"/>-->
       
   334         <if>
       
   335             <istrue value="${blocks.enabled}" />
       
   336             <then>
       
   337                 <au:assertFileExists file="${blocks.config.dir}/roms.blocks_component.xml" />
       
   338             </then>
       
   339         </if>
       
   340 
       
   341 		<if>
       
   342 			<isset property="build.system.ec-helium" />
       
   343 			<then>
       
   344 				<au:assertFileExists file="${build.drive}/emake.data" />
       
   345 				<au:assertFileExists file="${build.log.dir}/${build.id}.helium_minibuild_compile_run_emake.bat" />
       
   346 			</then>
       
   347 		</if>
       
   348 
       
   349 		<resourcecount property="fpsx.count">
       
   350 			<fileset dir="${build.output.dir}">
       
   351 				<include name="**/*.core.fpsx" />
       
   352 				<include name="**/*.rofs2.fpsx" />
       
   353 			</fileset>
       
   354 		</resourcecount>
       
   355 		<echo>Number of images generated: ${fpsx.count}.</echo>
       
   356 	</target>
       
   357 
       
   358 
       
   359 	<!-- Custom iMaker configuration - preparing for future dev. -->
       
   360 	<property name="imaker.fmpp.makefile" location="${helium.dir}/tools/common/templates/imaker/build_imaker_roms_signing.mk.ftl" />
       
   361 	<hlm:imakerconfigurationset id="imaker.rom.config">
       
   362 		<imakerconfiguration>
       
   363 			<makefileset>
       
   364                 <include name="**/image_conf_${product.name}.mk" />
       
   365 			</makefileset>
       
   366 			<targetset>
       
   367 				<include name="fota" />
       
   368 			</targetset>
       
   369 		</imakerconfiguration>
       
   370 		<imakerconfiguration regionalVariation="true">
       
   371 			<makefileset>
       
   372 			    <include name="**/${product.name}/*ui.mk"/>
       
   373 			</makefileset>
       
   374 			<targetset>
       
   375 				<include name="core(?:-prd|-rnd|-subcon)?$" />
       
   376 				<include name="^langpack_01$" />
       
   377 				<exclude name=".*-image$" />
       
   378 			</targetset>
       
   379 			<variableset>
       
   380 				<variable name="USE_FOTI" value="1" />
       
   381 				<variable name="USE_FOTA" value="1" />
       
   382 				<variable name="TYPE" value="rnd" />
       
   383 			</variableset>
       
   384 		</imakerconfiguration>
       
   385 	</hlm:imakerconfigurationset>
       
   386 
       
   387 	<fileset dir="${build.drive}/" id="mmp.to.target.config">
       
   388 		<include name="s60/app/**/*.mmp" />
       
   389 	</fileset>
       
   390 
       
   391 </project>
       
   392