catchup merge
authorMattD <mattd@symbian.org>
Wed, 07 Oct 2009 10:36:41 +0100
changeset 616 136a11aee8bd
parent 615 6f70bcc536bb (current diff)
parent 610 4a27eba1d297 (diff)
child 617 637df8247b78
catchup merge
common/diamonds/sf-tag-build.xml.ftl
--- a/common/build.test.xml	Tue Oct 06 18:15:24 2009 +0100
+++ b/common/build.test.xml	Wed Oct 07 10:36:41 2009 +0100
@@ -159,7 +159,7 @@
         <exec executable="perl" dir="${build.drive}/smoketest/group" failonerror="false" append="true" output="${build.log.dir}/ATS_${build.id}_smoketest.log">
             <arg value="smoketest.pl"/>
         </exec>
-        <copy file="${build.drive}/smoketest/group/smoketest.zip" todir="${sf.spec.test.package.location}"/>
+        <copy file="${build.drive}/smoketest/group/smoketest.zip" todir="${sf.spec.test.package.location}"  failonerror="false"/>
         
         <echo message="INFO Updating smoketest package with test info"/>
         <exec executable="perl" dir="${sf.common.config.dir}/tools/ats/" failonerror="false" append="true" output="${build.log.dir}/ATS_${build.id}_smoketest.log">
--- a/common/build.xml	Tue Oct 06 18:15:24 2009 +0100
+++ b/common/build.xml	Wed Oct 07 10:36:41 2009 +0100
@@ -110,7 +110,7 @@
         </if>
         
         <echo message="Build Env against ${sf.buildenv.location}/BuildEnv.xml"/>
-        <exec executable="perl" dir="${sf.common.config.dir}/tools" failonerror="true">
+        <exec executable="perl" dir="${sf.common.config.dir}/tools" resultproperty="sf.checkenv.exit">
             <arg value="CheckBuildEnv.pl"/>
             <arg value="--xml=${sf.buildenv.location}/BuildEnv.xml"/>
             <arg value="--dbg=${build.log.dir}/BuildEnvironmentCheck.log"/>
@@ -118,6 +118,25 @@
             <arg value="--tools='${sf.spec.sbs.tools.config}'"/>
             <arg value="Common"/>
         </exec>
+        <mkdir dir="${build.log.dir}/summary" />
+        <exec executable="perl" failonerror="false" output="${build.log.dir}/summary/BuildEnvironmentCheck_BRAG.xml" logError="true">
+            <arg value="${sf.common.config.dir}/tools/brag/logToBRAG.pl"/>
+            <arg value="--phase=Prebuild"/>
+            <arg value="--step=Build Environment Check"/>
+            <arg value="--rules=${sf.common.config.dir}/tools/brag/rules.BuildEnvironmentCheck.tsv"/>
+            <arg value="${build.log.dir}/BuildEnvironmentCheck.log"/>
+        </exec>
+        <fail>
+            <condition>
+                <not>
+                    <or>
+                        <equals arg1="sf.checkenv.exit" arg2="0"/>
+                        <isset property="sf.suppress.buildenv.check"/>
+                    </or>
+                </not>
+            </condition>
+Build Environment Check failed. To stop this failure aborting the build set property sf.suppress.buildenv.check to any value.
+        </fail>
     </target>
     
     <target name="sf-summary" depends="">
@@ -191,25 +210,35 @@
     </target>
 
     <target name="sf-prebuild" depends="sf-prep,sf-prebuild-noprep"/>
-    <target name="sf-prebuild-noprep" depends="sf-prebuild-announce,sf-diamonds-tag-build,sf-record-proj-conf-bom,sf-getenvs,sf-syncsource,sf-diamondize-bom"/>
+    <target name="sf-prebuild-noprep" depends="sf-prebuild-announce,sf-diamonds-connect,sf-diamonds-tag-build,sf-record-proj-conf-bom,sf-getenvs,sf-syncsource,sf-diamondize-bom"/>
     
     <target name="sf-prebuild-announce">
         <echo>[SF-PREBUILD]</echo>
     </target>
+    
+    <target name="sf-diamonds-connect">
+      <if>
+        <istrue value="${sf.spec.publish.enable}"/>
+        <then>
+          <echo>[SF-DIAMONDS-CONNECT]</echo>
+          <runtarget target="diamonds"/>
+          <echo message="Save Diamonds build id value (${diamonds.build.id}) in a file"/>
+          <echo message="diamonds.build.id=${diamonds.build.id}" file="${build.log.dir}/diamonds_build_id.properties"/>
+        </then>
+      </if>
+    </target>
 
     <target name="sf-diamonds-tag-build">
       <if>
         <istrue value="${sf.spec.publish.enable}"/>
         <then>
           <echo>[SF-DIAMONDS-TAG-BUILD]</echo>
-          <runtarget target="diamonds"/>
-          <echo message="Save Diamonds build id value (${diamonds.build.id}) in a file"/>
-          <echo message="diamonds.build.id=${diamonds.build.id}" file="${build.log.dir}/diamonds_build_id.properties"/>
-          <fmpp sourceFile="${sf.common.config.dir}/diamonds/sf-tag-build.xml.ftl" outputFile="${build.drive}/output/logs/sf-tag-build.xml">
-            <data expandProperties="yes">
-              ant: antProperties()
-            </data>
-          </fmpp>
+          <echo message="Generate ${build.drive}/output/logs/sf-diamonds-tag-build.xml with Diamonds tags for this build"/>
+          <exec executable="perl" dir="${sf.common.config.dir}/tools" failonerror="true">
+            <arg value="${sf.common.config.dir}/tools/generate_diamonds_tags_xml.pl"/>
+            <arg value="--tags=${sf.diamonds.tags}"/>
+            <arg value="--output=${build.drive}/output/logs/sf-diamonds-tag-build.xml"/>
+          </exec>
         </then>
       </if>
     </target>
@@ -430,6 +459,14 @@
             <arg value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
             <arg value="${build.log.dir}/rnd_excludefile.txt"/>
         </exec>
+        <mkdir dir="${build.log.dir}/summary" />
+        <exec executable="perl" failonerror="false" output="${build.log.dir}/summary/PreprocessPackageConfig_BRAG.xml" logError="true">
+            <arg value="${sf.common.config.dir}/tools/brag/logToBRAG.pl"/>
+            <arg value="--phase=Prebuild"/>
+            <arg value="--step=Preprocess package config"/>
+            <arg value="--rules=${sf.common.config.dir}/tools/brag/rules.PreprocessPackageConfig.tsv"/>
+            <arg value="${build.log.dir}/zipconfig.log"/>
+        </exec>
     </target>
     
     <target name="sf-zip-content" depends="preprocess-zip-config">
--- a/common/diamonds/sf-tag-build.xml.ftl	Tue Oct 06 18:15:24 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<diamonds-build>
-  <schema>10</schema>
-  <tags>
-    <tag>${ant['sf.spec.publish.diamonds.tag']}</tag>
-  </tags>
-</diamonds-build>
\ No newline at end of file
--- a/common/tools/brag/brag.xsl	Tue Oct 06 18:15:24 2009 +0100
+++ b/common/tools/brag/brag.xsl	Wed Oct 07 10:36:41 2009 +0100
@@ -18,7 +18,7 @@
 	<xsl:variable name="unknownCount" select="count(phase/step/failures[@level!='critical' and @level!='major' and @level!='minor']/failure)"/>
 
 	<h2>
-	Overall BRAG staus: 
+	Overall BRAGG staus: 
 	<xsl:choose>
 		<xsl:when test="$criticalCount != 0">BLACK</xsl:when>
 		<xsl:when test="$majorCount != 0">RED</xsl:when>
--- a/common/tools/brag/raptorToBRAG.pl	Tue Oct 06 18:15:24 2009 +0100
+++ b/common/tools/brag/raptorToBRAG.pl	Wed Oct 07 10:36:41 2009 +0100
@@ -46,7 +46,7 @@
 			$xmlNewline,
 			bless
 			{
-				name => "build",
+				name => "Build",
 				Kids => [ $xmlNewline ]
 			}, "phase",
 		]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/brag/rules.BuildEnvironmentCheck.tsv	Wed Oct 07 10:36:41 2009 +0100
@@ -0,0 +1,3 @@
+^SHOWSTOPPER RAISED:	critical
+^ERROR:	major
+^WARNING:	minor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/brag/rules.PreprocessPackageConfig.tsv	Wed Oct 07 10:36:41 2009 +0100
@@ -0,0 +1,1 @@
+^Warning:	minor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/generate_diamonds_tags_xml.pl	Wed Oct 07 10:36:41 2009 +0100
@@ -0,0 +1,54 @@
+#! perl -w
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+# 
+# Contributors:
+#
+# Description:
+# Generate an XML file in the Diamonds format to upload build tags to Diamonds
+
+use strict;
+
+use Getopt::Long;
+
+my $taglist = 0;
+my $outputfile = 0;
+my $help = 0;
+GetOptions((
+	'tags:s' => \$taglist,
+	'output:s' => \$outputfile,
+	'help!' => \$help,
+));
+
+if ($help or !$outputfile)
+{
+	print "Usage: perl generate_diamonds_tags_xml.pl --tags COMMA_SEPARATED_TAG_LIST --output OUTPUT_FILE\n";
+}
+
+open(FILE, ">$outputfile");
+
+print FILE <<_END_HEADER;
+<?xml version=\"1.0\" encoding=\"utf-8\"?>
+<diamonds-build>
+  <schema>13</schema>
+  <tags>
+_END_HEADER
+
+my @tags = split(/,/, $taglist);
+for (@tags)
+{
+	print FILE "    <tag>$_</tag>\n";
+}
+
+print FILE <<_END_TRAILER;  
+  </tags>
+</diamonds-build>
+_END_TRAILER
+
+close(FILE);