Bug 3750: Use .7z extension for PDK zip files created with LZMA compression
authorSimon Howkins <simonh@symbian.org>
Thu, 30 Sep 2010 17:39:10 +0100
changeset 1273 92bfe0d10c29
parent 1272 c4b5a5c928c2
child 1274 b5003eee1583
Bug 3750: Use .7z extension for PDK zip files created with LZMA compression Post-process the zip files and release_metadata to adjust the extension
common/build.postbuild.xml
common/build.xml
common/templates/zip.cfg.xml.ftl.template
--- a/common/build.postbuild.xml	Thu Sep 30 12:35:20 2010 +0100
+++ b/common/build.postbuild.xml	Thu Sep 30 17:39:10 2010 +0100
@@ -351,7 +351,7 @@
                     <arg value="-x!epoc32\release\armv5"/>
                     <arg value="-x!epoc32\release\winscw"/>
                     <arg value="-xr!*.sym"/>
-                    <arg value="${build.drive}/output/zips/release/binaries_epoc.zip"/>
+                    <arg value="${build.drive}/output/zips/release/binaries_epoc.${sf.spec.package.zip.format}.zip"/>
                     <arg value="epoc32\"/>
                 </exec>
             </sequential>
@@ -367,7 +367,7 @@
                         <arg value="-x@output/temp_build_files/manifest_excludelist.txt"/>
                         <arg value="-x@${sf.spec.prebuilt.excludelist}"/>
                         <arg value="-x!epoc32/include/featureuids.h"/> <!-- This needs to come from the tools zip instead -->
-                        <arg value="${build.drive}/output/zips/release/binaries_epoc_sdk.zip"/>
+                        <arg value="${build.drive}/output/zips/release/binaries_epoc_sdk.${sf.spec.package.zip.format}.zip"/>
                     </exec>
                     <!-- Check that all the files we want in the SDK are zipped -->
                     <antcall target="sf-log-to-brag">
@@ -393,7 +393,7 @@
                 <arg value="-x@${sf.spec.prebuilt.excludelist}"/>
                 <arg value="-xr!*.sym"/>
                 <arg value="-xr!*.lib"/>
-                <arg value="${build.drive}/output/zips/release/binaries_winscw_udeb.zip"/>
+                <arg value="${build.drive}/output/zips/release/binaries_winscw_udeb.${sf.spec.package.zip.format}.zip"/>
                 <arg value="epoc32\release\winscw\udeb"/>
             </exec>
             <exec executable="7za" dir="${build.drive}/" output="${build.log.dir}/zip_${build.id}_binaries_winscw_urel.log">
@@ -404,7 +404,7 @@
                 <arg value="-x@${sf.spec.prebuilt.excludelist}"/>
                 <arg value="-xr!*.sym"/>
                 <arg value="-xr!*.lib"/>
-                <arg value="${build.drive}/output/zips/release/binaries_winscw_urel.zip"/>
+                <arg value="${build.drive}/output/zips/release/binaries_winscw_urel.${sf.spec.package.zip.format}.zip"/>
                 <arg value="epoc32\release\winscw\urel"/>
             </exec>
             <exec executable="7za" dir="${build.drive}/" output="${build.log.dir}/zip_${build.id}_binaries_winscw_lib.log">
@@ -414,7 +414,7 @@
                 <arg value="-x@${build.log.dir}/rnd_excludefile.txt"/>
                 <arg value="-x@output/temp_build_files/manifest_excludelist.txt"/>
                 <arg value="-x@${sf.spec.prebuilt.excludelist}"/>
-                <arg value="${build.drive}/output/zips/release/binaries_winscw_lib.zip"/>
+                <arg value="${build.drive}/output/zips/release/binaries_winscw_lib.${sf.spec.package.zip.format}.zip"/>
             </exec>
             
             <!-- ARMv5 binaries, by udeb/urel/lib -->
@@ -425,7 +425,7 @@
                 <arg value="-x@output/temp_build_files/manifest_excludelist.txt"/>
                 <arg value="-x@${sf.spec.prebuilt.excludelist}"/>
                 <arg value="-xr!*.sym"/>
-                <arg value="${build.drive}/output/zips/release/binaries_armv5_udeb.zip"/>
+                <arg value="${build.drive}/output/zips/release/binaries_armv5_udeb.${sf.spec.package.zip.format}.zip"/>
                 <arg value="epoc32\release\armv5\udeb"/>
             </exec>
             <exec executable="7za" dir="${build.drive}/" output="${build.log.dir}/zip_${build.id}_binaries_armv5_urel.log">
@@ -435,7 +435,7 @@
                 <arg value="-x@output/temp_build_files/manifest_excludelist.txt"/>
                 <arg value="-x@${sf.spec.prebuilt.excludelist}"/>
                 <arg value="-xr!*.sym"/>
-                <arg value="${build.drive}/output/zips/release/binaries_armv5_urel.zip"/>
+                <arg value="${build.drive}/output/zips/release/binaries_armv5_urel.${sf.spec.package.zip.format}.zip"/>
                 <arg value="epoc32\release\armv5\urel"/>
             </exec>
             <exec executable="7za" dir="${build.drive}/" output="${build.log.dir}/zip_${build.id}_binaries_armv5_lib.log">
@@ -446,7 +446,7 @@
                 <arg value="-x@${sf.spec.prebuilt.excludelist}"/>
                 <arg value="-xr!*.sym"/>
                 <arg value="-ir!epoc32/release/armv5/_*.bin"/> <!-- include bootloaders in common lib zipfile -->
-                <arg value="${build.drive}/output/zips/release/binaries_armv5_lib.zip"/>
+                <arg value="${build.drive}/output/zips/release/binaries_armv5_lib.${sf.spec.package.zip.format}.zip"/>
                 <arg value="epoc32\release\armv5\lib"/>
             </exec>
         </parallel>
@@ -475,7 +475,7 @@
             <arg value="-x@${build.log.dir}/rnd_excludefile.txt"/>
             <arg value="-x@/output/temp_build_files/manifest_excludelist.txt"/>
             <arg value="-x@${sf.spec.prebuilt.excludelist}"/>
-            <arg value="${build.drive}/output/zips/release/tools_epoc.zip"/>
+            <arg value="${build.drive}/output/zips/release/tools_epoc.${sf.spec.package.zip.format}.zip"/>
             <arg value="epoc32/tools"/>
             <arg value="epoc32/gcc"/>
             <arg value="epoc32/gcc_mingw"/>
@@ -536,7 +536,7 @@
             <arg value="a"/>
             <arg value="-t${sf.spec.package.zip.format}"/>
             <arg value="-i@${manifest.fullname}"/>
-            <arg value="${build.drive}/output/zips/release/${manifest.shortname}.zip"/> 
+            <arg value="${build.drive}/output/zips/release/${manifest.shortname}.${sf.spec.package.zip.format}.zip"/> 
         </exec>
 
         <!-- merge release metadata -->
--- a/common/build.xml	Thu Sep 30 12:35:20 2010 +0100
+++ b/common/build.xml	Thu Sep 30 17:39:10 2010 +0100
@@ -778,13 +778,24 @@
             <property name="zip.${zip.target.name}.log.file" location="${build.log.dir}/${build.id}_${zip.target.name}_zip.log" />
             <property name="zips.${zip.target.name}.spec.name" value="${zip.target.name}" />
             <if><isset property="sf.using.newer.than.helium5"/>
-            <then>
+              <then>
                 <hlm:zipContentMacro type="${zip.target.name}" file="${zip.config.file}" failonemptyconfig="false"/>
-            </then>
-            <else>
+              </then>
+              <else>
                 <hlm:zipContentMacro type="${zip.target.name}" file="${zip.config.file}" />
-            </else>
+              </else>
             </if>
+
+            <!-- Now patch up zip filenames and to avoid double extensions -->
+            <move verbose="true" todir="${build.drive}/output/zips/">
+              <fileset dir="${build.drive}/output/zips/" includes="**/*.zip"/>
+              <mapper type="regexp" from="^(.+?\.(7z|zip))\.zip$" to="\1"/>
+            </move>
+
+            <!-- And patch up the release metadata to match -->
+            <replaceregexp match="\.(7z|zip)\.zip" replace=".\1">
+              <fileset dir="${build.drive}/output/zips/" includes="**/release_metadata.xml"/>
+            </replaceregexp>
           </then>
           <else>
             <echo message="ERROR ${zip.config.file} not available for zipping!"/>
@@ -823,7 +834,7 @@
     <!-- Unpack the rnd zips ready to be used in the build -->
     <target name="sf-unpack-rnd">
         <echo message="INFO Unpacking any available RnD binaries"/>
-		<mkdir dir="${build.drive}/output/zips/"/>
+        <mkdir dir="${build.drive}/output/zips/"/>
         <for param="rndZip">
             <fileset dir="${build.drive}/output/zips/">
                 <include name="binaries_*.zip"/> <!-- Internal rnd bins -->
--- a/common/templates/zip.cfg.xml.ftl.template	Thu Sep 30 12:35:20 2010 +0100
+++ b/common/templates/zip.cfg.xml.ftl.template	Thu Sep 30 17:39:10 2010 +0100
@@ -72,7 +72,7 @@
 		</config>
 		<!-- "Null" tools entry, which matches no files, but does populate the release_metadata.xml -->
 		<config name="tools">
-			<set name="name" value="tools_epoc"/>
+			<set name="name" value="tools_epoc.${sf.spec.package.zip.format}"/>
 			<set name="archives.dir" value="${build.output.dir}/zips/release" />
 			<set name="grace.filters" value="tools"/>
 			<set name="include" value="*"/>
@@ -85,25 +85,25 @@
 			<set name="include" value="*"/>
 			<set name="exclude" value="**"/>
 			<config name="core">
-				<set name="name" value="binaries_epoc"/>
+				<set name="name" value="binaries_epoc.${sf.spec.package.zip.format}"/>
 			</config>
 			<config name="armv5_udeb">
-				<set name="name" value="binaries_armv5_udeb"/>
+				<set name="name" value="binaries_armv5_udeb.${sf.spec.package.zip.format}"/>
 			</config>
 			<config name="armv5_urel">
-				<set name="name" value="binaries_armv5_urel"/>
+				<set name="name" value="binaries_armv5_urel.${sf.spec.package.zip.format}"/>
 			</config>
 			<config name="armv5_lib">
-				<set name="name" value="binaries_armv5_lib"/>
+				<set name="name" value="binaries_armv5_lib.${sf.spec.package.zip.format}"/>
 			</config>
 			<config name="winscw_udeb">
-				<set name="name" value="binaries_winscw_udeb"/>
+				<set name="name" value="binaries_winscw_udeb.${sf.spec.package.zip.format}"/>
 			</config>
 			<config name="winscw_urel">
-				<set name="name" value="binaries_winscw_urel"/>
+				<set name="name" value="binaries_winscw_urel.${sf.spec.package.zip.format}"/>
 			</config>
 			<config name="winscw_lib">
-				<set name="name" value="binaries_winscw_lib"/>
+				<set name="name" value="binaries_winscw_lib.${sf.spec.package.zip.format}"/>
 			</config>
 
 		</config>
@@ -114,7 +114,7 @@
 			<set name="include" value="*"/>
 			<set name="exclude" value="**"/>
 			<config name="sdk">
-				<set name="name" value="binaries_epoc_sdk"/>
+				<set name="name" value="binaries_epoc_sdk.${sf.spec.package.zip.format}"/>
 			</config>
 		</config>
 
@@ -125,7 +125,7 @@
 			<set name="include" value="*"/>
 			<set name="exclude" value="**"/>
 			<config name="${sf.spec.job.name}">
-				<set name="name" value="binaries_${sf.spec.job.name}"/>
+				<set name="name" value="binaries_${sf.spec.job.name}.${sf.spec.package.zip.format}"/>
 			</config>
 		</config>