common/build.xml
changeset 1121 82b232da6082
parent 1113 488afbbbaebd
child 1117 0006ed4e0b6d
--- a/common/build.xml	Tue Jun 22 11:48:19 2010 +0100
+++ b/common/build.xml	Thu Jun 24 13:29:52 2010 +0100
@@ -67,7 +67,7 @@
        become immutable after helium.ant.xml import -->
       
     <property name="prep.log.dir"    value="${build.drive}/output/logs"/>
-    <property name="compile.log.dir" value="${build.drive}/output/logs"/>
+    <!-- property name="compile.log.dir" value="${build.drive}/output/logs"/-->
     <property name="post.log.dir"    value="${build.drive}/output/logs"/>
     <property name="archive.log.dir"    value="${build.drive}/output/logs"/>
     <property name="signals.log.dir"    value="${build.drive}/output/logs"/>
@@ -92,7 +92,7 @@
              
     <!-- Import functionality distributed into other file(s) -->
     <import file="${sf.common.config.dir}/build.postbuild.xml"/>
-	
+    
     <!-- Import test functionality distributed into other file(s) -->
     <import file="${sf.common.config.dir}/build.test.xml"/>
     
@@ -119,7 +119,11 @@
           <hlm:signalInput id="signalRunQMakeInput" failbuild="never">
             <hlm:notifierListRef refid="defaultFailNotifier" />
           </hlm:signalInput>
-
+          
+           <!-- allow use of a release_metadata.xml without all referenced files being present -->
+          <hlm:signalInput id="getenvSignalInput" failbuild="never">
+              <hlm:notifierListRef refid="defaultFailNotifier" />
+          </hlm:signalInput>
       </then>
     </if>
     
@@ -129,7 +133,7 @@
     
     <target name="sf-prep" depends="sf-prep-announce,prep-drive,init-build-area,create-bom,log-build-env,sf-get-utils">
         <!-- Test for the disk space we would like for this build -->
-	<fail>
+        <fail>
             <condition>
                 <not>
                     <or>
@@ -144,6 +148,9 @@
         <tempfile property="prep.dynamic.config" suffix="ant.xml" destdir="${temp.build.dir}"/>
 
         <runtarget target="sf-check-env"/>
+        
+        <!-- create zips folder for use later -->
+        <mkdir dir="${build.drive}/output/zips"/>
         <stopwatch name="sf-prep" action="elapsed"/>
     </target>
 
@@ -155,7 +162,7 @@
     <target name="sf-check-env">
         <echo message="Create report on environment info"/>
         <!-- Dario's environment dumper -->
-    	  <if>
+        <if>
             <isset property="sf.spec.baseline.location"/>
             <then>
                 <exec executable="perl" dir="${build.drive}/utilities/envinfo">
@@ -176,7 +183,7 @@
       <exec executable="perl" dir="${build.drive}">
           <arg value="${sf.common.config.dir}/tools/envinfo2diamonds.pl"/>
       </exec>
-    	
+        
         <!-- Conditional location of BuildEnv.xml. Project always preferred to default -->
         <if><available file="${sf.project.location}/BuildEnv.xml"/>        
             <then>
@@ -215,6 +222,26 @@
         </fail>
     </target>
 
+    <!-- Note: Not used from Helium 7 onwards -->
+    <target name="generate-layers">
+       <echo message="canno-file:${canonical.sysdef.file}"/>
+       <echo message="raptor-filters:raptor_${sysdef.configuration}"/>
+
+       <!-- All we want is a sysdef with the config name appended, so just copy it -->
+       <echo message="INFO: Skip GenXML and copy sysdef to sysdef+config name"/>
+       <copy file="${canonical.sysdef.file}" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
+
+        <copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml">
+        <filterchain>
+            <linecontainsregexp negate="true">
+                <regexp pattern="^\s*$"/>
+            </linecontainsregexp>
+        </filterchain>
+        </copy>
+        <copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml" todir="${build.log.dir}/BOM/"/>
+        <delete file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
+    </target>
+
     <target name="sf-summary" depends="">
         <echo>[SF-SUMMARY]</echo>
         <echo message="Generating build summary"/>
@@ -248,26 +275,6 @@
         <!-- Delete build directory -->
         <delete dir="${prep.build.dir}"/>
     </target>
-    
-    <!-- Note: Not used from Helium 7 onwards -->
-    <target name="generate-layers">
-       <echo message="canno-file:${canonical.sysdef.file}"/>
-       <echo message="raptor-filters:raptor_${sysdef.configuration}"/>
-
-       <!-- All we want is a sysdef with the config name appended, so just copy it -->
-       <echo message="INFO: Skip GenXML and copy sysdef to sysdef+config name"/>
-       <copy file="${canonical.sysdef.file}" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
-
-        <copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml">
-        <filterchain>
-            <linecontainsregexp negate="true">
-                <regexp pattern="^\s*$"/>
-            </linecontainsregexp>
-        </filterchain>
-        </copy>
-        <copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml" todir="${build.log.dir}/BOM/"/>
-        <delete file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
-    </target>
 
     <target name="sf-prebuild" depends="sf-prep,sf-prebuild-noprep"/>
     <target name="sf-prebuild-noprep" depends="sf-prebuild-announce,sf-diamonds-connect,sf-diamonds-envinfo,sf-diamonds-tag-build,sf-getenvs,sf-syncsource,sf-diamondize-bom">
@@ -298,12 +305,12 @@
           <echo>[SF-DIAMONDS-ENVINFO]</echo>
           <echo message="Send ${build.log.dir}/diamonds_envinfo.xml to Diamonds"/>
           <exec executable="python">
-		    <arg value="${sf.common.config.dir}/tools/brag/send_xml_to_diamonds.py"/>
-		    <arg value="-u"/>
-		    <arg value="http://${diamonds.host}${diamonds.build.id}"/>
-		    <arg value="-f"/>
-		    <arg value="${build.log.dir}/diamonds_envinfo.xml"/>
-		  </exec>
+            <arg value="${sf.common.config.dir}/tools/brag/send_xml_to_diamonds.py"/>
+            <arg value="-u"/>
+            <arg value="http://${diamonds.host}${diamonds.build.id}"/>
+            <arg value="-f"/>
+            <arg value="${build.log.dir}/diamonds_envinfo.xml"/>
+          </exec>
         </then>
       </if>
     </target>
@@ -348,11 +355,11 @@
             <arg value="identify"/>
             <arg value="-i"/>
         </exec>
-	<echo message="${sf.job.bom.project.repo},build/config,${sf.job.bom.project.checksum}" file="${build.drive}/output/logs/BOM/project.csv"/>
+        <echo message="${sf.job.bom.project.repo},build/config,${sf.job.bom.project.checksum}" file="${build.drive}/output/logs/BOM/project.csv"/>
     </target>
     
     <target name="sf-get-utils">
-    	<stopwatch name="sf-get-utils"/>
+      <stopwatch name="sf-get-utils"/>
         <echo message="Cloning utilities repository to ${build.drive}/utilities"/>
         <exec executable="hg">
             <arg value="clone"/>
@@ -361,7 +368,7 @@
             <arg value="http://developer.symbian.org/oss/MCL/sftools/fbf/utilities"/>
             <arg value="${build.drive}/utilities"/>
         </exec>
-    	<stopwatch name="sf-get-utils" action="elapsed"/>
+      <stopwatch name="sf-get-utils" action="elapsed"/>
     </target>
 
     <target name="sf-getenvs">
@@ -400,6 +407,7 @@
                 <echo message="${sf.spec.baseline.location}" file="${build.drive}/output/logs/BOM/baseline.txt"/>
                 
                 <!-- run internal target preparation-getenv -->
+                <delete file="${build.drive}/currentRelease.xml"/>        
                 <runtarget target="preparation-getenv"/>
                 <stopwatch name="sf-getenvs (baseline)" action="elapsed"/>
             </then>
@@ -431,8 +439,22 @@
     <target name="sf-get-source" depends="sf-generate-source-spec">
         <stopwatch name="sf-get-source"/>
         <!-- Get test manifest, and move resolved csv so that it doesnt conflict with source-spec.ant.xml -->
-        <ant antfile="${temp.build.dir}/source-test-spec.ant.xml" />
-        <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_test.csv"/>
+        <if>
+            <istrue value="${sf.spec.smoketest.enable}"/>
+            <then>
+                <ant antfile="${temp.build.dir}/source-test-spec.ant.xml" />
+                <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_test.csv"/>
+            </then>
+        </if>
+
+
+        <if><available file="${temp.build.dir}/source-rnd-spec.ant.xml"/>
+          <then>
+              <ant antfile="${temp.build.dir}/source-rnd-spec.ant.xml" />
+              <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_rnd.csv"/>
+          </then>
+        </if>
+        
         <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
         <stopwatch name="sf-get-source" action="elapsed"/>
     </target>
@@ -481,9 +503,11 @@
             <istrue value="${sf.spec.sourcesync.enable}" />
             <then>
                 <property name="sf.source.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
+                <property name="sf.source_rnd.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}"/>
             </then>
         </if>
-        <property name="sf.source.csv.file" value="nul:"/>
+        <property name="sf.source.csv.file"     value="nul:"/>
+        <property name="sf.source_rnd.csv.file" value="nul:"/>
 
         <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
               outputFile="${temp.build.dir}/source-spec.ant.xml">
@@ -494,15 +518,34 @@
                     ]
               </data>
         </fmpp>
-        <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
-              outputFile="${temp.build.dir}/source-test-spec.ant.xml">
-              <data expandProperties="yes">
-                    ant: antProperties()
-                    data: [
-                        csv(${sf.test.csv.file}, {separator:','})
-                    ]
-              </data>
-        </fmpp>
+		
+        <if><available file="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}"/>
+          <then>
+            <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
+                  outputFile="${temp.build.dir}/source-rnd-spec.ant.xml">
+                  <data expandProperties="yes">
+                        ant: antProperties()
+                        data: [
+                            csv(${sf.source_rnd.csv.file}, {separator:','})
+                        ]
+                  </data>
+            </fmpp>
+          </then>
+        </if>
+        <if>
+            <istrue value="${sf.spec.smoketest.enable}"/>
+            <then>
+            <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
+                  outputFile="${temp.build.dir}/source-test-spec.ant.xml">
+                  <data expandProperties="yes">
+                        ant: antProperties()
+                        data: [
+                            csv(${sf.test.csv.file}, {separator:','})
+                        ]
+                  </data>
+            </fmpp>
+            </then>
+        </if>
     </target>
     
     <!-- generate dir list using passed location and name 
@@ -625,7 +668,7 @@
                 project: csv(${build.drive}/output/logs/BOM/project.csv,{separator:',',headers:[loc,dst,rev]})
                 baseline: slicedText(${build.drive}/output/logs/BOM/baseline.txt,{trim})
                 toolsbaseline: slicedText(${build.drive}/output/logs/BOM/toolsbaseline.txt,{trim})
-                sources: csv(${build.drive}/output/logs/BOM/sources.csv,{separator:',',headers:[loc,dst,type,rev,sysdef]})              
+                sources: csv(${build.drive}/output/logs/BOM/sources.csv, {separator:',',headers:[loc,dst,type,rev,sysdef]})
             </data>
         </fmpp>
         <!-- Make a copy in BOM dir -->
@@ -633,7 +676,7 @@
     </target>
 
     <target name="sf-preprocess-package-config">
-	<echo message="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
+    <echo message="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
         <exec executable="perl" dir="${build.drive}/" failonerror="false" output="${build.log.dir}/zipconfig.log">
             <arg value="${sf.common.config.dir}/tools/populateziptemplate.pl"/>
             <arg value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
@@ -726,7 +769,7 @@
     
     <!-- Unpack the rnd zips ready to be used in the build -->
     <target name="sf-unpack-rnd">
-        <echo message="Unpacking any available RnD binaries"/>
+        <echo message="INFO Unpacking any available RnD binaries"/>
         <for param="rndZip">
             <fileset dir="${build.drive}/output/zips/">
                 <include name="binaries_*.zip"/> <!-- Internal rnd bins -->
@@ -740,7 +783,19 @@
                     <arg value="@{rndZip}"/>
                 </exec>
             </sequential>
-	</for>
+        </for>
+
+        <if><istrue value="${sf.spec.baseline.enable}"/>
+        <then>
+
+        <!-- also unpack any rnd bins from baseline location. may collide with package build getenv -->
+        <delete file="${build.drive}/currentRelease.xml"/>        
+        <antcall target="preparation-getenv" inheritAll="false">
+            <param name="base_release.path"           value="${sf.spec.baseline.location}"/>
+            <param name="base_release.getenv_options" value="-i rnd -k"/>
+        </antcall>
+        </then>
+        </if>
     </target>
 
   <target name="sf-compile-options">  
@@ -754,7 +809,7 @@
         <echo message="Generating ${sf.brag.id}_BRAG.xml from ${sf.brag.log}"/>
         <exec executable="perl" failonerror="false" output="${build.log.dir}/summary/${sf.brag.id}_BRAG.xml" logError="true">
             <arg value="${sf.common.config.dir}/tools/brag/logToBRAG.pl"/>
-	    <arg value="--phase=${sf.brag.phase}"/>
+        <arg value="--phase=${sf.brag.phase}"/>
             <arg value="--step=${sf.brag.step}"/>
             <arg value="--rules=${sf.common.config.dir}/tools/brag/rules.${sf.brag.id}.tsv"/>
             <arg value="${sf.brag.log}"/>