bootstrap.xml
author Simon Howkins <simonh@symbian.org>
Wed, 13 Jan 2010 17:59:23 +0000
changeset 63 be578de158ab
parent 26 4f2349a6289f
child 64 b1cab4be73cc
permissions -rw-r--r--
Speed up by doing a pull and update when possible. Added stopwatch calls to identify where the time is spent. Re-organised to use a parameterised target to do the serious work.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d1c51edcc657 Initial drop of FBF bootstrap
Dario Sestito <dario.sestito@symbian.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
d1c51edcc657 Initial drop of FBF bootstrap
Dario Sestito <dario.sestito@symbian.com>
parents:
diff changeset
     2
<project name="SF-BOOTSTRAP" default="bootstrap" xmlns:hlm="http://www.nokia.com/helium">
7
e042f0022639 Fixed to enable the temp directory to be created in the right place, and avoid cluttering up the CWD.
Simon Howkins <simonh@symbian.org>
parents: 4
diff changeset
     3
    
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
     4
  <property environment="env"/>
0
d1c51edcc657 Initial drop of FBF bootstrap
Dario Sestito <dario.sestito@symbian.com>
parents:
diff changeset
     5
    
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
     6
  <dirname property="sf.bootstrap.dir" file="${ant.file.SF-CONFIG}"/>
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
     7
  
10
c1cbd33e46c0 reintroduced import of helium.ant.xml as it was generating diamonds warnings
BuildAdmin@LON-ENGBUILD89
parents: 9
diff changeset
     8
  <import file="${helium.dir}/helium.ant.xml" /> 
c1cbd33e46c0 reintroduced import of helium.ant.xml as it was generating diamonds warnings
BuildAdmin@LON-ENGBUILD89
parents: 9
diff changeset
     9
  
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    10
  <!-- target dir -->
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    11
  <property name="bootstrap.base.dir" value="D:\fbf_project"/> <!-- old name -->
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    12
  <property name="sf.target.dir" value="${bootstrap.base.dir}"/>
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    13
  
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    14
  <!-- config -->
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    15
  <property name="sf.config.repo" value="${sf.config.repository}"/> <!-- old name -->
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    16
  <property name="sf.config.rev" value="tip"/>
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    17
  <property name="sf.config.dir" value=""/>
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    18
  
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    19
  <!-- project -->
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    20
  <property name="sf.project.repo" value="${platform.config.repository}"/> <!-- old name -->
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    21
  <property name="sf.project.rev" value="tip"/>
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    22
  <property name="sf.project.dir" value=""/>
0
d1c51edcc657 Initial drop of FBF bootstrap
Dario Sestito <dario.sestito@symbian.com>
parents:
diff changeset
    23
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    24
  <target name="bootstrap" depends="init,get-sf-config,get-sf-project" description="Target for executing the bootstrap">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    25
    <stopwatch name="bootstrap" action="elapsed"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    26
  </target>
0
d1c51edcc657 Initial drop of FBF bootstrap
Dario Sestito <dario.sestito@symbian.com>
parents:
diff changeset
    27
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    28
  <target name="init">
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    29
    <stopwatch name="bootstrap"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    30
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    31
    <mkdir dir="${sf.target.dir}" />
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    32
    <mkdir dir="${sf.target.dir}/build" />
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    33
    <mkdir dir="${sf.target.dir}/build/config" />
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    34
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    35
    <echo message="config: repo=${sf.config.repo} rev=${sf.config.rev}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    36
    <echo message="project: repo=${sf.project.repo} rev=${sf.project.rev}"/>
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    37
  </target>
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    38
    
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    39
  <target name="clean-env">
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    40
    <echo message="cleaning up the environment" />
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    41
    <delete dir="${sf.target.dir}/" />
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    42
  </target>
0
d1c51edcc657 Initial drop of FBF bootstrap
Dario Sestito <dario.sestito@symbian.com>
parents:
diff changeset
    43
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    44
  <target name="get-sf-config">
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    45
    <antcall target="get-repo">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    46
      <param name="stopwatch.name" value="get-sf-config"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    47
      <param name="subdir.name" value="sf-config"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    48
      <param name="repo.dir" value="${sf.config.dir}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    49
      <param name="repo.url" value="${sf.config.repo}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    50
      <param name="repo.rev" value="${sf.config.rev}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    51
    </antcall>
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    52
  </target>
0
d1c51edcc657 Initial drop of FBF bootstrap
Dario Sestito <dario.sestito@symbian.com>
parents:
diff changeset
    53
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
    54
  <target name="get-sf-project">
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    55
    <antcall target="get-repo">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    56
      <param name="stopwatch.name" value="get-sf-project"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    57
      <param name="subdir.name" value="build/config"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    58
      <param name="repo.dir" value="${sf.project.dir}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    59
      <param name="repo.url" value="${sf.project.repo}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    60
      <param name="repo.rev" value="${sf.project.rev}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    61
    </antcall>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    62
  </target>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    64
  <target name="get-repo">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    65
    <stopwatch name="${stopwatch.name}"/>
16
e1b9f78cef38 Project spec and config to be taken from a dir instead of from a repo
darios@symbian.org
parents: 10
diff changeset
    66
    <if>
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    67
      <not>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    68
        <equals arg1="${repo.dir}" arg2=""/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    69
      </not>
16
e1b9f78cef38 Project spec and config to be taken from a dir instead of from a repo
darios@symbian.org
parents: 10
diff changeset
    70
      <then>
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    71
        <echo message="Getting FBF configuration from dir ${repo.dir}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    72
        <copy todir="${sf.target.dir}/${subdir.name}">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    73
          <fileset dir="${repo.dir}"/>
16
e1b9f78cef38 Project spec and config to be taken from a dir instead of from a repo
darios@symbian.org
parents: 10
diff changeset
    74
        </copy>
e1b9f78cef38 Project spec and config to be taken from a dir instead of from a repo
darios@symbian.org
parents: 10
diff changeset
    75
      </then>
e1b9f78cef38 Project spec and config to be taken from a dir instead of from a repo
darios@symbian.org
parents: 10
diff changeset
    76
      <else>
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    77
        <echo message="Getting ${repo.url}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    78
        <if>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    79
          <available file="${sf.target.dir}/${subdir.name}/.hg" type="dir"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    80
          <then>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    81
            <echo message="Updating ${sf.target.dir}/${subdir.name}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    82
            <exec executable="hg" dir="${sf.target.dir}/${subdir.name}">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    83
              <arg value="pull"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    84
              <arg value="${repo.url}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    85
            </exec>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    86
            <exec executable="hg" dir="${sf.target.dir}/${subdir.name}">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    87
              <arg value="up"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    88
              <arg value="${repo.rev}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    89
              <arg value="-C"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    90
            </exec>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    91
          </then>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    92
          <else>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    93
            <hlm:scm verbose="true" scmUrl="scm:hg:${repo.url}">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    94
              <hlm:checkout basedir="${sf.target.dir}/${subdir.name}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    95
              <hlm:update basedir="${sf.target.dir}/${subdir.name}">
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    96
                <hlm:tag name="${repo.rev}"/>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    97
              </hlm:update>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    98
            </hlm:scm>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
    99
          </else>
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
   100
        </if>
16
e1b9f78cef38 Project spec and config to be taken from a dir instead of from a repo
darios@symbian.org
parents: 10
diff changeset
   101
      </else>
e1b9f78cef38 Project spec and config to be taken from a dir instead of from a repo
darios@symbian.org
parents: 10
diff changeset
   102
    </if>
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
   103
    <stopwatch name="${stopwatch.name}" action="elapsed"/>
9
faf8e4898015 Cleaned the bootstrap code
BuildAdmin@LON-ENGBUILD89
parents: 7
diff changeset
   104
  </target>
1
ebb0926c7024 Update with latest changes
shaberazvi@L063442.prod.ad.symbian.intra
parents: 0
diff changeset
   105
63
be578de158ab Speed up by doing a pull and update when possible.
Simon Howkins <simonh@symbian.org>
parents: 26
diff changeset
   106
</project>