Added disk space check for all builds.
authorSimon Howkins <simonh@symbian.org>
Wed, 19 Aug 2009 14:19:16 +0100
changeset 367 bed8f6bc974b
parent 366 cde2244c8ea6
child 369 13fa826ea048
Added disk space check for all builds. Made the platform build configurable via props and refs in the same way that the package build is.
common/build.xml
common/common_props.ant.xml
sf-package/package_props.ant.xml
sf-platform/build.xml
sf-platform/platform_props.ant.xml
sf-platform/platform_refs.ant.xml
--- a/common/build.xml	Wed Aug 19 11:53:12 2009 +0100
+++ b/common/build.xml	Wed Aug 19 14:19:16 2009 +0100
@@ -57,20 +57,32 @@
             <import file="${sf.common.config.dir}/generated/source-spec.ant.xml"/>
         </then>
     </if>
-     
     
     <target name="sf-prep" depends="prep-drive,init-build-area,sf-generate-source-spec,check-tool-dependencies,create-bom,log-build-env">
         <echo>[SF-PREP]</echo>
+        <!-- Test for the disk space we would like for this build -->
+	<fail>
+            <condition>
+                <not>
+                    <or>
+                        <isset property="sf.suppress.drive.space.check"/>
+                        <hasfreespace partition="${build.drive}" needed="${sf.drive.space.needed}"/>
+                    </or>
+                </not>
+            </condition>
+Insufficient space to run this build to completion. (Was looking for ${sf.drive.space.needed}.) To suppress this check, set the property sf.suppress.drive.space.check to any value.
+        </fail>
+
         <tempfile property="prep.dynamic.config" suffix="ant.xml" destdir="${temp.build.dir}"/>
-		<echo message="Checking build Environment"/>
-          <exec executable="perl" dir="${sf.common.config.dir}/tools" failonerror="true">
+        <echo message="Checking build Environment"/>
+        <exec executable="perl" dir="${sf.common.config.dir}/tools" failonerror="true">
             <arg value="CheckBuildEnv.pl"/>
             <arg value="--xml=BuildEnv.xml"/>
             <arg value="--dbg=${build.log.dir}/BuildEnvironmentCheck.log"/>
-			<arg value="--sbs='${sf.spec.sbs.config}'"/>
-			<arg value="--tools='${sf.spec.sbs.tools.config}'"/>
-			<arg value="Common"/>
-          </exec>
+            <arg value="--sbs='${sf.spec.sbs.config}'"/>
+            <arg value="--tools='${sf.spec.sbs.tools.config}'"/>
+            <arg value="Common"/>
+        </exec>
     </target>
         
     <target name="sf-build-all" depends="sf-prebuild,sf-build-noprep,sf-postbuild">
--- a/common/common_props.ant.xml	Wed Aug 19 11:53:12 2009 +0100
+++ b/common/common_props.ant.xml	Wed Aug 19 14:19:16 2009 +0100
@@ -2,6 +2,8 @@
 
 <project name="SF-COMMON-PROPS" >
 
+    <property name="sf.drive.space.needed" value="0"/>
+
     <property name="sf.project.type" value="package"/>
 	
     <property name="sf.spec.job.name" value="myproduct"/>
@@ -13,7 +15,6 @@
     <property name="sf.spec.email.from" value="fbf@symbian.org"/> <!-- needs to be defined for S60 platform builds -->
     
     <property name="sf.spec.systemdefinition.assemble" value="true"/>
-    <!-- property name="sf.spec.systemdefinition.file" value=""/ -->
 
     <property name="sf.spec.pdt.root" value="${env.PDT_HOME}"/> <!-- e.g. C:\Symbian\Tools\PDT_1.0\ -->
 
@@ -24,8 +25,6 @@
     <property name="sf.spec.build.productioncode.enable" value="true"/>
     <property name="sf.spec.build.testcode.enable" value="false"/>
     <property name="sf.spec.build.system" value="sbs"/> <!-- sbs|ebs|ec -->
-    <!-- property name="sf.spec.build.sbsv2.config" value=""/ -->
-    <!-- property name="sf.spec.build.sbsv2.options" value="-k"/ -->
     <property name="sf.spec.build.clean.enable" value="false"/>
     <property name="sf.spec.sysdef.configurations.list" value="s60_build,s60_bldmelast"/>
     
--- a/sf-package/package_props.ant.xml	Wed Aug 19 11:53:12 2009 +0100
+++ b/sf-package/package_props.ant.xml	Wed Aug 19 14:19:16 2009 +0100
@@ -2,6 +2,8 @@
 
 <project name="SF-PACKAGE-PROPS">
   
+  <property name="sf.drive.space.needed" value="10G"/>
+
   <property name="sf.spec.baseline.enable" value="true"/>
   <property name="sf.spec.baseline.select" value="location"/>
   <property name="sf.spec.baseline.location" value="\\bishare\Releases\PDK_candidate_2.0.d_flat"/>
--- a/sf-platform/build.xml	Wed Aug 19 11:53:12 2009 +0100
+++ b/sf-platform/build.xml	Wed Aug 19 14:19:16 2009 +0100
@@ -3,6 +3,15 @@
   <!-- location of this config -->
   <dirname property="sf.platform.config.dir" file="${ant.file.SF-PLATFORM-CONFIG}"/>
 
+  <!-- import package properties -->
+  <import file="${sf.platform.config.dir}/platform_props.ant.xml" optional="true"/>
+  
+  <!-- import common properties/targets/references -->
+  <import file="../common/build.xml" />
+  
+  <!-- import package references -->
+  <import file="${sf.platform.config.dir}/platform_refs.ant.xml"  optional="true"/>
+  
   <!--
   * Property defaults
    -->
@@ -448,8 +457,5 @@
 		
 	</target>
 
-  <!-- import sf-common-config -->
-  <import file="../common/build.xml" />
-
 </project>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sf-platform/platform_props.ant.xml	Wed Aug 19 14:19:16 2009 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<project name="SF-PLATFORM-PROPS">
+  
+  <property name="sf.drive.space.needed" value="150G"/>
+
+</project>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sf-platform/platform_refs.ant.xml	Wed Aug 19 14:19:16 2009 +0100
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+
+<project name="SF-PLATFORM-REFS">
+
+</project>