bootstrap.xml
author shaberazvi@L063442.prod.ad.symbian.intra
Wed, 04 Mar 2009 16:51:58 +0000
changeset 3 c360fdfe164c
parent 1 ebb0926c7024
child 4 5a8eb3466f9f
permissions -rw-r--r--
Update

<?xml version="1.0" encoding="UTF-8"?>
<project name="SF-BOOTSTRAP" default="bootstrap" xmlns:hlm="http://www.nokia.com/helium">

    <dirname property="sf.bootstrap.dir" file="${ant.file.SF-CONFIG}"/>
    
    <import file="bootstrap.properties.ant.xml" />
    <import file="${helium.dir}/helium.ant.xml" />    

    <target name="bootstrap" depends="init,get-sf-config,get-platform-config, parse-platform-config,
                generate-pkg-build-xml" />

    <target name="init">
        <mkdir dir="${bootstrap.base.dir}" />
        <mkdir dir="${bootstrap.base.dir}/build" />
        <mkdir dir="${bootstrap.base.dir}/build/config" />
    </target>
    <target name="clean-env">
        <echo message="cleaning up the environment" />
        <delete dir="${bootstrap.base.dir}/" />
    </target>

    <target name="get-sf-config">
        <echo message="Getting sf helium configuration from repository ${sf.config.repository}" />
        <hlm:scm verbose="true" scmUrl="scm:hg:${sf.config.repository}">
            <hlm:checkout basedir="${bootstrap.base.dir}/sf-config"/>
        </hlm:scm>
    </target>

    <target name="get-sbs-tools">
        <!-- Todo: Move this to helium config or after parsing platform build configuration 
        to install the tools from there  -->
    	<if>
    		<not><available file="${bootstrap.base.dir}/sbs"/></not>
    		<then>
                <echo message="Extracting sbs tools ${sbs.tools.src.path}/${sbs.zip.file}" />
    			<unzip src="${sbs.tools.src.path}/${sbs.zip.file}" dest="${bootstrap.base.dir}" />
                <echo message="Updating sbs tools path to batch file" />
        	    <echo file="${bootstrap.base.dir}/build/env.bat" append="true" >set SBS_HOME=${bootstrap.base.dir}\sbs
set PATH=${bootstrap.base.dir}\sbs\bin;${bootstrap.base.dir}\sbs\win32\mingw\bin;${bootstrap.base.dir}\sbs\win32\cygwin\bin;%PATH%
        	    </echo>
    		</then>
   	    </if>
    </target>

    <target name="get-platform-config">
        <echo message="Getting platform configuration${platform.config.repository}" />
        <hlm:scm verbose="true" scmUrl="scm:hg:${platform.config.repository}">
            <hlm:checkout basedir="${bootstrap.base.dir}/build/config"/>
        </hlm:scm>
    </target>

    <target name="parse-platform-config">
        <!-- Todo: Parse the platform config and generate properties and csv file to be
            used by the builds. -->
        <echo message="Parse the platform configuration" />
    </target>
    
    <target name="generate-pkg-build-xml" depends="parse-platform-config">
        <!-- Todo: 1. Same file name hg-pkg-build.ant.xml is used for all packages
            for multiple package builds, this needs to be linked with package name. -->
        <fmpp sourceFile="${sf.bootstrap.dir}/templates/hg-pkg-build.ant.xml.ftl"
                     outputFile="${bootstrap.base.dir}/build/hg-pkg-build.ant.xml">
               <data expandProperties="yes">
                    ant: antProperties()
                    data: csv(${bootstrap.base.dir}/build/config/${hg.config}, {separator:','})
                </data>
        </fmpp>
    </target>
</project>