Add brag determination in a separate hlm call
authorDario Sestito <darios@symbian.org>
Wed, 08 Sep 2010 13:54:46 +0100
changeset 1249 96548ab09767
parent 1247 311e0398c886
child 1250 cf7f8806ba43
Add brag determination in a separate hlm call
common/build.finalize.xml
common/build.postbuild.xml
common/build.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/build.finalize.xml	Wed Sep 08 13:54:46 2010 +0100
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="SF-FINALIZE" xmlns:hlm="http://www.nokia.com/helium">
+  
+  <!-- Transform BRAG xslt and display status at the end of the build -->
+  <target name="sf-finalize">
+    <delete dir="${build.drive}/output/logs/summary/">
+      <include name="**/*.html"/>
+    </delete>
+    <available property="sf-summary-dir-available" file="${build.drive}/output/logs/summary" type="dir"/>
+    <if><isset property="sf-summary-dir-available"/>
+      <then>
+        <xslt basedir="${build.drive}/output/logs/summary" destdir="${temp.build.dir}" extension=".html" style="brag.xsl"/>    
+        <loadfile srcFile="${temp.build.dir}/_BRAG.html" property="sf.brag.status">
+          <filterchain>
+            <linecontainsregexp>
+             <regexp pattern="(BLACK|RED|AMBER|GREEN)"/>
+            </linecontainsregexp>
+            <trim/>
+            <striplinebreaks/>
+            <deletecharacters chars="\&gt;\&lt;\h2\h1\/"/>
+          </filterchain>
+        </loadfile>
+      </then>
+      <else>
+        <property name="sf.brag.status" value="BLACK"/>
+      </else>
+    </if>
+    <echo message="BRAG STATUS: [${sf.brag.status}] - full build details available at ${build.drive}\output\logs\summary\_BRAG.xml"/>
+    
+    <!-- record brag information in BIT file -->
+    <echo message="build_brag&#x0009;${sf.brag.status}${line.separator}" file="${build.log.dir}/bitinfo.txt" append="true"/>
+    
+    <!-- record build finished time in BIT file -->
+    <tstamp>
+      <format property="sf.build.finishedtime" pattern="yyyy-MM-dd HH:mm:ss" locale="en,UK"/>
+    </tstamp>
+    <echo message="finished&#x0009;${sf.build.finishedtime}${line.separator}" file="${build.log.dir}/bitinfo.txt" append="true"/>
+    
+    <!-- upload BIT info to database -->
+    <exec executable="perl" dir="${sf.common.config.dir}/tools" failonerror="false">
+        <arg value="bitops.pl"/>
+        <arg value="-c"/>
+        <arg value="-f"/>
+        <arg value="${build.log.dir}/bitinfo.txt"/>
+    </exec>
+  </target>
+	
+</project>
--- a/common/build.postbuild.xml	Mon Sep 06 11:03:19 2010 +0100
+++ b/common/build.postbuild.xml	Wed Sep 08 13:54:46 2010 +0100
@@ -103,7 +103,6 @@
                 <runtarget target="sf-publish"/>
             </then>
         </if>
-        <runtarget target="sf-build-summary"/>
         <stopwatch name="sf-postbuild" action="elapsed"/>
     </target>
 
@@ -1097,27 +1096,5 @@
         </then>
         </if>        
     </target>
-
-    <!-- Transform BRAG xslt and display status at the end of the build -->
-    <target name="sf-build-summary">
-    <delete dir="${build.drive}/output/logs/summary/">
-      <include name="**/*.html"/>
-    </delete>
-     <xslt basedir="${build.drive}/output/logs/summary" destdir="${temp.build.dir}" extension=".html" style="brag.xsl"/>    
-    <loadfile srcFile="${temp.build.dir}/_BRAG.html" property="sf.brag.status">
-    <filterchain>
-      <linecontainsregexp>
-        <regexp pattern="(BLACK|RED|AMBER|GREEN)"/>
-      </linecontainsregexp>
-      <trim/>
-      <striplinebreaks/>
-      <deletecharacters chars="\&gt;\&lt;\h2\h1\/"/>
-    </filterchain>
-    </loadfile>    
-    <echo message="BRAG STATUS: [${sf.brag.status}] - full build details available at ${build.drive}\output\logs\summary\_BRAG.xml"/>
     
-    <!-- record brag information in BIT file -->
-    <echo message="build_brag&#x0009;${sf.brag.status}${line.separator}" file="${build.log.dir}/bitinfo.txt" append="true"/>
-    </target>
-
 </project>
--- a/common/build.xml	Mon Sep 06 11:03:19 2010 +0100
+++ b/common/build.xml	Wed Sep 08 13:54:46 2010 +0100
@@ -92,6 +92,7 @@
              
     <!-- Import functionality distributed into other file(s) -->
     <import file="${sf.common.config.dir}/build.postbuild.xml"/>
+    <import file="${sf.common.config.dir}/build.finalize.xml"/>
     
     <!-- Import test functionality distributed into other file(s) -->
     <import file="${sf.common.config.dir}/build.test.xml"/>