=Merge
authorDario Sestito <darios@symbian.org>
Tue, 18 Aug 2009 15:39:56 +0100
changeset 365 95e054b2bec1
parent 364 4dc3b5b1577c (current diff)
parent 363 8af7138cf3c0 (diff)
child 366 cde2244c8ea6
child 368 cb0ec85c881d
=Merge
common/build.postbuild.xml
common/build.xml
common/tools/ats/devices/lon-engbuild87/EMULATOR_GENERIC_LONENGBUILD87.properties
common/tools/ats/devices/lon-engbuild89/EMULATOR_GENERIC_LONENGBUILD89.properties
common/tools/ats/devices/sym-build02/EMULATOR_GENERIC_SYMBUILD02.properties
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/build.postbuild.xml	Tue Aug 18 15:39:56 2009 +0100
@@ -0,0 +1,641 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="SF-POSTBUILD" xmlns:hlm="http://www.nokia.com/helium">
+    <target name="sf-postbuild">
+        <echo>[SF-POSTBUILD]</echo>
+        <parallel>                
+        <!-- TAG SOURCE CODE -->
+        <if>
+            <istrue value="${sf.spec.tagafterbuild.enable}" />
+            <then>
+                <echo message="Apply tag to the source code used in this build"/>
+                <runtarget target="sf-tag-hg-code"/>
+            </then>
+        </if>
+        
+        <if>
+            <istrue value="${sf.spec.md5.enable}"/>
+            <then>
+                <echo message="INFO Creating MD5s"/>
+                <runtarget target="sf-run-evalid"/>
+            </then>
+        </if>
+        <if>
+            <istrue value="${sf.spec.package.bin.enable}"/>
+            <then>
+                <echo message="INFO Packaging Binaries"/>
+                <runtarget target="sf-package-binary"/>
+                <runtarget target="sf-package-tools"/>
+
+                <echo message="INFO Validate Zip files"/>
+                <runtarget target="sf-package-validate"/>
+            </then>
+        </if>
+        <!-- run build analysis tools -->
+        <runtarget target="sf-run-analysis"/>
+        
+        </parallel>
+        
+        <if><istrue value="${sf.spec.test.sendpkg.enable}"/>
+            <then>
+                <runtarget target="sf-build-smoketestpkg"/>
+                <runtarget target="sf-send-testpkg"/>
+            </then>
+        </if>
+
+
+        <runtarget target="sf-zip-logs"/>
+
+        <!-- Do BC check -->
+        <if><istrue value="${sf.spec.bccheck.enable}"/>
+            <then>
+                <runtarget target="sf-bc-check"/>
+            </then>
+        </if>
+
+        <!-- PUBLISH LOGS/REPORTS -->
+        <if>
+            <istrue value="${sf.spec.publish.enable}" />
+            <then>
+                <echo message="Publish log files and reports to ${sf.spec.publish.rootdir}"/>
+                <runtarget target="sf-publish"/>
+            </then>
+        </if>
+    </target>
+
+    <target name="sf-tag-hg-code">
+        <property name="sf.tagafterbuild.tag" value="${sf.spec.job.name}_${sf.spec.job.codeline}.${sf.spec.job.number}"/>
+        <fmpp sourceFile="${sf.common.config.dir}/templates/tag-hg-code.ant.xml.ftl"
+              outputFile="${sf.common.config.dir}/generated/tag-hg-code.ant.xml">
+            <data expandProperties="yes">
+                ant: antProperties()
+                data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
+            </data>
+        </fmpp>
+        <ant antfile="${sf.common.config.dir}/generated/tag-hg-code.ant.xml"/>
+    </target>
+
+    <target name="sf-run-evalid">
+        <delete dir="${build.drive}/output/md5"/>
+        <mkdir  dir="${build.drive}/output/md5"/>
+
+        <parallel>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/include output/md5/epoc32_include.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/s60 output/md5/epoc32_s60.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/localisation output/md5/epoc32_localisation.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -x \.sym$ -x ^armv5/udeb -x ^armv5/urel -x ^winscw/udeb -x ^winscw/urel -g epoc32/release output/md5/epoc32_release.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -x \.sym$ -g epoc32/release/armv5/udeb output/md5/epoc32_release_armv5_udeb.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -x \.sym$ -g epoc32/release/armv5/urel output/md5/epoc32_release_armv5_urel.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -x \.sym$ -g epoc32/release/winscw/udeb output/md5/epoc32_release_winscw_udeb.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -x \.sym$ -g epoc32/release/winscw/urel output/md5/epoc32_release_winscw_urel.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/cshlpcmp_template 	output/md5/epoc32_cshlpcmp_template.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/data output/md5/epoc32_data.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/engdoc output/md5/epoc32_engdoc.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/engineeringtools output/md5/epoc32_engineeringtools.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/gcc output/md5/epoc32_gcc.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/gcc_mingw output/md5/epoc32_gcc_mingw.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/ksa output/md5/epoc32_ksa.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/rom output/md5/epoc32_rom.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/rombuild output/md5/epoc32_rombuild.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/sbs_config output/md5/epoc32_sbs_config.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/sdk_special output/md5/epoc32_sdk_special.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/stdapis output/md5/epoc32_stdapis.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/stubs output/md5/epoc32_stubs.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/tools output/md5/epoc32_tools.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/wins output/md5/epoc32_wins.md5"/>
+        </exec>
+        <exec executable="cmd" dir="${build.drive}">
+            <arg value="/c"/>
+            <arg value="evalid -g epoc32/winscw output/md5/epoc32_winscw.md5"/>
+        </exec>
+        </parallel>
+        
+        <!-- package MD5s directly into epoc32/relinfo location so that its usable out-of-the-box -->
+        <property name="temp.md5.zip" value="${env.TEMP}/MD5_${sf.spec.job.name}_${build.number}.zip"/>
+        <echo message="INFO Packaging MD5s"/>
+        <zip destfile="${temp.md5.zip}">
+            <zipfileset dir="${build.drive}/output/md5/" prefix="epoc32/relinfo"/>
+        </zip>
+        <move file="${temp.md5.zip}" todir="${build.log.dir}" failonerror="false"/>
+    </target>    
+    
+    <target name="sf-package-binary" depends="sf-preprocess-package-config,sf-package-postbuild-rnd">
+        <!-- Warning: Reverting to using the He zipper will also revert to a single zip for the binaries:
+             would need to update the template and possibly the script that populates it -->
+        <!--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-->
+        <parallel>
+            <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}/rnd_excludefile.txt"/>
+                <arg value="-x!epoc32\tools"/>
+                <arg value="-x!epoc32\build"/>
+                <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="epoc32\"/>
+            </exec>
+            
+            <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_binaries_winscw.log">
+                <arg value="a"/>
+                <arg value="-tzip"/>
+                <arg value="-x@${build.log.dir}/rnd_excludefile.txt"/>
+                <arg value="-xr!*.sym"/>
+                <arg value="${build.drive}/output/zips/release/binaries_winscw.zip"/>
+                <arg value="epoc32\release\winscw\"/>
+            </exec>
+            
+            <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_binaries_armv5.log">
+                <arg value="a"/>
+                <arg value="-tzip"/>
+                <arg value="-x@${build.log.dir}/rnd_excludefile.txt"/>
+                <arg value="-xr!*.sym"/>
+                <arg value="${build.drive}/output/zips/release/binaries_armv5.zip"/>
+                <arg value="epoc32\release\armv5\"/>
+            </exec>
+        </parallel>
+    </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\release -->
+        <move todir="${build.log.dir}">
+            <fileset dir="${build.drive}"><include name="*_includefile.txt"/></fileset>
+        </move>
+        <move todir="${build.drive}/output/zips/release">
+            <fileset dir="${build.drive}"><include name="bin*.zip"/></fileset>
+        </move>
+        <!-- TODO: merge with release_metadata.xml ? -->
+    </target>
+
+    <target name="sf-package-tools" depends="sf-preprocess-package-config">
+        <echo message="Packaging epoc32 tools - Temporary method"/>
+        <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_tools_epoc32.log">
+            <arg value="a"/>
+            <arg value="-tzip"/>
+            <arg value="-x@${build.log.dir}/rnd_excludefile.txt"/>
+<!--            <arg value="-x@${build.log.dir}/*_includefile.txt"/> -->
+            <arg value="${build.drive}/output/zips/release/tools_epoc.zip"/> 
+            <arg value="epoc32/tools"/>
+        </exec>
+    </target>
+    
+    <target name="sf-package-validate">
+        <exec executable="7z" dir="${build.drive}/output/zips" failonerror="false" output="${build.drive}/output/zips/validate.log">
+            <arg value="t"/>
+            <arg value="*.zip"/>
+        </exec>  
+        <exec executable="7z" dir="${build.drive}/output/zips/release" failonerror="false" output="${build.drive}/output/zips/release/validate.log">
+            <arg value="t"/>
+            <arg value="*.zip"/>
+        </exec>  
+    </target>
+
+    <!-- runs analysis of missing bins and source -->
+    <target name="sf-run-analysis">
+        <mkdir dir="${build.log.dir}/analysis"/>
+        <parallel>
+          <runtarget target="sf-run-analysis-ant"/>
+          <runtarget target="sf-run-analysis-raptor"/>
+          <runtarget target="sf-run-analysis-yarp"/>
+          <runtarget target="sf-run-analysis-whatlog-summary"/>
+        </parallel>
+        <if>
+          <istrue value="${sf.spec.publish.enable}"/>
+            <then>
+            <runtarget target="sf-run-analysis-diamonds"/>
+            </then>
+        </if>    
+    </target>
+
+    <target name="sf-run-analysis-ant">    
+        <echo message="Running source analysis of ANT output"/>
+        <exec executable="perl" dir="${build.log.dir}" failonerror="false" output="${build.log.dir}/analysis/${build.id}_scan_ant.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/scan_antlogs.pl"/>
+            <arg value="*ant*"/>
+        </exec>
+    </target>
+
+    <target name="sf-run-analysis-raptor">            
+      <echo message="Preprocessing *_compile.log files"/>
+      <for param="logfile">
+        <path>
+          <fileset dir="${build.log.dir}">
+            <include name="*_compile.log"/>
+            <exclude name="*build_check_compile.log"/>
+          </fileset>
+        </path>
+        <sequential>
+          <propertyregex override="yes" property="preprocessedlogfile" input="@{logfile}" regexp=".*[\\|\/].*\.T?\d+_+(.*)_compile\.log" replace="\1_compile_preprocessed.log"/>
+	        <echo message="Preprocessing @{logfile}..."/>
+          <exec executable="perl" dir="${sf.common.config.dir}/tools/raptor" failonerror="false" input="@{logfile}" output="${build.log.dir}/analysis/${preprocessedlogfile}" error="${build.log.dir}/analysis/${build.id}_preprocess.log" append="true">
+            <arg value="${sf.common.config.dir}/tools/raptor/preprocess_log.pl"/>
+          </exec>
+        </sequential>
+      </for>
+      
+      <echo message="Extracting whatlog information from *whatlog*_compile_preprocessed.log files"/>
+      <for param="whatlogfile">
+        <path>
+          <fileset dir="${build.log.dir}/analysis">
+            <include name="*whatlog*_compile_preprocessed.log"/>
+          </fileset>
+        </path>
+        <sequential>
+          <echo message="Extracting whatlog info from @{whatlogfile}..."/>
+          <exec executable="perl" dir="${sf.common.config.dir}/tools/raptor" failonerror="false" output="${build.log.dir}/analysis/${build.id}_whatlog.log" append="true">
+            <arg value="${sf.common.config.dir}/tools/raptor/parse.pl"/>
+            <arg value="--releaseable"/>
+            <arg value="--log=@{whatlogfile}"/>
+            <arg value="--basedir=${build.log.dir}"/>
+            <arg value="--append"/>
+          </exec>
+        </sequential>
+      </for>
+      
+      <echo message="Extracting error information from *_compile_preprocessed.log files"/>
+      <for param="raptorlogfile">
+        <path>
+          <fileset dir="${build.log.dir}/analysis">
+            <include name="*_compile_preprocessed.log"/>
+          </fileset>
+        </path>
+        <sequential>
+          <echo message="Extracting error info from @{raptorlogfile}..."/>
+          <exec executable="perl" dir="${sf.common.config.dir}/tools/raptor" failonerror="false" output="${build.log.dir}/analysis/${build.id}_raptorparse.log" append="true">
+            <arg value="${sf.common.config.dir}/tools/raptor/parse.pl"/>
+            <arg value="--error"/>
+            <arg value="--warning"/>
+            <arg value="--log=@{raptorlogfile}"/>
+            <arg value="--basedir=${build.log.dir}/raptorbits"/>
+            <arg value="--append"/>
+          </exec>
+        </sequential>
+      </for>
+            <!-- Now iterate through the generated TSVs to sort them and remove duplicates -->
+      <for param="tsv">
+        <path>
+          <fileset dir="${build.log.dir}/releaseables">
+            <include name="**/*.tsv"/>
+          </fileset>
+        </path>
+        <sequential>
+          <exec executable="perl" input="@{tsv}" output="@{tsv}">
+            <arg value="${sf.common.config.dir}/tools/sortUnique.pl"/>
+          </exec>
+        </sequential>
+      </for>
+    </target>
+
+    <target name="sf-run-analysis-yarp">          
+      <echo message="Running yarp over *_compile.log files"/>
+      <for param="logfile">
+        <path>
+          <fileset dir="${build.log.dir}">
+            <include name="*_compile.log"/>
+            <exclude name="*build_check_compile.log"/>
+          </fileset>
+        </path>
+        <sequential>
+          <propertyregex override="yes" property="yarpfile"  input="@{logfile}" regexp=".*[\\|\/](.*)_compile\.log" replace="\1_yarp.csv"/>
+          <propertyregex override="yes" property="yarpfile_short"  input="${yarpfile}" regexp="[^_]*_[^_]*_[^_]*_(.+)_[^_]*_yarp\.csv" replace="YARP_\1"/>
+          <echo message="Yarping @{logfile}..."/>
+          <exec executable="perl" dir="${build.drive}" failonerror="false" output="${build.log.dir}/analysis/${yarpfile}.log" append="true">
+            <arg value="${sf.common.config.dir}/tools/analysis/yarp.pl"/>
+            <arg value="@{logfile}"/>
+            <arg value="${build.log.dir}/analysis/${yarpfile}"/>
+          </exec>
+          <exec executable="cmd" output="${build.drive}/output/logs/analysis/tmp_yarp_files.csv" append="true">
+            <arg value="/c"/>
+            <arg value="echo"/>
+            <arg value="${yarpfile_short},${sf.spec.publish.networkdrive}\${sf.spec.job.name}\builds\${sf.spec.job.codeline}\${build.id}\logs\analysis\${yarpfile},${build.drive}\output\logs\analysis\${yarpfile}"/>
+          </exec>
+        </sequential>
+      </for>
+      
+      <exec executable="perl" dir="${build.drive}" failonerror="false" outputproperty="sf.job.totalyarperrors">
+        <arg value="${sf.common.config.dir}/tools/analysis/parse_yarp_files.pl"/>
+        <arg value="${build.drive}/output/logs/analysis/tmp_yarp_files.csv"/>
+      </exec>
+      <echo message="Total yarp errors: ${sf.job.totalyarperrors}"/>
+    </target>
+    
+    <target name="sf-run-analysis-whatlog-summary" >
+        <sequential>
+          <parallel>
+            <runtarget target="sf-run-analysis-list"/>
+            <runtarget target="sf-run-analysis-whatlog"/>
+          </parallel>
+          <runtarget target="sf-run-analysis-whatlog-merge" />
+          <parallel>
+            <runtarget target="sf-run-analysis-whatlog-package"/>
+            <runtarget target="sf-run-analysis-whatlog-collisons"/>
+          </parallel>
+        </sequential>
+    </target>
+    
+    <target name="sf-run-analysis-list">    
+        <echo message="Running list analysis"/>
+        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_list_results.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/parselistdirs.pl"/>
+            <arg value="..\"/>
+        </exec>
+    </target>
+
+    <target name="sf-run-analysis-whatlog">    
+        <echo message="Running whatlog analysis"/>
+        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_what_results.csv">
+            <arg value="${sf.common.config.dir}/tools/analysis/parsewhatlog.pl"/>
+            <arg value="..\"/>
+        </exec>
+    </target>
+
+    <target name="sf-run-analysis-whatlog-merge" >        
+        <echo message="Running summary analysis"/>
+        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_summary.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/merge_csv.pl"/>
+            <arg value="${build.id}_what_results.csv"/>
+            <arg value="${build.id}_list_results.log"/>
+            <arg value="${build.drive}/output/zips/release/binaries_epoc_additional.zip"/>
+        </exec>
+    </target>
+    
+    <target name="sf-run-analysis-whatlog-package" >        
+        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_analysecomponents.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/analyse_components.pl"/>
+            <arg value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
+            <arg value="${build.id}_what_results.csv_results.csv"/>
+            <arg value="${sf.project.location}/sysdefs/system_model_os.xml"/>
+        </exec>
+    </target>
+    
+    <target name="sf-run-analysis-whatlog-collisons" >        
+        <echo message="Running collision analysis"/>
+        <exec executable="perl" dir="${build.drive}" failonerror="false" output="${build.log.dir}/analysis/${build.id}_collisions.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/find_collisions.pl"/>
+            <arg value="${build.log.dir}/analysis/${build.id}_what_results.csv"/>
+        </exec>
+    </target>
+
+    <target name="sf-run-analysis-diamonds">      
+      <fmpp sourceFile="${sf.common.config.dir}/diamonds/sf-run-analysis.xml.ftl" outputFile="${build.drive}/output/logs/sf-run-analysis.xml">
+        <data expandProperties="yes">
+          ant: antProperties()
+          raptor_summary: csv(${build.log.dir}/raptorbits/summary.csv,{separator:',',headers:[category,subcategory,severity,component,phase,recipe,file,line]})
+          files: csv(${build.drive}/output/logs/analysis/tmp_yarp_files.csv,{separator:',',headers:[name,path,localpath]})
+        </data>
+      </fmpp>
+    </target>
+
+    <target name="sf-build-smoketestpkg" depends="sf-getenv-tools">
+        <delete dir  ="${build.drive}/smoketest"/>
+        <delete file ="${build.log.dir}/ATS_${build.id}_smoketest.log"/>
+        
+        <echo message="INFO Copy smoketest source to EPOCROOT"/>
+        
+        <copy todir="${build.drive}/smoketest">
+            <fileset dir="${sf.common.config.dir}/tools/ats/smoketest"/>
+        </copy>
+        
+        <echo message="INFO Building smoketest"/>
+        <exec executable="cmd" dir="${build.drive}/smoketest/group" failonerror="false" append="true" output="${build.log.dir}/ATS_${build.id}_smoketest.log">
+            <arg value="/c"/>
+            <arg value="sbs -b bld.inf -c winscw_udeb.test"/>
+        </exec>
+
+        <echo message="INFO Creating smoketest testpackage"/>
+        <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}"/>
+        
+        <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">
+            <arg value="ats_specialise_test_drop.pl"/>
+            <arg value="--test-drop-name=Smoketest-${build.id}"/> 
+            <arg value="--device-name=GENERIC EMULATOR on ${env.COMPUTERNAME}"/>
+            <arg value="--src=${sf.spec.test.package.location}\smoketest.zip"/>
+            <arg value="--dest=${sf.spec.test.package.location}\${sf.spec.test.package.name}"/>	
+            <arg value="--build-id=http://${sf.spec.publish.diamonds.server}${diamonds.build.id}"/>			
+        </exec>
+        <!-- Now ready to send to ATS3 -->
+    </target>   
+
+    <target name="sf-send-testpkg" depends="sf-find-ATS-worker-root,sf-make-junction">
+        <mkdir dir="${sf.spec.test.workerroot}/${sf.spec.test.package.droppath}"/>
+        <echo message="Sending test package ${sf.spec.test.package.name} to ${sf.spec.test.host.name} path ${sf.spec.test.host.droppath}"/>
+        <exec executable="perl" dir="${sf.common.config.dir}/tools/ats" failonerror="false" output="${build.log.dir}/ATS_${build.id}_testdrop.log">
+            <arg value="ats3_testdrop.pl"/>
+            <arg value="--host=${sf.spec.test.host.name}"/>
+            <arg value="--username=${sf.spec.test.host.username}"/>
+            <arg value="--password=${sf.spec.test.host.password}"/>
+            <arg value="--local-test-pkg=${sf.spec.test.package.location}\${sf.spec.test.package.name}"/>
+            <arg value="--local-drop-path=${sf.spec.test.workerroot}/${sf.spec.test.package.droppath}"/>
+            <arg value="--host-drop-path=${sf.spec.test.host.droppath}"/>
+        </exec>
+    </target>
+
+    <!-- package all logs into zipfile before publish -->
+    <target name="sf-zip-logs">
+        <if>
+            <istrue value="${sf.spec.logs.zip.enable}"/>
+            <then>
+                <property name="temp.log.dir" value="${env.TEMP}/${build.id}_output_logs"/>
+                <echo message="Zip log requested, zipping logs..."/>
+                <mkdir dir="${temp.log.dir}"/>
+                <zip destfile="${temp.log.dir}/build_logs.zip" basedir="${build.drive}"> 
+                    <include name="output/logs/**"/>
+                    <exclude name="output/logs/BOM/**"/>
+                    <exclude name="output/logs/deliverables/**"/>
+                    <exclude name="output/logs/releaseables/**"/>
+                </zip>
+                <zip destfile="${temp.log.dir}/build_BOM.zip">
+                    <zipfileset dir="${build.drive}/output/logs/BOM" prefix="build_info/logs/BOM"/>
+                    <zipfileset dir="${build.drive}/output/logs/releaseables" prefix="build_info/logs/releaseables"/>
+                </zip>
+                <move todir="${build.log.dir}">
+                    <fileset dir="${temp.log.dir}"/>
+                </move>
+            </then>
+        </if>
+    </target>
+
+    <target name="sf-bc-check">
+
+        <if><isset property="env.PDT_HOME"/>
+        <then>
+            <!-- create BC dir -->
+            <mkdir dir="${build.log.dir}/BC"/>
+
+            <delete file="${build.log.dir}/BC/bc.config" quiet="true"/>
+            <delete file="${build.log.dir}/BC/BBCResults.xsl" quiet="true"/>
+            <delete file="${build.log.dir}/BC/libraries.txt" quiet="true"/>
+            <delete file="${build.log.dir}/BC/libraries_report.xml" quiet="true"/>
+            <delete file="${build.log.dir}/BC/headers.txt" quiet="true"/>
+            <delete file="${build.log.dir}/BC/headers_report.xml" quiet="true"/>
+
+            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
+                <arg value="/c"/>
+                <arg value="echo"/>
+                <arg value="BASELINE_NAME=${sf.spec.bccheck.baseline.name}"/>
+            </exec>
+            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
+                <arg value="/c"/>
+                <arg value="echo"/>
+                <arg value="BASELINE_SDK_DIR=${sf.spec.bccheck.baseline.skd.dir}"/>
+            </exec>
+            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
+                <arg value="/c"/>
+                <arg value="echo"/>
+                <arg value="BASELINE_SDK_S60_VERSION=${sf.spec.bccheck.baseline.s60.version}"/>
+            </exec>
+            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
+                <arg value="/c"/>
+                <arg value="echo"/>
+                <arg value="CURRENT_NAME=${build.id}"/>
+            </exec>
+            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
+                <arg value="/c"/>
+                <arg value="echo"/>
+                <arg value="CURRENT_SDK_DIR=${build.drive}"/>
+            </exec>
+            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
+                <arg value="/c"/>
+                <arg value="echo"/>
+                <arg value="CURRENT_SDK_S60_VERSION=${sf.spec.bccheck.current.s60.version}"/>
+            </exec>
+
+            <copy file="${sf.spec.pdt.root}/fts/compatibilityanalyser/reports/BBCResults.xsl" tofile="${build.log.dir}/BC/BBCResults.xsl" failonerror="false" verbose="true"/>
+
+            <if><istrue value="${sf.spec.bccheck.enable.la}"/>
+                <then>
+                    <exec executable="python" dir="${sf.spec.pdt.root}/fts/compatibilityanalyser" output="${build.log.dir}/BC/libraries.txt">
+                        <arg value="CheckBC.py"/>
+                        <arg value="${build.log.dir}/BC/bc.config"/>
+                        <arg value="-la"/>
+                        <arg value="-f"/>
+                        <arg value="${sf.spec.bccheck.reportid}"/>
+                    </exec>
+                    <copy file="${sf.spec.pdt.root}/fts/compatibilityanalyser/reports/Libraries_CompatibilityReport_${sf.spec.bccheck.reportid}.xml" tofile="${build.log.dir}/BC/libraries_report.xml" failonerror="false" verbose="true"/>
+                </then>
+            </if>
+
+            <if><istrue value="${sf.spec.bccheck.enable.ha}"/>
+                <then>
+                    <exec executable="python" dir="${sf.spec.pdt.root}/fts/compatibilityanalyser" output="${build.log.dir}/BC/headers.txt">
+                        <arg value="CheckBC.py"/>
+                        <arg value="${build.log.dir}/BC/bc.config"/>
+                        <arg value="-ha"/>
+                        <arg value="-f"/>
+                        <arg value="${sf.spec.bccheck.reportid}"/>
+                    </exec>
+                    <copy file="${sf.spec.pdt.root}/fts/compatibilityanalyser/reports/Headers_CompatibilityReport_${sf.spec.bccheck.reportid}.xml" tofile="${build.log.dir}/BC/headers_report.xml" failonerror="false" verbose="true"/>
+                </then>
+            </if>
+
+            <if><istrue value="${sf.spec.bccheck.enable.dynamic}"/>
+                <then>
+                    <echo message="INFO Updating bctest 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}_dynamicbc.log">
+                        <arg value="ats_specialise_test_drop.pl"/>
+                        <arg value="--test-drop-name=bctest-${build.id}"/> 
+                        <arg value="--device-name=GENERIC EMULATOR on ${env.COMPUTERNAME}"/>
+                        <arg value="--src=${sf.spec.test.package.location}\..\bctest\bctest.zip"/>
+                        <arg value="--dest=${sf.spec.test.package.location}\${sf.spec.bccheck.package.name}"/>
+                    </exec>
+                    <!-- Now ready to send to ATS3 -->
+
+                    <antcall target="sf-send-testpkg" inheritAll="false">
+                        <param name="sf.spec.test.package.name" value="${sf.spec.bccheck.package.name}"/>
+                    </antcall>    
+                </then>
+            </if>
+        </then>
+        <else>
+            <echo message="WARNING: PDT_HOME not set, I dont know where the BC tools are installed so cannot continue"/>
+        </else>
+        </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>
+
+</project>
--- a/common/build.xml	Tue Aug 18 15:32:29 2009 +0100
+++ b/common/build.xml	Tue Aug 18 15:39:56 2009 +0100
@@ -5,7 +5,7 @@
     
     <dirname property="sf.common.config.dir" file="${ant.file.SF-COMMON-CONFIG}"/>
     
-    <!-- import common properties -->
+    <!-- Import common properties -->
     <import file="${sf.common.config.dir}/common_props.ant.xml" />
     
     <!-- setup Helium internal properties from their equivalent in the project spec -->
@@ -31,12 +31,15 @@
     <!-- SF-specific Helium properties not meant to be exposed in the project spec -->
     <property name="diamonds.listener.configuration.file" location="${sf.common.config.dir}/diamonds/config.xml.ftl"/>
     
-    <!-- import all core HELIUM targets -->
+    <!-- Import all core HELIUM targets -->
     <import file="${helium.dir}/helium.ant.xml" />
     
-    <!-- import common references -->
+    <!-- Import common references -->
     <import file="${sf.common.config.dir}/common_refs.ant.xml" />
              
+    <!-- Import functionality distributed into other file(s) -->
+    <import file="${sf.common.config.dir}/build.postbuild.xml"/>
+             
     <!-- setup conditional Helium internal properties -->
     <if><istrue value="${sf.spec.sourcesync.usecache}"/>
         <then>
@@ -59,6 +62,15 @@
     <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>
         <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">
+            <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>
     </target>
         
     <target name="sf-build-all" depends="sf-prebuild,sf-build-noprep,sf-postbuild">
@@ -109,103 +121,6 @@
         </fmpp>
     </target>
     
-    <target name="sf-bc-check">
-
-        <if><isset property="env.PDT_HOME"/>
-        <then>
-            <!-- create BC dir -->
-            <mkdir dir="${build.log.dir}/BC"/>
-
-            <delete file="${build.log.dir}/BC/bc.config" quiet="true"/>
-            <delete file="${build.log.dir}/BC/BBCResults.xsl" quiet="true"/>
-            <delete file="${build.log.dir}/BC/libraries.txt" quiet="true"/>
-            <delete file="${build.log.dir}/BC/libraries_report.xml" quiet="true"/>
-            <delete file="${build.log.dir}/BC/headers.txt" quiet="true"/>
-            <delete file="${build.log.dir}/BC/headers_report.xml" quiet="true"/>
-
-            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
-                <arg value="/c"/>
-                <arg value="echo"/>
-                <arg value="BASELINE_NAME=${sf.spec.bccheck.baseline.name}"/>
-            </exec>
-            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
-                <arg value="/c"/>
-                <arg value="echo"/>
-                <arg value="BASELINE_SDK_DIR=${sf.spec.bccheck.baseline.skd.dir}"/>
-            </exec>
-            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
-                <arg value="/c"/>
-                <arg value="echo"/>
-                <arg value="BASELINE_SDK_S60_VERSION=${sf.spec.bccheck.baseline.s60.version}"/>
-            </exec>
-            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
-                <arg value="/c"/>
-                <arg value="echo"/>
-                <arg value="CURRENT_NAME=${build.id}"/>
-            </exec>
-            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
-                <arg value="/c"/>
-                <arg value="echo"/>
-                <arg value="CURRENT_SDK_DIR=${build.drive}"/>
-            </exec>
-            <exec executable="cmd" output="${build.log.dir}/BC/bc.config" append="true">
-                <arg value="/c"/>
-                <arg value="echo"/>
-                <arg value="CURRENT_SDK_S60_VERSION=${sf.spec.bccheck.current.s60.version}"/>
-            </exec>
-
-            <copy file="${sf.spec.pdt.root}/fts/compatibilityanalyser/reports/BBCResults.xsl" tofile="${build.log.dir}/BC/BBCResults.xsl" failonerror="false" verbose="true"/>
-
-            <if><istrue value="${sf.spec.bccheck.enable.la}"/>
-                <then>
-                    <exec executable="python" dir="${sf.spec.pdt.root}/fts/compatibilityanalyser" output="${build.log.dir}/BC/libraries.txt">
-                        <arg value="CheckBC.py"/>
-                        <arg value="${build.log.dir}/BC/bc.config"/>
-                        <arg value="-la"/>
-                        <arg value="-f"/>
-                        <arg value="${sf.spec.bccheck.reportid}"/>
-                    </exec>
-                    <copy file="${sf.spec.pdt.root}/fts/compatibilityanalyser/reports/Libraries_CompatibilityReport_${sf.spec.bccheck.reportid}.xml" tofile="${build.log.dir}/BC/libraries_report.xml" failonerror="false" verbose="true"/>
-                </then>
-            </if>
-
-            <if><istrue value="${sf.spec.bccheck.enable.ha}"/>
-                <then>
-                    <exec executable="python" dir="${sf.spec.pdt.root}/fts/compatibilityanalyser" output="${build.log.dir}/BC/headers.txt">
-                        <arg value="CheckBC.py"/>
-                        <arg value="${build.log.dir}/BC/bc.config"/>
-                        <arg value="-ha"/>
-                        <arg value="-f"/>
-                        <arg value="${sf.spec.bccheck.reportid}"/>
-                    </exec>
-                    <copy file="${sf.spec.pdt.root}/fts/compatibilityanalyser/reports/Headers_CompatibilityReport_${sf.spec.bccheck.reportid}.xml" tofile="${build.log.dir}/BC/headers_report.xml" failonerror="false" verbose="true"/>
-                </then>
-            </if>
-
-            <if><istrue value="${sf.spec.bccheck.enable.dynamic}"/>
-                <then>
-                    <echo message="INFO Updating bctest 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}_dynamicbc.log">
-                        <arg value="ats_specialise_test_drop.pl"/>
-                        <arg value="--test-drop-name=bctest-${build.id}"/> 
-                        <arg value="--device-name=GENERIC EMULATOR on ${env.COMPUTERNAME}"/>
-                        <arg value="--src=${sf.spec.test.package.location}\..\bctest\bctest.zip"/>
-                        <arg value="--dest=${sf.spec.test.package.location}\${sf.spec.bccheck.package.name}"/>
-                    </exec>
-                    <!-- Now ready to send to ATS3 -->
-
-                    <antcall target="sf-send-testpkg" inheritAll="false">
-                        <param name="sf.spec.test.package.name" value="${sf.spec.bccheck.package.name}"/>
-                    </antcall>    
-                </then>
-            </if>
-        </then>
-        <else>
-            <echo message="WARNING: PDT_HOME not set, I dont know where the BC tools are installed so cannot continue"/>
-        </else>
-        </if>
-    </target>
-    
     <target name="generate-layers">
        <echo message="canno-file:${canonical.sysdef.file}"/>
        <echo message="raptor-filters:raptor_${sysdef.configuration}"/>
@@ -260,19 +175,19 @@
             <arg value="${sf.job.bom.config.repo},sf-config,${sf.job.bom.config.rev}:${sf.job.bom.config.checksum}"/>
         </exec>
         <delete file="${build.drive}/output/logs/BOM/project.csv" quiet="true"/>
-        <exec executable="hg" dir="${sf.config.dir}/../build/config" outputproperty="sf.job.bom.project.repo">
+        <exec executable="hg" dir="${sf.project.location}" outputproperty="sf.job.bom.project.repo">
             <arg value="showconfig"/>
             <arg value="paths.default"/>
         </exec>
-        <exec executable="hg" dir="${sf.config.dir}/../build/config" outputproperty="sf.job.bom.project.rev">
+        <exec executable="hg" dir="${sf.project.location}" outputproperty="sf.job.bom.project.rev">
             <arg value="identify"/>
             <arg value="-n"/>
         </exec>
-        <exec executable="hg" dir="${sf.config.dir}/../build/config" outputproperty="sf.job.bom.project.checksum">
+        <exec executable="hg" dir="${sf.project.location}" outputproperty="sf.job.bom.project.checksum">
             <arg value="identify"/>
             <arg value="-i"/>
         </exec>
-        <echo message="dir ${sf.config.dir}/../build/config : revision ${sf.job.bom.project.rev}:${sf.job.bom.project.checksum}"/>
+        <echo message="dir ${sf.project.location} : revision ${sf.job.bom.project.rev}:${sf.job.bom.project.checksum}"/>
         <exec executable="cmd" output="${build.drive}/output/logs/BOM/project.csv" append="true">
             <arg value="/c"/>
             <arg value="echo"/>
@@ -357,73 +272,6 @@
       </fmpp>
     </target>
     
-    <target name="sf-postbuild">
-        <echo>[SF-POSTBUILD]</echo>
-        <parallel>                
-        <!-- TAG SOURCE CODE -->
-        <if>
-            <istrue value="${sf.spec.tagafterbuild.enable}" />
-            <then>
-                <echo message="Apply tag to the source code used in this build"/>
-                <runtarget target="sf-tag-hg-code"/>
-            </then>
-        </if>
-        
-        <if>
-            <istrue value="${sf.spec.md5.enable}"/>
-            <then>
-                <echo message="INFO Creating MD5s"/>
-                <runtarget target="sf-run-evalid"/>
-            </then>
-        </if>
-        <if>
-            <istrue value="${sf.spec.package.bin.enable}"/>
-            <then>
-                <echo message="INFO Packaging Binaries"/>
-                <runtarget target="sf-package-binary"/>
-                <runtarget target="sf-package-tools"/>
-
-                <echo message="INFO Validate Zip files"/>
-                <runtarget target="sf-package-validate"/>
-            </then>
-        </if>
-        </parallel>
-        
-        <if><istrue value="${sf.spec.test.sendpkg.enable}"/>
-            <then>
-                <runtarget target="sf-build-smoketestpkg"/>
-                <runtarget target="sf-send-testpkg"/>
-            </then>
-        </if>
-
-        <!-- run build analysis tools -->
-        <runtarget target="sf-run-analysis"/>
-
-        <runtarget target="sf-zip-logs"/>
-
-        <!-- Do BC check -->
-        <if><istrue value="${sf.spec.bccheck.enable}"/>
-            <then>
-                <runtarget target="sf-bc-check"/>
-            </then>
-        </if>
-
-        <!-- PUBLISH LOGS/REPORTS -->
-        <if>
-            <istrue value="${sf.spec.publish.enable}" />
-            <then>
-                <echo message="Publish log files and reports to ${sf.spec.publish.rootdir}"/>
-                <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}"/>
@@ -431,45 +279,22 @@
         </antcall>
     </target>
 
-    <!-- package all logs into zipfile before publish -->
-    <target name="sf-zip-logs">
-        <if>
-            <istrue value="${sf.spec.logs.zip.enable}"/>
-            <then>
-                <property name="temp.log.dir" value="${env.TEMP}/${build.id}_output_logs"/>
-                <echo message="Zip log requested, zipping logs..."/>
-                <mkdir dir="${temp.log.dir}"/>
-                <zip destfile="${temp.log.dir}/build_logs.zip" basedir="${build.drive}"> 
-                    <include name="output/logs/**"/>
-                    <exclude name="output/logs/BOM/**"/>
-                    <exclude name="output/logs/deliverables/**"/>
-                    <exclude name="output/logs/releaseables/**"/>
-                </zip>
-                <zip destfile="${temp.log.dir}/build_BOM.zip">
-                    <zipfileset dir="${build.drive}/output/logs/BOM" prefix="build_info/logs/BOM"/>
-                    <zipfileset dir="${build.drive}/output/logs/releaseables" prefix="build_info/logs/releaseables"/>
-                </zip>
-                <move todir="${build.log.dir}">
-                    <fileset dir="${temp.log.dir}"/>
-                </move>
-            </then>
-        </if>
-    </target>
-
     <!-- generate dir list using passed location and name 
     if a baseline list is available then generate deltas too -->
 
     <target name="sf-list-dir">
         <property name="sf.currentlist.name"   value="${sf.list.name}"/> 
         <property name="sf.dir.location" value="${build.drive}/epoc32"/> 
+        <property name="sf.dir.exclude" value="${build.drive}/epoc32/build"/> 
     
         <if>
             <istrue value="${sf.spec.dirlist.enable}"/>
             <then>
-                <echo message="Dirlist name: ${sf.currentlist.name} requested for ${sf.dir.location}"/>
-                <exec executable="perl" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_${sf.currentlist.name}.log">
-                    <arg value="${sf.common.config.dir}/tools/listdir.pl"/>
+                <echo message="Dirlist name: ${sf.currentlist.name} requested for ${sf.dir.location} excluding ${sf.dir.exclude}"/>
+                <exec executable="python" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_${sf.currentlist.name}.log">
+                    <arg value="${sf.common.config.dir}/tools/listdir.py"/>
                     <arg value="${sf.dir.location}"/>
+                    <arg value="${sf.dir.exclude}"/>
                 </exec>
             </then>
         </if>
@@ -564,18 +389,6 @@
         <ant antfile="${sf.common.config.dir}/generated/source-spec.ant.xml" />
     </target>
     
-    <target name="sf-tag-hg-code">
-        <property name="sf.tagafterbuild.tag" value="${sf.spec.job.name}_${sf.spec.job.codeline}.${sf.spec.job.number}"/>
-        <fmpp sourceFile="${sf.common.config.dir}/templates/tag-hg-code.ant.xml.ftl"
-              outputFile="${sf.common.config.dir}/generated/tag-hg-code.ant.xml">
-            <data expandProperties="yes">
-                ant: antProperties()
-                data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
-            </data>
-        </fmpp>
-        <ant antfile="${sf.common.config.dir}/generated/tag-hg-code.ant.xml"/>
-    </target>
-    
     <target name="sf-diamondize-bom">
         <fmpp sourceFile="${sf.common.config.dir}/templates/build-info.xml.ftl"
               outputFile="${build.drive}/output/logs/sf-diamondize-bom.xml">
@@ -634,75 +447,6 @@
         </antcall>
     </target>
     
-    <target name="sf-package-tools" depends="sf-preprocess-package-config">
-        <echo message="Packaging epoc32 tools - Temporary method"/>
-        <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_tools_epoc32.log">
-            <arg value="a"/>
-            <arg value="-tzip"/>
-            <arg value="-x@${build.log.dir}/rnd_excludefile.txt"/>
-<!--            <arg value="-x@${build.log.dir}/*_includefile.txt"/> -->
-            <arg value="${build.drive}/output/zips/release/tools_epoc.zip"/> 
-            <arg value="epoc32/tools"/>
-        </exec>
-    </target>
-    
-    <target name="sf-package-binary" depends="sf-preprocess-package-config,sf-package-postbuild-rnd">
-        <!-- Warning: Reverting to using the He zipper will also revert to a single zip for the binaries:
-             would need to update the template and possibly the script that populates it -->
-        <!--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-->
-    <parallel>
-            <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}/rnd_excludefile.txt"/>
-                <arg value="-x!epoc32\tools"/>
-                <arg value="-x!epoc32\build"/>
-                <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="epoc32\"/>
-            </exec>
-            
-            <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_binaries_winscw.log">
-                <arg value="a"/>
-                <arg value="-tzip"/>
-                <arg value="-x@${build.log.dir}/rnd_excludefile.txt"/>
-                <arg value="-xr!*.sym"/>
-                <arg value="${build.drive}/output/zips/release/binaries_winscw.zip"/>
-                <arg value="epoc32\release\winscw\"/>
-            </exec>
-            
-            <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_binaries_armv5.log">
-                <arg value="a"/>
-                <arg value="-tzip"/>
-                <arg value="-x@${build.log.dir}/rnd_excludefile.txt"/>
-                <arg value="-xr!*.sym"/>
-                <arg value="${build.drive}/output/zips/release/binaries_armv5.zip"/>
-                <arg value="epoc32\release\armv5\"/>
-            </exec>
-        </parallel>
-    </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\release -->
-        <move todir="${build.log.dir}">
-           <fileset dir="${build.drive}"><include name="*_includefile.txt"/></fileset>
-        </move>
-        <move todir="${build.drive}/output/zips/release">
-           <fileset dir="${build.drive}"><include name="bin*.zip"/></fileset>
-        </move>
-        <!-- TODO: merge with release_metadata.xml ? -->
-    </target>
-
     <!-- unpack rnd zips if available -->
     <target name="sf-unpack-rnd">
         <echo message="Unpacking any available RnD binaries"/>
@@ -712,392 +456,34 @@
         <arg value="${build.drive}/output/zips/bin*.zip"/>
         </exec>
     </target>
+
+    <target name="sf-find-ATS-worker-root">
+      <exec executable="perl" dir="${sf.common.config.dir}/tools/ats/devices" failonerror="false" outputproperty="sf.spec.test.workerroot">
+        <arg value="-pe"/>
+        <arg value="&quot;m/TEMPDIR=(\S+)/;print $1;s/.*\n//g&quot;"/>
+        <arg value="${env.COMPUTERNAME}\EMULATOR_GENERIC_${env.COMPUTERNAME}.properties" /> 
+      </exec>
+      <echo message="ATS Worker Root = ${sf.spec.test.workerroot}"/> 
+    </target>
     
-    <target name ="sf-make-junction">
-        <mkdir dir="${sf.spec.test.epocroot}"/>
+    <target name ="sf-make-junction" depends="sf-find-ATS-worker-root">
+        
+        <mkdir dir="${sf.spec.test.workerroot}/${sf.spec.test.epocroot}"/>
 
         <exec executable="perl" dir="${sf.common.config.dir}/tools/ats" failonerror="false" output="${build.log.dir}/ATS_${build.id}_make_junction.log">
         <arg value="make_junction.pl"/>
-        <arg value="--link=${sf.spec.test.epocroot}/epoc32"/>
+        <arg value="--link=${sf.spec.test.workerroot}/${sf.spec.test.epocroot}/epoc32"/>
         <arg value="--target=${build.drive}/epoc32"/>
         <arg value="--force"/>
       </exec>
     </target>
 
-    <target name ="sf-delete-junction">
-        <exec executable="junction.exe" dir="${sf.spec.test.epocroot}" failonerror="false" output="${build.log.dir}/ATS_${build.id}_delete_junction.log">
+    <target name ="sf-delete-junction" depends="sf-find-ATS-worker-root">
+        <exec executable="junction.exe" dir="${sf.spec.test.workerroot}/${sf.spec.test.epocroot}" failonerror="false" output="${build.log.dir}/ATS_${build.id}_delete_junction.log">
         <arg value="-d"/>
         <arg value="epoc32"/>
       </exec>
     </target>  
-    
-    <target name="sf-send-testpkg" depends="sf-make-junction">
-        <mkdir dir="${sf.spec.test.package.droppath}"/>
-        <echo message="Sending test package ${sf.spec.test.package.name} to ${sf.spec.test.host.name} path ${sf.spec.test.host.droppath}"/>
-        <exec executable="perl" dir="${sf.common.config.dir}/tools/ats" failonerror="false" output="${build.log.dir}/ATS_${build.id}_testdrop.log">
-            <arg value="ats3_testdrop.pl"/>
-            <arg value="--host=${sf.spec.test.host.name}"/>
-            <arg value="--username=${sf.spec.test.host.username}"/>
-            <arg value="--password=${sf.spec.test.host.password}"/>
-            <arg value="--local-test-pkg=${sf.spec.test.package.location}\${sf.spec.test.package.name}"/>
-            <arg value="--local-drop-path=${sf.spec.test.package.droppath}"/>
-            <arg value="--host-drop-path=${sf.spec.test.host.droppath}"/>
-        </exec>
-    </target>
-
-    <target name="sf-build-smoketestpkg" depends="sf-getenv-tools">
-        <delete dir  ="${build.drive}/smoketest"/>
-        <delete file ="${build.log.dir}/ATS_${build.id}_smoketest.log"/>
         
-        <echo message="INFO Copy smoketest source to EPOCROOT"/>
-        
-        <copy todir="${build.drive}/smoketest">
-            <fileset dir="${sf.common.config.dir}/tools/ats/smoketest"/>
-        </copy>
-        
-        <echo message="INFO Building smoketest"/>
-        <exec executable="cmd" dir="${build.drive}/smoketest/group" failonerror="false" append="true" output="${build.log.dir}/ATS_${build.id}_smoketest.log">
-            <arg value="/c"/>
-            <arg value="sbs -b bld.inf -c winscw_udeb.test"/>
-        </exec>
-
-        <echo message="INFO Creating smoketest testpackage"/>
-        <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}"/>
-        
-        <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">
-            <arg value="ats_specialise_test_drop.pl"/>
-            <arg value="--test-drop-name=Smoketest-${build.id}"/> 
-            <arg value="--device-name=GENERIC EMULATOR on ${env.COMPUTERNAME}"/>
-            <arg value="--src=${sf.spec.test.package.location}\smoketest.zip"/>
-            <arg value="--dest=${sf.spec.test.package.location}\${sf.spec.test.package.name}"/>	
-            <arg value="--build-id=http://${sf.spec.publish.diamonds.server}${diamonds.build.id}"/>			
-        </exec>
-        <!-- Now ready to send to ATS3 -->
-    </target>   
-
-    <!-- runs analysis of missing bins and source -->
-    <target name="sf-run-analysis">
-        <mkdir dir="${build.log.dir}/analysis"/>
-        <parallel>
-          <runtarget target="sf-run-analysis-ant"/>
-          <runtarget target="sf-run-analysis-raptor"/>
-          <runtarget target="sf-run-analysis-yarp"/>
-          <runtarget target="sf-run-analysis-whatlog-summary"/>
-        </parallel>
-        <if>
-          <istrue value="${sf.spec.publish.enable}"/>
-            <then>
-            <runtarget target="sf-run-analysis-diamonds"/>
-            </then>
-        </if>    
-    </target>
-
-    <target name="sf-run-analysis-ant">    
-        <echo message="Running source analysis of ANT output"/>
-        <exec executable="perl" dir="${build.log.dir}" failonerror="false" output="${build.log.dir}/analysis/${build.id}_scan_ant.log">
-            <arg value="${sf.common.config.dir}/tools/analysis/scan_antlogs.pl"/>
-            <arg value="*ant*"/>
-        </exec>
-    </target>
-
-    <target name="sf-run-analysis-list">    
-        <echo message="Running list analysis"/>
-        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_list_results.log">
-            <arg value="${sf.common.config.dir}/tools/analysis/parselistdirs.pl"/>
-            <arg value="..\"/>
-        </exec>
-    </target>
-
-    <target name="sf-run-analysis-whatlog">    
-        <echo message="Running whatlog analysis"/>
-        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_what_results.csv">
-            <arg value="${sf.common.config.dir}/tools/analysis/parsewhatlog.pl"/>
-            <arg value="..\"/>
-        </exec>
-    </target>
-
-    <target name="sf-run-analysis-whatlog-summary" >
-        <sequential>
-          <parallel>
-            <runtarget target="sf-run-analysis-list"/>
-            <runtarget target="sf-run-analysis-whatlog"/>
-          </parallel>
-          <runtarget target="sf-run-analysis-whatlog-merge" />
-          <parallel>
-            <runtarget target="sf-run-analysis-whatlog-package"/>
-            <runtarget target="sf-run-analysis-whatlog-collisons"/>
-          </parallel>
-        </sequential>
-    </target>
-    
-    <target name="sf-run-analysis-whatlog-merge" >        
-        <echo message="Running summary analysis"/>
-        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_summary.log">
-            <arg value="${sf.common.config.dir}/tools/analysis/merge_csv.pl"/>
-            <arg value="${build.id}_what_results.csv"/>
-            <arg value="${build.id}_list_results.log"/>
-            <arg value="${build.drive}/output/zips/release/binaries_epoc_additional.zip"/>
-        </exec>
-    </target>
-    
-    <target name="sf-run-analysis-whatlog-package" >        
-        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_analysecomponents.log">
-            <arg value="${sf.common.config.dir}/tools/analysis/analyse_components.pl"/>
-            <arg value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
-            <arg value="${build.id}_what_results.csv_results.csv"/>
-            <arg value="${sf.project.location}/sysdefs/system_model_os.xml"/>
-        </exec>
-    </target>
-    
-    <target name="sf-run-analysis-whatlog-collisons" >        
-        <echo message="Running collision analysis"/>
-        <exec executable="perl" dir="${build.drive}" failonerror="false" output="${build.log.dir}/analysis/${build.id}_collisions.log">
-            <arg value="${sf.common.config.dir}/tools/analysis/find_collisions.pl"/>
-            <arg value="${build.log.dir}/analysis/${build.id}_what_results.csv"/>
-        </exec>
-    </target>
-
-    <target name="sf-run-analysis-raptor">            
-      <echo message="Preprocessing *_compile.log files"/>
-      <for param="logfile">
-        <path>
-          <fileset dir="${build.log.dir}">
-            <include name="*_compile.log"/>
-            <exclude name="*build_check_compile.log"/>
-          </fileset>
-        </path>
-        <sequential>
-          <propertyregex override="yes" property="preprocessedlogfile" input="@{logfile}" regexp=".*[\\|\/].*\.T?\d+_+(.*)_compile\.log" replace="\1_compile_preprocessed.log"/>
-	        <echo message="Preprocessing @{logfile}..."/>
-          <exec executable="perl" dir="${sf.common.config.dir}/tools/raptor" failonerror="false" input="@{logfile}" output="${build.log.dir}/analysis/${preprocessedlogfile}" error="${build.log.dir}/analysis/${build.id}_preprocess.log" append="true">
-            <arg value="${sf.common.config.dir}/tools/raptor/preprocess_log.pl"/>
-          </exec>
-        </sequential>
-      </for>
-      
-      <echo message="Extracting whatlog information from *whatlog*_compile_preprocessed.log files"/>
-      <for param="whatlogfile">
-        <path>
-          <fileset dir="${build.log.dir}/analysis">
-            <include name="*whatlog*_compile_preprocessed.log"/>
-          </fileset>
-        </path>
-        <sequential>
-          <echo message="Extracting whatlog info from @{whatlogfile}..."/>
-          <exec executable="perl" dir="${sf.common.config.dir}/tools/raptor" failonerror="false" output="${build.log.dir}/analysis/${build.id}_whatlog.log" append="true">
-            <arg value="${sf.common.config.dir}/tools/raptor/parse.pl"/>
-            <arg value="--releaseable"/>
-            <arg value="--log=@{whatlogfile}"/>
-            <arg value="--basedir=${build.log.dir}"/>
-            <arg value="--append"/>
-          </exec>
-        </sequential>
-      </for>
-      
-      <echo message="Extracting error information from *_compile_preprocessed.log files"/>
-      <for param="raptorlogfile">
-        <path>
-          <fileset dir="${build.log.dir}/analysis">
-            <include name="*_compile_preprocessed.log"/>
-          </fileset>
-        </path>
-        <sequential>
-          <echo message="Extracting error info from @{raptorlogfile}..."/>
-          <exec executable="perl" dir="${sf.common.config.dir}/tools/raptor" failonerror="false" output="${build.log.dir}/analysis/${build.id}_raptorparse.log" append="true">
-            <arg value="${sf.common.config.dir}/tools/raptor/parse.pl"/>
-            <arg value="--error"/>
-            <arg value="--warning"/>
-            <arg value="--log=@{raptorlogfile}"/>
-            <arg value="--basedir=${build.log.dir}/raptorbits"/>
-            <arg value="--append"/>
-          </exec>
-        </sequential>
-      </for>
-            <!-- Now iterate through the generated TSVs to sort them and remove duplicates -->
-      <for param="tsv">
-        <path>
-          <fileset dir="${build.log.dir}/releaseables">
-            <include name="**/*.tsv"/>
-          </fileset>
-        </path>
-        <sequential>
-          <exec executable="perl" input="@{tsv}" output="@{tsv}">
-            <arg value="${sf.common.config.dir}/tools/sortUnique.pl"/>
-          </exec>
-        </sequential>
-      </for>
-    </target>
-
-    <target name="sf-run-analysis-yarp">          
-      <echo message="Running yarp over *_compile.log files"/>
-      <for param="logfile">
-        <path>
-          <fileset dir="${build.log.dir}">
-            <include name="*_compile.log"/>
-            <exclude name="*build_check_compile.log"/>
-          </fileset>
-        </path>
-        <sequential>
-          <propertyregex override="yes" property="yarpfile"  input="@{logfile}" regexp=".*[\\|\/](.*)_compile\.log" replace="\1_yarp.csv"/>
-          <propertyregex override="yes" property="yarpfile_short"  input="${yarpfile}" regexp="[^_]*_[^_]*_[^_]*_(.+)_[^_]*_yarp\.csv" replace="YARP_\1"/>
-          <echo message="Yarping @{logfile}..."/>
-          <exec executable="perl" dir="${build.drive}" failonerror="false" output="${build.log.dir}/analysis/${yarpfile}.log" append="true">
-            <arg value="${sf.common.config.dir}/tools/analysis/yarp.pl"/>
-            <arg value="@{logfile}"/>
-            <arg value="${build.log.dir}/analysis/${yarpfile}"/>
-          </exec>
-          <exec executable="cmd" output="${build.drive}/output/logs/analysis/tmp_yarp_files.csv" append="true">
-            <arg value="/c"/>
-            <arg value="echo"/>
-            <arg value="${yarpfile_short},${sf.spec.publish.networkdrive}\${sf.spec.job.name}\builds\${sf.spec.job.codeline}\${build.id}\logs\analysis\${yarpfile},${build.drive}\output\logs\analysis\${yarpfile}"/>
-          </exec>
-        </sequential>
-      </for>
-      
-      <exec executable="perl" dir="${build.drive}" failonerror="false" outputproperty="sf.job.totalyarperrors">
-        <arg value="${sf.common.config.dir}/tools/analysis/parse_yarp_files.pl"/>
-        <arg value="${build.drive}/output/logs/analysis/tmp_yarp_files.csv"/>
-      </exec>
-      <echo message="Total yarp errors: ${sf.job.totalyarperrors}"/>
-    </target>
-    
-    <target name="sf-run-analysis-diamonds">      
-      <fmpp sourceFile="${sf.common.config.dir}/diamonds/sf-run-analysis.xml.ftl" outputFile="${build.drive}/output/logs/sf-run-analysis.xml">
-        <data expandProperties="yes">
-          ant: antProperties()
-          raptor_summary: csv(${build.log.dir}/raptorbits/summary.csv,{separator:',',headers:[category,subcategory,severity,component,phase,recipe,file,line]})
-          files: csv(${build.drive}/output/logs/analysis/tmp_yarp_files.csv,{separator:',',headers:[name,path,localpath]})
-        </data>
-      </fmpp>
-    </target>
-    
-
-
-    <target name="sf-package-validate">
-        <exec executable="7z" dir="${build.drive}/output/zips" failonerror="false" output="${build.drive}/output/zips/validate.log">
-            <arg value="t"/>
-            <arg value="*.zip"/>
-        </exec>  
-        <exec executable="7z" dir="${build.drive}/output/zips/release" failonerror="false" output="${build.drive}/output/zips/release/validate.log">
-            <arg value="t"/>
-            <arg value="*.zip"/>
-        </exec>  
-    </target>
-
-    <target name="sf-run-evalid">
-        <delete dir="${build.drive}/output/md5"/>
-        <mkdir  dir="${build.drive}/output/md5"/>
-
-        <parallel>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/include output/md5/epoc32_include.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/s60 output/md5/epoc32_s60.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/localisation output/md5/epoc32_localisation.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -x \.sym$ -x ^armv5/udeb -x ^armv5/urel -x ^winscw/udeb -x ^winscw/urel -g epoc32/release output/md5/epoc32_release.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -x \.sym$ -g epoc32/release/armv5/udeb output/md5/epoc32_release_armv5_udeb.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -x \.sym$ -g epoc32/release/armv5/urel output/md5/epoc32_release_armv5_urel.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -x \.sym$ -g epoc32/release/winscw/udeb output/md5/epoc32_release_winscw_udeb.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -x \.sym$ -g epoc32/release/winscw/urel output/md5/epoc32_release_winscw_urel.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/cshlpcmp_template 	output/md5/epoc32_cshlpcmp_template.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/data output/md5/epoc32_data.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/engdoc output/md5/epoc32_engdoc.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/engineeringtools output/md5/epoc32_engineeringtools.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/gcc output/md5/epoc32_gcc.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/gcc_mingw output/md5/epoc32_gcc_mingw.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/ksa output/md5/epoc32_ksa.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/rom output/md5/epoc32_rom.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/rombuild output/md5/epoc32_rombuild.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/sbs_config output/md5/epoc32_sbs_config.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/sdk_special output/md5/epoc32_sdk_special.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/stdapis output/md5/epoc32_stdapis.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/stubs output/md5/epoc32_stubs.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/tools output/md5/epoc32_tools.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/wins output/md5/epoc32_wins.md5"/>
-        </exec>
-        <exec executable="cmd" dir="${build.drive}">
-            <arg value="/c"/>
-            <arg value="evalid -g epoc32/winscw output/md5/epoc32_winscw.md5"/>
-        </exec>
-        </parallel>
-        
-        <!-- package MD5s directly into epoc32/relinfo location so that its usable out-of-the-box -->
-        <property name="temp.md5.zip" value="${env.TEMP}/MD5_${sf.spec.job.name}_${build.number}.zip"/>
-        <echo message="INFO Packaging MD5s"/>
-        <zip destfile="${temp.md5.zip}">
-            <zipfileset dir="${build.drive}/output/md5/" prefix="epoc32/relinfo"/>
-        </zip>
-        <move file="${temp.md5.zip}" todir="${build.log.dir}" failonerror="false"/>
-    </target>    
 </project>
 
--- a/common/common_props.ant.xml	Tue Aug 18 15:32:29 2009 +0100
+++ b/common/common_props.ant.xml	Tue Aug 18 15:39:56 2009 +0100
@@ -83,12 +83,12 @@
     <property name="sf.spec.test.host.username"  value="admin"/>
     <property name="sf.spec.test.host.password"  value="admin"/>
     <property name="sf.spec.test.host.droppath"  value="D:\ats3_testdrop_arrivals\${env.COMPUTERNAME}"/>
-    <property name="sf.spec.test.epocroot"       value="D:\ATS3\winscw_smoketest"/>
+    <property name="sf.spec.test.epocroot"       value="winscw_smoketest"/>
 
     <!-- ATS properties -->
     <property name="sf.spec.test.package.location"  value="\\${sf.spec.test.host.name}\ats3_testdrop_arrivals\${env.COMPUTERNAME}"/>
     <property name="sf.spec.test.package.name"      value="${env.COMPUTERNAME}-Smoketest-${sf.spec.job.name}_${sf.spec.job.codeline}.${sf.spec.job.number}.zip"/> <!-- build.id not available at this point, so construct it from component parts -->
-    <property name="sf.spec.test.package.droppath"  value="D:\ATS3\TestDrops"/>
+    <property name="sf.spec.test.package.droppath"  value="TestDrops"/>
 
     <!-- BC check properties -->
     <property name="sf.spec.bccheck.enable" value="false"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/BuildEnv.xml	Tue Aug 18 15:39:56 2009 +0100
@@ -0,0 +1,160 @@
+<?xml version="1.0"?>
+<!DOCTYPE BuildEnv [
+
+        
+<!ELEMENT BuildEnv (context*)>
+    <!ATTLIST BuildEnv name CDATA #REQUIRED
+			revision CDATA #REQUIRED>
+
+<!ELEMENT context (context*, tool+)>
+    <!ATTLIST context id (system|p4|cbr) "system">
+
+<!ELEMENT tool (location?, verify*)>
+	<!ATTLIST tool name CDATA #REQUIRED>
+	<!ELEMENT location EMPTY>
+	<!ATTLIST location strict (true|false) "true" value CDATA #REQUIRED>
+	<!ELEMENT verify (check+)>
+	<!ATTLIST verify version CDATA #REQUIRED showstopper (true|false) "false">
+	<!ELEMENT check EMPTY>
+	<!ATTLIST check exclusive (false|true) "false"
+			 values  CDATA #REQUIRED
+			 locator CDATA #IMPLIED
+			 var     CDATA #IMPLIED
+			 execute CDATA #IMPLIED
+			 name    CDATA #IMPLIED
+			 silent	 (false|true) "false"
+			 log	 (false|true) "false">
+
+	]>
+
+
+<BuildEnv name="BuildEnv" revision="1">
+
+<!-- OS-dependant contexts -->
+<context id="Common">
+	<tool name="Perl">
+		<location strict="false" value="C:\apps\perl\bin\perl.exe"/>
+		<verify version="5.6.1" showstopper="true" >
+			<check name="version" execute="%location% -v" values="v5\.6\.1" locator="This is perl, (.*) built"/>
+			<check name="build" execute="%location% -v" values="build 633|build 635|build 638" locator="Binary (.*) provided by ActiveState" log="true"/>
+			<check name="module SAX version" execute="ppm query sax" values="0\.15" locator="XML-SAX \[(.*)\] Simple API" />
+        </verify>
+    </tool>
+    <tool name="Mercurial">
+		<location strict="false" value="C:\Apps\mercurial\hg.exe"/>
+		<verify version="1.2" showstopper="false">
+			<check name="version" execute="%location% version" values="1\.2\.[1-9]" locator="Mercurial Distributed SCM \(version ([0-9\.]*)\)"/>
+        </verify>
+    </tool>
+    <tool name="Python">
+		<location strict="false" value="c:\apps\python25\python.exe"/>
+		<verify version="2.5" showstopper="false">
+			<check name="version" execute="%location% -V" values="2\.5\.[0-9]" locator="Python (.*)"/>
+        </verify>
+    </tool>
+    <tool name="Java Compiler">
+		<location strict="false" value="C:\apps\jdk1.6.0_14\bin\javac"/>
+		<verify version="1.6" showstopper="true">
+			<check var="JAVA_6_HOME" values="jdk1\.6"/>
+			<check name="version" execute="%JAVA_6_HOME%\bin\javac -version" values="1\.6\.[0-9]_[0-9]+" locator="javac (.*)"/>
+		</verify>
+		<verify version="default" showstopper="false">
+			<check var="JAVA_HOME" values="jdk1\.6"/>
+		</verify>
+    </tool>
+	<tool name="7-Zip">
+		<location strict="false" value="C:\apps\7-zip\7z.exe"/>
+		<verify version="4.65" showstopper="false">
+			<check name="version" execute="%location% -h" values="4\.65" locator="7-Zip (.*)  Copyright"/>
+		</verify>
+    </tool>
+	<tool name="PDT Home">
+		<location strict="false" value="C:\Symbian\Tools\PDT_1.0\helium\hlm.bat"/>
+		<verify version="1.0 [beta]" showstopper="false">
+			<check var="PDT_HOME" values="\\Tools\\PDT_\d"/>
+		</verify>
+    </tool>
+	<tool name="EPOC">
+		<verify version="Environment Vars" showstopper="true">
+			<check var="EPOCROOT" values="^\\$"/>
+			<check var="PATH" values=";\\epoc32\\tools;" silent="true"/>
+		</verify>
+    </tool>
+	<tool name="Helium">
+		<location strict="false" value="C:\Symbian\Tools\PDT_1.0\helium\hlm.bat"/>
+		<verify version="4.0 [patched]" showstopper="true">
+			<check var="HELIUM_HOME" values="[CD]:\\Symbian\\Tools\\PDT_1.0\\helium"/>
+			<check name="version" execute="%HELIUM_HOME%\hlm.bat -f %HELIUM_HOME%\build.xml version" values="4\.0" locator="Helium version: ([\d\.]+)"/>
+		</verify>
+    </tool>
+	<tool name="Raptor">
+		<location strict="false" value="C:\apps\raptor2.7.2\bin\sbs.bat"/>
+		<verify version="2.7.2 [patched]" showstopper="true">
+			<check var="SBS_HOME" values="apps\\raptor"/>
+			<check name="version" execute="%SBS_HOME%\bin\sbs.bat -version" values="2\.7\.2" locator="sbs version (.*) \["/>
+			<check name="patch" execute="%SBS_HOME%\win32\python252\python.exe -V" values="2\.5\.4"/>
+		</verify>
+    </tool>
+</context>
+
+<context id="ARMv5">
+    <tool name="RVCT ARM Compiler">
+		<location strict="false" value="C:\apps\arm\RVCT2.2[616]\RVCT\Programs\2.2\349\win_32-pentium\armcc.exe"/>
+		<verify version="2.2" showstopper="true">
+			<check name="version" execute="%location% --help" values="RVCT2\.2\ \[Build 616\]" log="false" locator="ARM\/Thumb C\/C\+\+ Compiler, (.*)Usage"/>
+			<!-- <check execute="%RVCT22BIN%\armcc.exe" values="616" log="false"/> -->
+			<check var="RVCT22BIN" values="RVCT\\Programs\\2\.2\\349\\win_32-pentium" silent="true"/>
+			<check var="RVCT22INC" values="RVCT\\Data\\2\.2\\349\\include\\windows" silent="true"/>
+			<check var="RVCT22LIB" values="RVCT\\Data\\2\.2\\349\\lib" silent="true"/>
+			<check var="ARMLMD_LICENSE_FILE" values="8224@LON-ENGBUILD8[79]|8224@C10072[56]"/>
+		</verify>
+		<verify version="2.2 [options]" showstopper="false">
+			<check var="RVCT22_ASMOPT" values="--licretry" silent="true"/>
+			<check var="RVCT22_CCOPT" values="--licretry" silent="true"/>
+			<check var="RVCT22_LINKOPT" values="--licretry" silent="true"/>
+		</verify>
+    </tool>
+</context>
+
+<context id="Test">
+	<tool name="cURL">
+		<location strict="false" value="C:\apps\curl_7.18.2\curl.exe"/>
+		<verify version="7.18.2" showstopper="false">
+			<check name="version" execute="%location% -V" values="7\.18\.2" locator="curl (.*) \(i386-pc-win32\)"/>
+		</verify>
+    </tool>
+	<tool name="Junction">
+		<location strict="true" value="C:\Bin\junction.exe"/>
+		<verify version="1.0.5" showstopper="true">
+			<check name="version - local" execute="%location%" values="v1\.05" locator="Junction (.*) - Windows junction creator"/>
+			<check execute="junction - system" values="v1\.05" locator="Junction (.*) - Windows junction creator"/>
+		</verify>
+    </tool>
+	<tool name="ATS3 Worker">
+		<location strict="true" value="C:\apps\ats3\bin\STAFEnv.bat"/>
+		<verify version="7.18.2" showstopper="false">
+			<check execute="%location%" values=".*"/>
+			<check var="ATS3_HOME" values="\w:\\\w+"/>
+		</verify>
+    </tool>
+</context>
+
+<context id="Tools">
+    <tool name="Microsoft Visual C++ compiler">
+		<location strict="false" value="C:\apps\MSVC6\VC98\bin\vcvars32.bat"/>
+		<verify version="6.00" showstopper="false">
+			<check var="PATH" values="MSVC6\\Common\\MSDev98\\bin" silent="true"/>
+			<check var="PATH" values="MSVC6\\Common\\Tools\\WinNT" silent="true"/>
+			<check var="PATH" values="MSVC6\\Common\\Tools" silent="true"/>
+			<check var="PATH" values="MSVC6\\VC98\\bin" silent="true"/>
+			<check var="INCLUDE" values="MSVC6\\VC98\\atl\\include" silent="true"/>
+			<check var="INCLUDE" values="MSVC6\\VC98\\mfc\\include" silent="true"/>
+			<check var="INCLUDE" values="MSVC6\\VC98\\include" silent="true"/>
+			<check var="LIB" values="MSVC6\\VC98\\mfc\\lib" silent="true"/>
+			<check var="LIB" values="MSVC6\\VC98\\lib" silent="true"/>
+			<check var="MSDEVDIR" values="msvc6\\Common\\MSDev98" silent="true"/>
+		</verify>
+    </tool>
+</context>
+
+</BuildEnv>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/BuildEnvXML.pm	Tue Aug 18 15:39:56 2009 +0100
@@ -0,0 +1,386 @@
+## @file BuildEnvXML.pm
+# @ingroup userscripts clientscripts
+#
+# Uses information which is defined in the BuildEnvXML.xml to set up a machine
+# specific environment, such as path for compilers. 
+#
+# @todo Document this script.
+#
+# Copyright (c) 2009 Symbian Foundation  Ltd. All rights reserved.
+#
+
+package BuildEnvXML;
+use strict;
+use XML::DOM;
+use Cwd;
+use Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(&getToolEnvironment &getLastErrorMsg &setDbgFile);
+
+my $sToolEnv  = "";
+my $sLocalDir = cwd();
+my $hParser      = XML::DOM::Parser->new();
+my $sErrorMsg = "";
+my $toolSummary = "";
+my $execLog = "";
+my $dbgfile = "";
+
+sub getToolEnvironment
+{
+ my $sBuildEnvXML = shift;
+ my (@aCat) = @_;
+
+ my $hXMLfile     = $hParser->parsefile ($sBuildEnvXML);
+ my $hNodes = $hXMLfile->getElementsByTagName ("context");
+ my $hSystemTools, my $hP4Tools, my $hCBRTools, my $sCat, my $nNumNodes;
+ 
+ if ($dbgfile ne "")
+ {
+	print "Logging output to file $dbgfile\n";
+	open DBGFILE, ">>$dbgfile" or die; 
+ }
+
+ $sErrorMsg = "";
+ $sToolEnv  = "";
+ my $nCatDepth = scalar(@aCat);
+ subTrace("Context Depth: $nCatDepth\n");
+ my $nLevel = ($nCatDepth-1);
+ $sCat = $aCat[$nLevel];
+ $nNumNodes = $hNodes->getLength;
+
+ my $hParentNode, my $sParentId;
+ for (my $nI = 0; $nI < $nNumNodes ; $nI++)
+ {
+     my $hNode = $hNodes->item ($nI);
+     my $hId = $hNode->getAttributeNode ("id");
+     # Discriminating Stages
+     subTrace("Context found: \"".$hId->getValue()."\"");
+     if (uc($hId->getValue()) eq uc($sCat))
+     {
+     	subTrace("---> requested! analyzing...");
+     	$hParentNode = $hNode->getParentNode;
+	     for (;$nLevel>0;$nLevel--)
+	     {
+		    $sParentId = $hParentNode->getAttributeNode("id")->getValue;
+	    	subTrace("...from Parent context= ".$sParentId);
+		    if ($sParentId ne $aCat[$nLevel-1]){ $nLevel =-1;}
+		    $hParentNode = $hParentNode->getParentNode;
+	     };
+	     if (($nLevel>-1)&&($hParentNode->getNodeName ne "context"))
+	     {
+		     $hSystemTools = $hNode->getElementsByTagName ("tool", 0);
+		     $nI = $nNumNodes;
+	     }
+     }
+ }
+ if (!defined $hSystemTools)
+ {
+	 subTrace("No Stage found for category $sCat !");
+	 subTrace("Program Terminated.");
+	 exit(0);
+ }
+ subTrace(""); 
+ subTrace("----------------------");
+ subTrace("Number of $sCat tools: ".$hSystemTools->getLength);
+ for (my $nI = 0; $nI < $hSystemTools->getLength; $nI++)
+ {
+     my $hTool     = $hSystemTools->item ($nI);
+     my $hToolName = $hTool->getAttributeNode ("name");
+     subTrace("");
+     subTrace("----------------------");
+     subTrace("Verifying tool: ".$hToolName->getValue());
+	 my $isToolNotFound = "true";
+
+     # Location element
+     my $hToolLocation = $hTool->getElementsByTagName("location")->item(0);
+     my $hToolLocationPath, my $hToolLocationStrict;
+     if (defined $hToolLocation)
+     {
+             $hToolLocationPath   = $hToolLocation->getAttributeNode("value");
+             $hToolLocationStrict = $hToolLocation->getAttributeNode("strict");
+	     subTrace("Expected Location: ".$hToolLocationPath->getValue());    
+     }
+
+     # Verify element
+	 my $hToolVerifys           = $hTool->getElementsByTagName("verify");
+	 my $nNumOfVerifys			= $hToolVerifys->getLength;
+	 for (my $nZ = 0; $nZ < $nNumOfVerifys; $nZ++)
+	 {
+		 my $hToolVerify            = $hTool->getElementsByTagName("verify")->item($nZ);
+		 my $hToolVerifyVersion     = $hToolVerify->getAttributeNode("version");
+		 my $hToolVerifyShowStopper = $hToolVerify->getAttributeNode("showstopper");
+		 subTrace("Expected Version: ".$hToolVerifyVersion->getValue());    
+		 subPrint("\nVerifying tool: ".$hToolName->getValue()." (version ".$hToolVerifyVersion->getValue().")\n");
+		 
+		 # Tool checks
+		 my $hToolChecks = $hToolVerify->getElementsByTagName("check");
+		 my $nNumOfChecks= $hToolChecks->getLength;
+		 my $nCheckNum;
+		 for (my $nJ = 0; $nJ < $nNumOfChecks; $nJ++)
+		 {
+			 $nCheckNum = $nJ+1;
+			 subTrace("");
+			 subTrace("Check #$nCheckNum:");
+			 subPrint("Check #$nCheckNum");
+			 my $hCheck = $hToolChecks->item($nJ);
+			 my $hCheckCmd    = $hCheck->getAttributeNode ("execute");
+			 my $hCheckVar    = $hCheck->getAttributeNode ("var");
+			 my $hCheckValues = $hCheck->getAttributeNode ("values");
+			 my $hCheckLog    = $hCheck->getAttributeNode ("log");
+			 my $hCheckExclu  = $hCheck->getAttributeNode ("exclusive");
+			 my $hCheckName   = $hCheck->getAttributeNode ("name");
+			 my $hCheckLocator= $hCheck->getAttributeNode ("locator");
+			 my $hCheckSilent = $hCheck->getAttributeNode ("silent");
+			 my $sCommand, my $sPattern, my $sToolCmd, my $sOut, my $sOutLocal, my $sCheckName;
+			 my $versionFound = "";
+			 my $sMsg = "";
+			 # If Check is exclusive, we will only test this one:
+			 if ($hCheckExclu->getValue() eq "true")
+			 {
+				 $nJ = $nNumOfChecks;
+				 subTrace("This check is exclusive: the remaining checks will not be tested");
+			 }
+			 # Preparing system command to execute
+			 if (defined $hCheckCmd) 
+			 {
+				 $sCommand = $hCheckCmd->getValue();
+				 if (defined $hToolLocation)
+				 {
+					 $sToolCmd= $hToolLocationPath->getValue();
+					 $sCommand =~ s/\%location\%/$sToolCmd/g;
+				 }
+				 
+				 # Execute the command
+				 subTrace("Check cmd: ".$sCommand."");
+				 $sOut = `$sCommand 2>&1`;
+				 $sOutLocal = $sOut;
+				 
+				 # Check if tool cannot be found at expected location
+				 if ($sOut =~/(not\srecognized)|(system\scannot\sfind)/)
+				 {
+					 $sOutLocal = "";
+					 subTrace("Tool cannot be found at location: ".$hToolLocationPath->getValue());
+					 subLogErrorMsg($hToolLocationStrict->getValue(), $hToolName->getValue()." CANNOT BE FOUND IN THE EXPECTED LOCATION: "
+								 .$hToolLocationPath->getValue());
+					 if ($hToolLocationStrict->getValue() eq "true")
+					 {
+						 subTrace("LOCATION STRICT activated, program terminated");
+						 $sMsg .= "[ERROR] wrong location\n";
+						 #return "";
+					 }
+					 else
+					 {
+						 $sMsg .= "[WARNING] wrong location\n";
+					 }	 
+				 }
+				 else
+				 {
+					 if ((defined $hToolLocation)&&(defined $hCheckCmd))
+					 {
+						$sCommand =~ /(.*)(\\).*$/i;
+						my $sTmp  = $1;
+						$sTmp =~ s/^\s+//;
+						$sTmp =~ s/\s+$//;
+						$sToolEnv = $sTmp.";".$sToolEnv;
+						subTrace("Tool path OK.");
+						subTrace("New appender: \"".$sToolEnv."\"");
+					 }
+					 $isToolNotFound = "false";
+				 }
+				 
+				 # Check if tool can be found with the Environment PATH
+				 $sCommand =~ s/.*(\\)(.*)$/\2/i;
+				 subTrace("Try command from ENV PATH: ".$sCommand);
+				 if (!defined $hCheckName) 
+				 {
+					$sCheckName = $sCommand;
+				 }
+				 else
+				 {
+					$sCheckName = $hCheckName->getValue();
+				 }
+				 subPrint(" [$sCheckName]: ");
+				 $sOut = `$sCommand 2>&1`;
+				 if ($sOut =~/(not\srecognized)|(system\scannot\sfind)/)
+				 {
+					 $sOut = "";
+					 my $type = "ERROR";
+					 if ($isToolNotFound eq "false") {$type = "WARNING";}
+					 subTrace("$type: ".$hToolName->getValue()." CANNOT BE FOUND IN THE SYSTEM PATH");
+					 subLogErrorMsg($isToolNotFound, $hToolName->getValue()." CANNOT BE FOUND IN THE SYSTEM PATH");
+					 $sMsg .= "[$type] NOT FOUND IN SYSTEM PATH\n";
+					 if ($isToolNotFound eq "true") {next;}
+					 #return "";
+				 }
+			 }
+			 else
+			 {	 # Check by verifying an env variable
+				 subPrint(" [".$hCheckVar->getValue()."]: ");
+				 $sCommand = "ECHO %".$hCheckVar->getValue()."%";
+				 subTrace("Check var: ".$hCheckVar->getValue());		     
+				 $sOut = `$sCommand 2>&1`;
+				 $sOut =~ s/^\s*//;
+				 $sOut =~ s/\s*$//;
+			 }
+			 
+			 # Log the output if necessary 
+			 if ($hCheckLog->getValue() eq "true")
+			 {
+					 subTrace("command: $sCommand");
+					 subTrace("logged output: ");
+					 subLog("Verifying \"".$hToolName->getValue()." [version ".$hToolVerifyVersion->getValue().
+					 "]\" -- check #$nCheckNum:");
+					 subLog("Executing: $sCommand");
+					 subLog($sOut);
+			 }
+			 
+			 # Perform the check against given values
+			 if (defined $hCheckValues)
+			 {
+				 my $sOutCopy = $sOut;
+				 my $bResultOk = "false";
+				 $sPattern = $hCheckValues->getValue();
+				 if (defined $hCheckLocator)
+				 {
+					 my $sLocator = $hCheckLocator->getValue();
+					 $sOut =~ s/.*$sLocator.*/\1/msi;
+					 subTrace("Searching in locator: ".$sOut);
+					 $sOutLocal =~ s/.*$sLocator.*/\1/msi;
+				 }
+				 else
+				 {
+					$sOut =~ s/.*($sPattern).*/\1/smi;
+					$sOutLocal =~ s/.*($sPattern).*/\1/smi;
+				 }
+				 
+				# Log the current version found
+				$versionFound = $sOut.$sOutLocal;
+				if ($sOut eq $sOutLocal)
+				{
+					$versionFound = $sOut;
+				}
+				elsif (($sOut.$sOutLocal ne $sOut) and ($sOut.$sOutLocal ne $sOutLocal) and ($sOut ne $sOutLocal))
+				{
+					$versionFound = "$sOut or $sOutLocal [Value Mismatch]";
+				}
+				if ($versionFound eq "") {$versionFound = "not found";}
+				 
+				 #$sPattern =~ s/(\\|\/|\.|\*|\[|\]|\(|\)|\$|\{|\})/\\\1/g;
+				 #$sPattern = "($sPattern)";
+				 subTrace("Check against pattern: ".$sPattern);
+				 # Check the Environment Variable
+				 if (defined $hCheckVar)
+				 {
+				    $sOut = $sOutCopy;
+					my $valueTested = $hCheckVar->getValue();
+					if ($sOut =~ /%$valueTested%/) {$sOut = "not defined!";}
+					elsif ( $sOut =~ m/$sPattern/smi )
+					{
+						$bResultOk = "true";
+						if ($hCheckSilent->getValue() eq "true") { $sOut = "ok. ";}
+					}
+					$versionFound = "$sOut";
+				 } # Or Check the command executed (for version checking...)
+				 elsif ( ( ( $sOut =~ s/.*($sPattern).*/\1/smi ) and (( $sOutLocal =~ s/.*($sPattern).*/\1/smi ) or ($sOutLocal eq "")) ) || 
+				      ( ( $sOutLocal =~ s/.*($sPattern).*/\1/smi ) and ($sOut eq "") ) )
+				 {
+					$bResultOk = "true";
+					subTrace("Value OK");
+					if ($versionFound eq "" || $hCheckSilent->getValue() eq "true") { $versionFound = "ok. ";}
+					
+				 }
+				 elsif (!defined $hCheckLocator)
+				 {
+					$versionFound = "";
+				 }
+
+				 # Log the warnings/errors regarding version checking
+				 if ($bResultOk eq "false")
+				 {
+					 if ($versionFound eq "") { $versionFound = "wrong value. ";}
+					 subTrace("ERROR: VALUE CHECK FAILED");
+					 subLogErrorMsg($hToolVerifyShowStopper->getValue(), $hToolName->getValue()." VALUE INCORRECT");
+					 if ($hToolVerifyShowStopper->getValue() eq "true")
+					 {
+						 $sMsg .= "[ERROR] WRONG VALUE\n";
+						 subTrace("SHOWSTOPPER RAISED: program should be terminated");
+					 }
+					 else
+					 {
+						 subTrace("No Showstopper, continuing analysis...");
+						 $sMsg .= "[WARNING] Wrong Value\n";
+					 }
+					 
+				 }
+			 }
+			 chomp($versionFound);
+			 &subPrint ("$versionFound\n$sMsg");
+			 &printToolSummary;
+			 &printLog;
+		 }		
+	 }
+
+     
+ }
+ close DBGFILE;
+ return $sToolEnv;
+}
+
+sub subTrace
+{
+  my $sString = $_[0];
+  if ($dbgfile ne "")
+  {
+	print DBGFILE "$sString\n";
+  }
+}
+
+sub subPrint
+{
+  my $sString = $_[0];
+  $toolSummary .= "$sString";
+}
+
+sub printToolSummary
+{
+  print $toolSummary."\n";
+  $toolSummary="";
+}
+
+sub subLog
+{
+  my $sString = $_[0];
+  $execLog .= "[LOG] $sString\n";
+  
+  if ($dbgfile ne "")
+  {
+	print DBGFILE "[LOG] $sString\n";
+  }
+}
+
+sub printLog
+{
+  #print $execLog;
+  $execLog="";
+}
+
+sub subLogErrorMsg
+{
+  my $isError = shift;
+  my $msg = shift;
+  my $type = "WARNING";
+  if ($isError eq "true") {$type = "ERROR";} 
+  $sErrorMsg = $sErrorMsg."\n[$type] ".$msg;
+}
+
+sub getLastErrorMsg
+{
+  return $sErrorMsg;
+}
+
+sub setDbgFile
+{
+  $dbgfile = shift;
+}
+
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/CheckBuildEnv.pl	Tue Aug 18 15:39:56 2009 +0100
@@ -0,0 +1,73 @@
+## @file BuildEnvXML.pl
+# @ingroup userscripts clientscripts
+#
+# Uses information which is defined in the BuildEnvXML.xml to set up a machine
+# specific environment, such as path for compilers. 
+#
+# @todo Document this script.
+#
+# Copyright (c) 2009 Symbian Foundation  Ltd. All rights reserved.
+#
+
+package BuildEnvXML;
+
+use Getopt::Long;
+use BuildEnvXML qw(&getToolEnvironment &getLastErrorMsg);
+
+my $toolenvxml = "";
+my $dbgfile = "";
+my $sbsconfig = "";
+my $toolsconfig = "";
+
+GetOptions ("xml=s" => \$toolenvxml, "dbg:s" => \$dbgfile, "sbs:s" => \$sbsconfig, "tools:s" => \$sbsconfig); 
+
+my @contexts = @ARGV;
+
+if ($toolenvxml eq "")
+{
+	print ("ERROR: XML file cannot be found!\n");
+}
+
+# Checking the SBS config to test only what's necessary for that build
+if ($sbsconfig =~ /armv5/i)
+{
+	push @contexts, "ARMv5";
+}
+
+# Checking the tools config to test only what's necessary for that build
+if ($sbsconfig =~ /tools[^2]?(,|$|_)/i)
+{
+	push @contexts, "tools";
+}
+
+my $sErrMsg;
+my $result = 0;
+
+if (-e $dbgfile)
+{
+	unlink($dbgfile);
+}
+
+&setDbgFile($dbgfile);
+
+foreach my $context (@contexts){
+	print "\n\n### Checking $context Tools ###\n";
+	my $sSystemPath = &getToolEnvironment($toolenvxml, $context);
+
+	$sErrMsg = &getLastErrorMsg;
+	if ($sErrMsg eq "") { $sErrMsg = "\nAll OK.\n";}
+	if($sErrMsg =~ /ERROR/)
+	{
+		print "\n$context Tools VERIFICATION FAILED:";
+		print $sErrMsg."\n\n";
+		$result = -1;
+	}else{
+		print "\n$context tools VERIFICATION PASSED:";
+		print $sErrMsg."\n\n";
+	}
+}
+if ($result ne 0)
+{
+	print "\n ==> PROGRAM STOPPED!!\n";
+}
+exit($result);
--- a/common/tools/ats/devices/c100726/EMULATOR_GENERIC_c100726.properties	Tue Aug 18 15:32:29 2009 +0100
+++ b/common/tools/ats/devices/c100726/EMULATOR_GENERIC_c100726.properties	Tue Aug 18 15:39:56 2009 +0100
@@ -7,7 +7,7 @@
 
 CONNECTION=emulator
 
-TEMPDIR=D:\\ats3
+TEMPDIR=C:\\apps\\ATS3\\tmp\\emulator
 
 CLASS=GenericTestableDevice
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/devices/lon-engbuild87/EMULATOR_GENERIC_LON-ENGBUILD87.properties	Tue Aug 18 15:39:56 2009 +0100
@@ -0,0 +1,24 @@
+
+NAME=GENERIC EMULATOR on LON-ENGBUILD87
+
+CATEGORY=hardware
+
+TYPE=WINSCW
+
+CONNECTION=emulator
+
+TEMPDIR=D:\\ats3
+
+CLASS=GenericTestableDevice
+
+HARNESS=GENERIC
+
+#reinstall files after reboot
+REINSTALL=false
+
+PLATFORM=WINSCW
+BUILD=udeb
+
+IMAGE=winscw_smoketest
+
+
--- a/common/tools/ats/devices/lon-engbuild87/EMULATOR_GENERIC_LONENGBUILD87.properties	Tue Aug 18 15:32:29 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-
-NAME=GENERIC EMULATOR on LON-ENGBUILD87
-
-CATEGORY=hardware
-
-TYPE=WINSCW
-
-CONNECTION=emulator
-
-TEMPDIR=D:\\ats3
-
-CLASS=GenericTestableDevice
-
-HARNESS=GENERIC
-
-#reinstall files after reboot
-REINSTALL=false
-
-PLATFORM=WINSCW
-BUILD=udeb
-
-IMAGE=winscw_smoketest
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/devices/lon-engbuild89/EMULATOR_GENERIC_LON-ENGBUILD89.properties	Tue Aug 18 15:39:56 2009 +0100
@@ -0,0 +1,22 @@
+
+NAME=GENERIC EMULATOR on LON-ENGBUILD89
+
+CATEGORY=hardware
+
+TYPE=WINSCW
+
+CONNECTION=emulator
+
+TEMPDIR=D:\\ATS3
+
+CLASS=GenericTestableDevice
+
+HARNESS=GENERIC
+
+#reinstall files after reboot
+REINSTALL=false
+
+PLATFORM=WINSCW
+BUILD=udeb
+
+IMAGE=winscw_smoketest
--- a/common/tools/ats/devices/lon-engbuild89/EMULATOR_GENERIC_LONENGBUILD89.properties	Tue Aug 18 15:32:29 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-
-NAME=GENERIC EMULATOR on LON-ENGBUILD89
-
-CATEGORY=hardware
-
-TYPE=WINSCW
-
-CONNECTION=emulator
-
-TEMPDIR=D:\\ATS3
-
-CLASS=GenericTestableDevice
-
-HARNESS=GENERIC
-
-#reinstall files after reboot
-REINSTALL=false
-
-PLATFORM=WINSCW
-BUILD=udeb
-
-IMAGE=winscw_smoketest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/devices/sym-build02/EMULATOR_GENERIC_SYM-BUILD02.properties	Tue Aug 18 15:39:56 2009 +0100
@@ -0,0 +1,22 @@
+
+NAME=GENERIC EMULATOR on SYM-BUILD02
+
+CATEGORY=hardware
+
+TYPE=WINSCW
+
+CONNECTION=emulator
+
+TEMPDIR=C:\\ATS3
+
+CLASS=GenericTestableDevice
+
+HARNESS=GENERIC
+
+#reinstall files after reboot
+REINSTALL=false
+
+PLATFORM=WINSCW
+BUILD=udeb
+
+IMAGE=winscw_smoketest
--- a/common/tools/ats/devices/sym-build02/EMULATOR_GENERIC_SYMBUILD02.properties	Tue Aug 18 15:32:29 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-
-NAME=GENERIC EMULATOR on SYM-BUILD02
-
-CATEGORY=hardware
-
-TYPE=WINSCW
-
-CONNECTION=emulator
-
-TEMPDIR=C:\\ATS3
-
-CLASS=GenericTestableDevice
-
-HARNESS=GENERIC
-
-#reinstall files after reboot
-REINSTALL=false
-
-PLATFORM=WINSCW
-BUILD=udeb
-
-IMAGE=winscw_smoketest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/listdir.py	Tue Aug 18 15:39:56 2009 +0100
@@ -0,0 +1,43 @@
+# 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:
+# mattd <mattd@symbian.org>
+#
+# Description:
+# listdir.py - Lists a directory contents.
+# listdir.py <directory> (<exclude_directory>)
+
+import os
+import re
+import sys
+import string
+from os.path import join, isfile
+
+def main():
+  directory = sys.argv[1]
+  exclude_dirs = []
+  if(len(sys.argv)>2):
+    x_dirs = string.lower(sys.argv[2])
+    exclude_dirs = re.split(',', x_dirs)
+  scandir(directory, exclude_dirs)
+
+def scandir(top, exclude_dirs):
+    fixpath = re.compile('\\\\')    
+    fixroot = re.compile('^%s\\\\' % top)
+    for root, dirs, files in os.walk(top, topdown=True):
+        for dirname in dirs:
+            if(string.lower(fixpath.sub('/',os.path.join(root,dirname))) in exclude_dirs):
+              dirs.remove(dirname)
+        for name in files:
+            filename = os.path.join(root, name)
+            fn = string.lower(fixpath.sub('/',fixroot.sub('',filename)))
+            print fn
+
+main()
--- a/sf-platform/build.xml	Tue Aug 18 15:32:29 2009 +0100
+++ b/sf-platform/build.xml	Tue Aug 18 15:39:56 2009 +0100
@@ -7,6 +7,12 @@
   * Property defaults
    -->
 
+  <!-- MattD - workaround until generating a model from package definitions works-->
+  <target name="sf-build-noprep" depends="sf-compile,sf-postbuild">
+    <echo>[SF-BUILD-NOPREP] (platform)</echo>
+    <echo>[SF-BUILD-NOPREP] WARNING: Not generating model from packages</echo>
+  </target>
+
   <!-- workaround until GenXML can merge v2.0.0 fragments -->
   <!--
     This target is effectively a callback, called from compile-main.