buildframework/helium/tools/startup/antserver/remote.ant.xml
changeset 1 be27ed110b50
child 217 0f5e3a7fb6af
equal deleted inserted replaced
0:044383f39525 1:be27ed110b50
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!-- 
       
     3 ============================================================================ 
       
     4 Name        : remote.ant.xml 
       
     5 Part of     : Helium 
       
     6 
       
     7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     8 All rights reserved.
       
     9 This component and the accompanying materials are made available
       
    10 under the terms of the License "Eclipse Public License v1.0"
       
    11 which accompanies this distribution, and is available
       
    12 at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    13 
       
    14 Initial Contributors:
       
    15 Nokia Corporation - initial contribution.
       
    16 
       
    17 Contributors:
       
    18 
       
    19 Description:
       
    20 
       
    21 ============================================================================
       
    22 -->
       
    23 <project name="startup.remote">
       
    24     <description>Local actions to setup remote builds.</description>
       
    25     
       
    26     <!-- Tars a complete work area to distribute to other machines. -->
       
    27     <target name="tar-work-area">
       
    28         <tstamp>
       
    29             <format property="workarea.timestamp" pattern="yyyyMMdd_HHmmss"/>
       
    30         </tstamp>
       
    31         <echo message="In 10s the \${minor.version} directory will be tarred from the ${ccm.home.dir} directory into ${ccm.home.dir}\WorkArea_${env.COMPUTERNAME}_${workarea.timestamp}.tgz. Press Ctrl-C to stop."/>
       
    32         <sleep seconds="10"/>
       
    33         <shellscript shell="cmd.exe" tmpsuffix=".bat" dir="${ccm.home.dir}">
       
    34             <arg value="/c"/>
       
    35             <arg value="call"/>
       
    36             tar --create ${minor.version} | gzip  >${ccm.home.dir}\WorkArea_${env.COMPUTERNAME}_${workarea.timestamp}.tgz
       
    37         </shellscript>
       
    38     </target>
       
    39 
       
    40 
       
    41     <!-- Uploads a tarball to a network location. -->
       
    42     <target name="upload-work-area" depends="tar-work-area">
       
    43         <copy file="${ccm.home.dir}\WorkArea_${env.COMPUTERNAME}_${workarea.timestamp}.tgz" todir="${work.area.temp.dir}"/>
       
    44         <property name="work.area.cache.file" value="${work.area.temp.dir}\WorkArea_${env.COMPUTERNAME}_${workarea.timestamp}.tgz"/>
       
    45     </target>
       
    46 
       
    47 
       
    48     <!-- Generates an Ant file containing commands to execute to run remote builds. -->
       
    49     <target name="gen-remote-tasks">
       
    50         <xslt in="${remote.builds.config.file}" out="${build.cache.dir}/${build.id}_remote_builds.ant.xml" style="${helium.dir}/tools/startup/antserver/remote_builds_to_ant_script.xslt" force="true"/>
       
    51     </target>
       
    52 
       
    53 
       
    54     <!-- Distributes a work area to remote machines. -->
       
    55     <target name="distribute-work-area" depends="upload-work-area,gen-remote-tasks">
       
    56         <ant antfile="${build.cache.dir}/${build.id}_remote_builds.ant.xml" target="do-distribute-work-area"/>
       
    57     </target>
       
    58     
       
    59     
       
    60     <!-- Checks that a remote machine has an Ant server running. -->
       
    61     <target name="check-server">
       
    62         <property name="machine" value="localhost"/>
       
    63         <remoteant machine="${machine}">
       
    64             <runtarget target="config"/>
       
    65         </remoteant>
       
    66     </target>
       
    67 
       
    68 
       
    69     <!-- Starts the remote builds defined in the remote build configuration file. -->
       
    70     <target name="start-remote-builds" depends="gen-remote-tasks">        
       
    71         <ant antfile="${build.cache.dir}/${build.id}_remote_builds.ant.xml" target="do-start-remote-builds"/>
       
    72         <!-- Sleep is needed to give enough time for the remote build operation to get sent. -->
       
    73         <sleep seconds="5"/>
       
    74     </target>
       
    75     
       
    76 </project>