Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
authorMattD <mattd@symbian.org>
Wed, 12 Aug 2009 10:30:24 +0100
changeset 340 52d855dfda13
parent 339 97c01977a87b
child 341 7d32ac1c0cb5
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
common/build.xml
common/tools/populateziptemplate.pl
--- a/common/build.xml	Wed Aug 12 10:24:42 2009 +0100
+++ b/common/build.xml	Wed Aug 12 10:30:24 2009 +0100
@@ -98,6 +98,7 @@
         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
         for multiple package builds, this needs to be linked with package name. -->
         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
+        <delete file="${sf.common.config.dir}/generated/source-spec.ant.xml"/>
         
         <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
               outputFile="${sf.common.config.dir}/generated/source-spec.ant.xml">
@@ -329,15 +330,8 @@
         <if>
             <istrue value="${sf.spec.sourcesync.enable}" />
             <then>
-                <runtarget target="sf-get-source"/>
-                
-                <if><istrue value="${sf.spec.package.src.enable}"/>
-                <then>
-                    <echo message="INFO Packaging Source"/>
-                    <runtarget target="sf-package-source"/>
-                </then>
-                </if>
-                
+                <runtarget target="sf-get-source"/>                
+                <runtarget target="sf-package-source"/>                
                 <runtarget target="sf-unpack-rnd"/>
             </then>
             <else>
@@ -409,11 +403,17 @@
             <istrue value="${sf.spec.publish.enable}" />
             <then>
                 <echo message="Publish log files and reports to ${sf.spec.publish.rootdir}"/>
-                <runtarget target="publish"/>
+                <runtarget target="sf-publish"/>
             </then>
         </if>
     </target>
 
+    <target name="sf-publish" depends="prep-publish">
+        <copy todir="${publish.dir}" preservelastmodified="true" failonerror="false">
+           <fileset dir="${build.log.dir}"><include name="*.zip"/></fileset>
+        </copy>
+    </target>
+
     <target name="sf-getenv-tools">
         <antcall target="preparation-getenv" inheritAll="false">
             <param name="base_release.path"           value="${sf.spec.toolsbaseline.location}"/>
@@ -591,12 +591,24 @@
 
     <target name="sf-preprocess-package-config">
         <mkdir dir="${sf.common.config.dir}/generated"/>
+            <if><istrue value="${sf.spec.package.src.enable}"/>
+            <then>
+                <echo message="INFO Packaging Source Repos"/>
+                <property name="sf-preprocess-package-config.arg" value=""/>
+            </then>
+            <else>
+                <echo message="INFO Packaging: Ignoring Source Repos"/>
+                <property name="sf-preprocess-package-config.arg" value="--nosource"/>
+            </else>
+            </if>
+
         <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}"/>
             <arg value="${sf.common.config.dir}/templates/zip.cfg.xml.ftl.template"/>
             <arg value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
             <arg value="${build.log.dir}/rnd_excludefile.txt"/>
+            <arg value="${sf-preprocess-package-config.arg}"/>
         </exec>
     </target>
     
@@ -774,7 +786,12 @@
           <runtarget target="sf-run-analysis-yarp"/>
           <runtarget target="sf-run-analysis-whatlog-summary"/>
         </parallel>
-        <runtarget target="sf-run-analysis-diamonds"/>
+        <if>
+          <istrue value="${sf.spec.publish.enable}"/>
+            <then>
+            <runtarget target="sf-run-analysis-diamonds"/>
+            </then>
+        </if>    
     </target>
 
     <target name="sf-run-analysis-ant">    
@@ -1078,6 +1095,6 @@
             <zipfileset dir="${build.drive}/output/md5/" prefix="epoc32/relinfo"/>
         </zip>
         <move file="${temp.md5.zip}" todir="${build.log.dir}" failonerror="false"/>
-    </target>
+    </target>    
 </project>
 
--- a/common/tools/populateziptemplate.pl	Wed Aug 12 10:24:42 2009 +0100
+++ b/common/tools/populateziptemplate.pl	Wed Aug 12 10:30:24 2009 +0100
@@ -26,7 +26,11 @@
 my $template = shift or die "Second arg must be template file";
 my $ftl = shift or die "Third arg must be output file";
 my $rndExcludes = shift or die "Fourth arg must be rnd-excludes file";
-shift and die "No more than four arguments please";
+my $nosource = shift;
+if(defined $nosource && $nosource !~ m/--nosource/i)
+{
+  die "fifth argument can only be \'--nosource\'";
+}
 
 # Load CSV
 open my $csvText, "<", $sourcesCSV or die;
@@ -73,21 +77,24 @@
 	warn "Warning: Package $package->{dst} does not appear on the local system\n" unless -d $package->{dst};
 	$package->{dst} =~ s{^/}{}g;
 	if ($package->{source} =~ m{/(sfl|oss)/(MCL|FCL)/sf/([^/]+)/([^/]+)})
-	{	    
-		push @{$zipConfig->{config}->{config}->{src}->{config}->{$1}->{config}},
-		{
-			set =>
-			[
-				{
-					name => "name",
-					value=> "src_$1_$3_$4",
-				},
-				{
-					name => "include",
-					value => "$package->{dst}/**",
-				},
-			]
-		};
+	{
+		if(!defined $nosource)
+  	{
+  		push @{$zipConfig->{config}->{config}->{src}->{config}->{$1}->{config}},
+  		{
+  			set =>
+  			[
+  				{
+  					name => "name",
+  					value=> "src_$1_$3_$4",
+  				},
+  				{
+  					name => "include",
+  					value => "$package->{dst}/**",
+  				},
+  			]
+  		};
+  	}	
 	}
 	elsif ($package->{source} =~ m{/rnd/([^/]+)/([^/]+)})
 	{