sf-platform/build.xml
author ShabeR@UK-SHABER
Mon, 27 Apr 2009 16:26:56 +0100
changeset 70 7f26de0cdae5
parent 69 c933fe776713
child 71 cc9038ba0f21
permissions -rw-r--r--
Include --check on CLEAN and also remove S60_bldmelast configuration. It didnt work anyway as s60cli.exe is not present.

<?xml version="1.0" encoding="UTF-8"?>
<project name="SF-PLATFORM-CONFIG" xmlns:hlm="http://www.nokia.com/helium">
  <!-- location of this config -->
  <dirname property="sf.platform.config.dir" file="${ant.file.SF-PLATFORM-CONFIG}"/>

  <!--
  * Property defaults
   -->

  <!--
  TODO if needed in future

  * Load platform specific properties.

   -->

  <!-- workaround until GenXML can merge v2.0.0 fragments -->
  <target name="create-canonical-sysdef-file">

    <runtarget target="preprocess-sysdef-files"/>
    <echo message="Exporting preprocessed System Definition"/>
    <if><istrue value="${sf.spec.splitbuild}"/>
       <then>
       <if><istrue value="${sf.spec.os.skipbuild}" />
            <then><echo message="Skipping OS sysdef creation"/></then>
       <else>
            <!-- TODO use better method to export or wait for GenXML fix?-->
            <copy file="${build.output.dir}\build\input\0000000000000001_system_model_os.xml"
            tofile="${canonical.sysdef.file}" failonerror="false" verbose="true"/>
       </else>
       </if>

       <if><istrue value="${sf.spec.s60.skipbuild}" />
            <then><echo message="Skipping S60 sysdef creation"/></then>
       <else>
            <!-- TODO use better method to export or wait for GenXML fix?-->
            <copy file="${build.output.dir}\build\input\0000000000000001_system_model_s60.xml"
            tofile="${canonical.sysdef.file}" failonerror="false" verbose="true"/>
	   </else>
	   </if>
	   </then>
	
	<else>
	    <!-- TODO use better method to export or wait for GenXML fix?-->
        <copy file="${build.output.dir}\build\input\*_system_model_os.xml"
        tofile="${canonical.sysdef.file}" failonerror="false" verbose="true"/>

	    <!-- TODO targets for single sysdef build -->
	    <runtarget target="sf-os-compile"/>
	</else>
        </if>

  </target>

  <!--
    == Name: PREPROCESS-SYSDEF-FILES
    ==
    == Desc: Override of default target in order to deal with symbian os
    ==       system_definition.xml that does not have /sf source prefix
    ==
    ==       TODO get this moved as a Helium core target?
    -->
  <target name="preprocess-sysdef-files">
        <mkdir dir="${build.output.dir}/build/input"/>
        <delete verbose="true">
            <fileset dir="${build.output.dir}/build/input/" includes="**"/>
        </delete>

        <for param="file">
            <resources refid="system.definition.files"/>
            <sequential>
                <copy todir="${build.output.dir}/build/input" verbose="true">
                    <fileset file="@{file}"/>
                    <filterchain>
                        <replaceregex pattern="bldFile=&quot;os" replace="bldFile=&quot;sf\\\\os" flags="gi"/>
                        <replaceregex pattern="mrp=&quot;os" replace="mrp=&quot;sf\\\\os" flags="gi"/>
                        <replaceregex pattern="bldFile=&quot;mw" replace="bldFile=&quot;sf\\\\mw" flags="gi"/>
                        <replaceregex pattern="mrp=&quot;mw" replace="mrp=&quot;sf\\\\mw" flags="gi"/>
                        <replaceregex pattern="bldFile=&quot;app" replace="bldFile=&quot;sf\\\\app" flags="gi"/>
                        <replaceregex pattern="mrp=&quot;app" replace="mrp=&quot;sf\\\\app" flags="gi"/>
                        <expandproperties/>
                    </filterchain>
                    <mapper>
                        <scriptmapper language="jep" src="${helium.dir}/tools/common/jep/unique_filename.jep"/>
                    </mapper>
                </copy>
            </sequential>
        </for>
    </target>

    <target name="generate-layers">
       <echo message="canno-file:${canonical.sysdef.file}"/>
       <echo message="raptor-filters:raptor_${sysdef.configuration}"/>

       <!-- All we want is a sysdef with the config name appended, so just copy it -->
       <echo message="INFO: Skip GenXML and copy sysdef to sysdef+config name"/>
       <copy file="${canonical.sysdef.file}" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>

	<copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml">
		<filterchain>
			<linecontainsregexp negate="true">
			  <regexp pattern="^\s*$"/>
			</linecontainsregexp>
		</filterchain>
	</copy>
	<delete file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
	</target>

  <!--
    == Name: SF-COMPILE
    ==
    == Desc: Override of common sf-compile target defined in
    ==       common\build.xml
    ==
    ==       os  build will be skipped if sf.spec.os.skipbuild=true
    ==       s60 build will be skipped if sf.spec.s60.skipbuild=true
    ==
    -->
  <target name="sf-compile">

    <!-- TODO clean up to single target once genxml v2.0.0 merge is fixed -->
    <if><istrue value="${sf.spec.splitbuild}"/>
       <then>
       <if><istrue value="${sf.spec.os.skipbuild}" />
            <then><echo message="Skipping OS build"/></then>
       <else><runtarget target="sf-os-compile"/></else></if>

       <if><istrue value="${sf.spec.s60.skipbuild}" />
            <then><echo message="Skipping S60 build"/></then>
       <else><runtarget target="sf-s60-compile"/></else></if>
	   </then>
	   <else>
	        <!-- TODO targets for single sysdef build -->
	        <runtarget target="sf-os-compile"/>
	   </else>
    </if>
  </target>

  <!--
    == Name: SF-OS-COMPILE
    ==
    == Desc: Compile OS part of build using the spec defined in:
    ==
    ==         - job_props.ant.xml
    ==         - job_refs.ant.xml
    ==
    -->
  <target name="sf-os-compile">

        <hlm:argSet id="sbs.tools2.var">
                <hlm:arg name="config" value="tools2_rel" />
                <hlm:arg name="singlejob" value="false" />
                <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
        </hlm:argSet>

		<hlm:argSet id="sbs.tools2.clean.var">
                <hlm:arg name="config" value="tools2_rel" />
                <hlm:arg name="singlejob" value="false" />
                <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
		<hlm:arg name="command" value="CLEAN --check" />
        </hlm:argSet>

        <hlm:argSet id="sbs.tools.var">
                <hlm:arg name="config" value="tools_rel" />
                <hlm:arg name="singlejob" value="true" />
                <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
        </hlm:argSet>

		<hlm:argSet id="sbs.tools.clean.var">
                <hlm:arg name="config" value="tools_rel" />
                <hlm:arg name="singlejob" value="true" />
                <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
		<hlm:arg name="command" value="CLEAN --check" />
        </hlm:argSet>

        <hlm:argSet id="sbs.main.sbs.var">
                <hlm:arg name="config" value="${sf.spec.sbs.config}" />
                <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
        </hlm:argSet>

		<hlm:argSet id="sbs.main.clean.sbs.var">
                <hlm:arg name="config" value="${sf.spec.sbs.config}" />
                <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
		<hlm:arg name="command" value="CLEAN --check" />
        </hlm:argSet>
		
		<hlm:argSet id="sbs.main.what.sbs.var">
                <hlm:arg name="config" value="${sf.spec.sbs.config}" />
                <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
		<hlm:arg name="command" value="WHAT" />
        </hlm:argSet>

        <hlm:sbsMakeOptions engine="gmake" id="sbs.toolsbuild.options" />
        <hlm:sbsMakeOptions engine="gmake" id="sbs.fullbuild.options" />

		<!-- generate baseline dir list to allow delta creation -->
		<antcall target="sf-list-dir" inheritAll="false">
			<param name="sf.list.name" value="baseline"/>
		</antcall>

		<!-- OS what -->
        <antcall target="compile-main" inheritAll="false" inheritRefs="true">
                <param name="build.system" value="${sf.spec.build.system}" />
                <param name="compile.sysdef.dtd.stub" value="${sf.spec.os.sysdef.dtd}" />
                <param name="sysdef.configurations.list" value="${sf.spec.os.sysdef.clean.configurations.list}" />
                <param name="sf.spec.sysdef.version" value ="${sf.spec.os.sysdef.version}"/>
                <reference refid="sbs.main.what.sbs.var" torefid="sbs.var" />
                <reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
                <reference refid="sf.spec.os.system.definition.files" torefid="system.definition.files" />
        </antcall>
		
		<!-- OS clean main build -->
        <antcall target="compile-main" inheritAll="false" inheritRefs="true">
                <param name="build.system" value="${sf.spec.build.system}" />
                <param name="compile.sysdef.dtd.stub" value="${sf.spec.os.sysdef.dtd}" />
                <param name="sysdef.configurations.list" value="${sf.spec.os.sysdef.clean.configurations.list}" />
                <param name="sf.spec.sysdef.version" value ="${sf.spec.os.sysdef.version}"/>
                <reference refid="sbs.main.clean.sbs.var" torefid="sbs.var" />
                <reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
                <reference refid="sf.spec.os.system.definition.files" torefid="system.definition.files" />
        </antcall>
		
		<antcall target="sf-list-dir" inheritAll="false">
			<param name="sf.list.name" value="post-clean"/>
		</antcall>

		<!-- what has been cleaned from baseline PDK by sos model -->
		<antcall target="sf-delta-dir" inheritAll="false">
			<param name="sf.list_a.name" value="baseline"/>
			<param name="sf.list_b.name" value="post-clean"/>
		</antcall>		
		
        <!-- OS tools2 build first-->
        <antcall target="compile-main" inheritAll="false" inheritRefs="true">
                <param name="build.system" value="${sf.spec.build.system}" />
                <param name="compile.sysdef.dtd.stub" value="${sf.spec.os.sysdef.dtd}" />
                <param name="sysdef.configurations.list" value="${sf.spec.os.sysdef.clean.configurations.list}" />
                <param name="sf.spec.sysdef.version" value ="${sf.spec.os.sysdef.version}"/>
                <reference refid="sbs.tools2.var" torefid="sbs.var" />
                <reference refid="sbs.toolsbuild.options" torefid="sbs.make.options" />
                <reference refid="sf.spec.os.system.definition.files" torefid="system.definition.files" />
        </antcall>

		<antcall target="sf-list-dir" inheritAll="false">
			<param name="sf.list.name" value="post-build-tools2"/>
		</antcall>
		
		
        <!-- OS tools build after tools2 -->
        <antcall target="compile-main" inheritAll="false" inheritRefs="true">
                <param name="build.system" value="${sf.spec.build.system}" />
                <param name="compile.sysdef.dtd.stub" value="${sf.spec.os.sysdef.dtd}" />
                <param name="sysdef.configurations.list" value="${sf.spec.os.sysdef.clean.configurations.list}" />
                <param name="sf.spec.sysdef.version" value ="${sf.spec.os.sysdef.version}"/>
                <reference refid="sbs.tools.var" torefid="sbs.var" />
                <reference refid="sbs.toolsbuild.options" torefid="sbs.make.options" />
                <reference refid="sf.spec.os.system.definition.files" torefid="system.definition.files" />
        </antcall>

		<antcall target="sf-list-dir" inheritAll="false">
			<param name="sf.list.name" value="post-build-tools"/>
		</antcall>
		
        <!-- OS main build -->
        <antcall target="compile-main" inheritAll="false" inheritRefs="true">
                <param name="build.system" value="${sf.spec.build.system}" />
                <param name="compile.sysdef.dtd.stub" value="${sf.spec.os.sysdef.dtd}" />
                <param name="sysdef.configurations.list" value="${sf.spec.os.sysdef.clean.configurations.list}" />
                <param name="sf.spec.sysdef.version" value ="${sf.spec.os.sysdef.version}"/>
                <reference refid="sbs.main.sbs.var" torefid="sbs.var" />
                <reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
                <reference refid="sf.spec.os.system.definition.files" torefid="system.definition.files" />
        </antcall>
		
		<antcall target="sf-list-dir" inheritAll="false">
			<param name="sf.list.name" value="post-build-main"/>
		</antcall>
		
		<!-- what has been built in tools2+tools+main -->
		<antcall target="sf-delta-dir" inheritAll="false">
			<param name="sf.list_a.name" value="post-clean"/>
			<param name="sf.list_b.name" value="post-build-main"/>
		</antcall>
		
		<!-- what has been cleaned and rebuilt -->
		<antcall target="sf-intersect-dir" inheritAll="false">
			<param name="sf.list_a.name" value="post-clean_delta"/>       <!-- clean list -->
			<param name="sf.list_b.name" value="post-build-main_delta"/>  <!-- built list -->
		</antcall>
		
		<!-- what has been cleaned and not rebuilt -->
		
  </target>

  <!--
    == Name: SF-S60-COMPILE
    ==
    == Desc: Compile S60 part of build using the spec defined in:
    ==
    ==         - job_props.ant.xml
    ==         - job_refs.ant.xml
    ==
    -->
  <target name="sf-s60-compile">

        <hlm:argSet id="sbs.tools.var">
          			<hlm:arg name="config" value="${sf.spec.sbs.tools.config}" />
          			<hlm:arg name="singlejob" value="true" />
          			<hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
    		</hlm:argSet>

			<hlm:argSet id="sbs.tools.clean.var">
          			<hlm:arg name="config" value="${sf.spec.sbs.tools.config}" />
          			<hlm:arg name="singlejob" value="true" />
          			<hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
    		</hlm:argSet>

    		<hlm:argSet id="sbs.main.sbs.var">
          			<hlm:arg name="config" value="${sf.spec.sbs.config}" />
          			<hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
    		</hlm:argSet>

			<hlm:argSet id="sbs.main.clean.sbs.var">
          			<hlm:arg name="config" value="${sf.spec.sbs.config}" />
          			<hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
				<hlm:arg name="command" value="CLEAN --check" />
    		</hlm:argSet>
			
			<hlm:argSet id="sbs.main.what.sbs.var">
          			<hlm:arg name="config" value="${sf.spec.sbs.config}" />
          			<hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
				<hlm:arg name="command" value="WHAT" />
    		</hlm:argSet>

    		<hlm:sbsMakeOptions engine="gmake" id="sbs.toolsbuild.options" />
    		<hlm:sbsMakeOptions engine="gmake" id="sbs.fullbuild.options" />

		<antcall target="sf-list-dir" inheritAll="false">
			<param name="sf.list.name" value="s60-baseline"/>
		</antcall>
		
			<!-- s60 what  -->
    		<antcall target="compile-main" inheritAll="false" inheritRefs="true">
          			<param name="build.system" value="${sf.spec.build.system}" />
          			<param name="sysdef.configurations.list" value="${sf.spec.s60.sysdef.clean.configurations.list}" />
                    <param name="sf.spec.sysdef.version" value="${sf.spec.s60.sysdef.version}"/>
          			<reference refid="sbs.main.what.sbs.var" torefid="sbs.var" />
          			<reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
          			<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
    		</antcall>
			
			<!-- s60 clean main build -->
    		<antcall target="compile-main" inheritAll="false" inheritRefs="true">
          			<param name="build.system" value="${sf.spec.build.system}" />
          			<param name="sysdef.configurations.list" value="${sf.spec.s60.sysdef.clean.configurations.list}" />
                    <param name="sf.spec.sysdef.version" value="${sf.spec.s60.sysdef.version}"/>
          			<reference refid="sbs.main.clean.sbs.var" torefid="sbs.var" />
          			<reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
          			<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
    		</antcall>

			<antcall target="sf-list-dir" inheritAll="false">
				<param name="sf.list.name" value="post-s60-clean"/>
			</antcall>
			
			<!-- what has been cleaned from baseline PDK by s60 model -->
			<antcall target="sf-delta-dir" inheritAll="false">
				<param name="sf.list_a.name" value="s60-baseline"/>
				<param name="sf.list_b.name" value="post-s60-clean"/>
			</antcall>		
			

            <!-- s60  tools build -->
    		<antcall target="compile-main" inheritAll="false" inheritRefs="true">
          			<param name="build.system" value="${sf.spec.build.system}" />
          			<param name="sysdef.configurations.list" value="${sf.spec.s60.sysdef.clean.configurations.list}" />
					<param name="sf.spec.sysdef.version" value ="${sf.spec.s60.sysdef.version}"/>
          			<reference refid="sbs.tools.var" torefid="sbs.var" />
          			<reference refid="sbs.toolsbuild.options" torefid="sbs.make.options" />
          			<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
    		</antcall>

			<antcall target="sf-list-dir" inheritAll="false">
				<param name="sf.list.name" value="post-s60-build-tools"/>
			</antcall>

    		<!-- s60 main build -->
    		<antcall target="compile-main" inheritAll="false" inheritRefs="true">
          			<param name="build.system" value="${sf.spec.build.system}" />
          			<param name="sysdef.configurations.list" value="${sf.spec.s60.sysdef.clean.configurations.list}" />
                                <param name="sf.spec.sysdef.version" value="${sf.spec.s60.sysdef.version}"/>
          			<reference refid="sbs.main.sbs.var" torefid="sbs.var" />
          			<reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
          			<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
    		</antcall>
			
			<antcall target="sf-list-dir" inheritAll="false">
				<param name="sf.list.name" value="post-s60-build-main"/>
			</antcall>

    		<!-- s60 postbuild bldmelast using ebs -->
    		<!-- Remove bldmelast for the moment
                                antcall target="compile-main" inheritAll="false">
          			<param name="build.system" value="ebs" />
          			<param name="sysdef.configurations.list" value="S60_bldmelast" />
          			<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
    		</antcall -->

			<antcall target="sf-list-dir" inheritAll="false">
				<param name="sf.list.name" value="post-s60-bldmelast"/>
			</antcall>

			<!-- what has been built by tools+2+main+bldmelast -->
			<antcall target="sf-delta-dir" inheritAll="false">
				<param name="sf.list_a.name" value="s60-baseline"/>
				<param name="sf.list_b.name" value="post-s60-bldmelast"/>
			</antcall>		
			
			<!-- what has been cleaned and rebuilt -->
			<antcall target="sf-intersect-dir" inheritAll="false">
				<param name="sf.list_a.name" value="post-s60-clean_delta"/>       <!-- clean list -->
				<param name="sf.list_b.name" value="post-s60-bldmelast_delta"/>  <!-- built list -->
			</antcall>
		
	</target>

  <!-- import sf-common-config -->
  <import file="../common/build.xml" />

</project>