Add postbuild RnD packaging. Add .whatlog to os tools build.
authorShabe Razvi <shaber@symbian.org>
Wed, 27 May 2009 14:11:37 +0100
changeset 111 5b0bc2f89660
parent 110 6c981bc63bab
child 112 3fc223926c4a
Add postbuild RnD packaging. Add .whatlog to os tools build.
common/build.xml
common/tools/populateziptemplate.pl
sf-platform/build.xml
--- a/common/build.xml	Tue May 26 17:02:52 2009 +0100
+++ b/common/build.xml	Wed May 27 14:11:37 2009 +0100
@@ -145,7 +145,6 @@
             <istrue value="${sf.spec.sourcesync.enable}" />
             <then>
                 <runtarget target="sf-get-source"/>
-                <runtarget target="sf-merge-epoc32"/>
                 
                 <if><istrue value="${sf.spec.package.src.enable}"/>
                 <then>
@@ -153,6 +152,8 @@
                     <runtarget target="sf-package-source"/>
                 </then>
                 </if>
+                
+                <runtarget target="sf-unpack-rnd"/>
             </then>
             <else>
                 <!-- record fact that no sources.csv used. required by diamondize-bom  -->
@@ -364,29 +365,25 @@
         </antcall>
     </target>
     
-    <target name="sf-package-binary" depends="sf-preprocess-package-config">
+    <target name="sf-package-binary" depends="sf-preprocess-package-config,sf-package-postbuild-rnd">
         <!--antcall target="sf-zip-content">
             <param name="zip.config.file" value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
             <param name="zip.target.name" value="bin" />
         </antcall-->
 
-        <if><available file="${build.drive}/rnd/internal/initial" type="dir" />
+        <if><available file="${build.drive}/rnd_excludefile.txt" />
         <then>
-            <!-- get listing of rnd location for exclude later -->
-            <antcall target="sf-list-dir" inheritAll="false">
-                <param name="sf.list.name" value="rnd_binaries"/>
-                <param name="sf.dir.location" value="${build.drive}/rnd/internal/initial"/>
-            </antcall>
             <echo message="Packaging with exclude list"/>
             <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_binaries_epoc32.log">
             <arg value="a"/>
             <arg value="-tzip"/>
-            <arg value="-x@${build.log.dir}/listdir_${build.id}_rnd_binaries.log"/> <!-- excludes -->
+            <arg value="-x@${build.drive}/rnd_excludefile.txt"/> <!-- excludes -->
             <arg value="-x!epoc32\build"/> 
             <arg value="-xr!*.sym"/> 
             <arg value="binaries_epoc.zip"/> 
             <arg value="epoc32\"/>
             </exec>
+            <move file="${build.drive}/rnd_excludefile.txt" todir="${build.log.dir}/"/>
         </then>
         <else>
             <echo message="Packaging without exclude list"/>
@@ -404,8 +401,25 @@
         <then><move file="${build.drive}/binaries_epoc.zip" todir="${build.drive}/output/zips/"/></then>
         </if>
     </target>
+
+    <target name="sf-package-postbuild-rnd" depends="sf-preprocess-package-config">
+
+        <!-- zip any RnD _includefile.txt files generated during source packaging -->
+        <exec executable="perl" dir="${build.drive}/" failonerror="false" output="${build.log.dir}/zip_postbuild.log">
+            <arg value="${sf.common.config.dir}/tools/zip_includefiles.pl"/>
+        </exec>
+        <!-- cleanup my moving includefiles to logs and zips to zips\postbuild -->
+        <move todir="${build.log.dir}">
+           <fileset dir="${build.drive}"><include name="*_includefile.txt"/></fileset>
+        </move>
+        <move todir="${build.drive}/output/zips/postbuild">
+           <fileset dir="${build.drive}"><include name="bin_rnd_*.zip"/></fileset>
+        </move>
+        <!-- TODO: merge with release_metadata.xml ? -->
+    </target>
+
     <!-- unpack rnd zips if available -->
-    <target name="sf-merge-epoc32">
+    <target name="sf-unpack-rnd">
         <echo message="Unpacking any available RnD binaries"/>
         <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/unzip_${build.id}_binaries_rnd.log">
         <arg value="x"/>
--- a/common/tools/populateziptemplate.pl	Tue May 26 17:02:52 2009 +0100
+++ b/common/tools/populateziptemplate.pl	Wed May 27 14:11:37 2009 +0100
@@ -118,12 +118,15 @@
 		next unless @files;
 		# Add the files to this zip object
 		@files = grep {
-			chomp;
 			s{\\}{/}g;
 			s!^[A-Z]:/$package->{dst}/!!i;
 			m{^epoc32/}i;
 		} @files;
 		push @allRndFiles, @files;
+		
+		open FILE, ">", $name ."_includefile.txt" or die "Cannot write includefile!";
+		print FILE @files;
+		close FILE;
 	}
 	else
 	{
@@ -137,3 +140,7 @@
 
 $xml->XMLout($zipConfig, OutputFile => $ftl, XMLDecl => 1, RootName => 'build', KeyAttr => $keyAttr);
 
+# Output all rnd files into exclude list for later
+open FILE, "> rnd_excludefile.txt" or die "Cannot write exludefile!";
+print FILE @allRndFiles;
+close FILE;
\ No newline at end of file
--- a/sf-platform/build.xml	Tue May 26 17:02:52 2009 +0100
+++ b/sf-platform/build.xml	Wed May 27 14:11:37 2009 +0100
@@ -148,26 +148,26 @@
   <target name="sf-os-compile">
 
         <hlm:argSet id="sbs.tools2.var">
-                <hlm:arg name="config" value="tools2_rel" />
+                <hlm:arg name="config" value="tools2_rel.whatlog" />
                 <hlm:arg name="singlejob" value="false" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
         </hlm:argSet>
 
 		<hlm:argSet id="sbs.tools2.clean.var">
-                <hlm:arg name="config" value="tools2_rel" />
+                <hlm:arg name="config" value="tools2_rel.whatlog" />
                 <hlm:arg name="singlejob" value="false" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
 		<hlm:arg name="command" value="CLEAN --check" />
         </hlm:argSet>
 
         <hlm:argSet id="sbs.tools.var">
-                <hlm:arg name="config" value="tools_rel" />
+                <hlm:arg name="config" value="tools_rel.whatlog" />
                 <hlm:arg name="singlejob" value="true" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
         </hlm:argSet>
 
 		<hlm:argSet id="sbs.tools.clean.var">
-                <hlm:arg name="config" value="tools_rel" />
+                <hlm:arg name="config" value="tools_rel.whatlog" />
                 <hlm:arg name="singlejob" value="true" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
 		<hlm:arg name="command" value="CLEAN --check" />