buildframework/helium/tools/preparation/synergy/ccmgetinput.ant.xml
author Zheng Shen <zheng.shen@nokia.com>
Wed, 13 Oct 2010 16:31:27 +0800
changeset 648 d5a8d436d33b
parent 645 b8d81fa19e7d
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     2
<!-- 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     3
============================================================================ 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     4
Name        : ccmgetinput.ant.xml 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     5
Part of     : Helium 
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     6
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     8
All rights reserved.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
     9
This component and the accompanying materials are made available
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    11
which accompanies this distribution, and is available
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    13
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    14
Initial Contributors:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    16
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    17
Contributors:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    18
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    19
Description:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    20
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    21
============================================================================
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    22
-->
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    23
<!--* @package preparation -->
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    24
<project name="ccmgetinput" xmlns:hlm="http://www.nokia.com/helium">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    25
    <description>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    26
      Retrieves content from Synergy
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    27
    </description>
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    28
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    29
    <!--* @property ccm.home.dir
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    30
    Home directory of CCM operations.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    31
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    32
    @editable required
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    33
    @scope public
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    34
    -->
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    35
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    36
    <!--* @property ccm.database
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    37
    Name of the CCM database to use. No default value.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    38
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    39
    @editable required
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    40
    @scope public
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    41
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    42
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    43
    <!--* @property ccm.engine.host
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    44
    Engine host of CCM database. No default value.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    45
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    46
    @editable required
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    47
    @scope public
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    48
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    49
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    50
    <!--* @property prep.delivery.file
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    51
    Defines configuration file used in synergy operations (ccm-get-input for example). This file contains definition of projects that are checkouted or snapshotted.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    52
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    53
    @editable required
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    54
    @scope public
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents: 179
diff changeset
    55
    -->
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    56
        
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    57
    <!-- This target uses an XML input file to retrieve content from Synergy.
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    58
      -->
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    59
    <target name="prep-work-area" depends="log-build-start" if="internal.ccm.enabled">
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    60
        <hlm:tempRecordStartMacro name="${build.id}_ccm_get_input.log" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    61
        <runtarget target="get-ccm-password"/>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    62
        <runtarget target="ccm-prepare-input"/>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    63
        
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    64
        <hlm:assertPropertySet property="prep.delivery.file" message="Property prep.delivery.file is not defined." />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    65
        <trycatch>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    66
            <try>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    67
                <hlm:python failonerror="true">
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    68
import preparation
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    69
import configuration
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    70
import traceback
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    71
import logging            
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    72
import ant
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    73
import sys
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    74
import os.path
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    75
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    76
# enabling logging
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    77
logging.basicConfig(level=logging.INFO)
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    78
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    79
configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    80
configSet = configBuilder.getConfiguration()
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    81
password = ant.get_property(r'${ccm.user.password}')
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    82
builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    83
try:
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    84
    builder.check()
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    85
    builder.get_content()
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    86
finally:
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    87
    builder.close()
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    88
                </hlm:python>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    89
            </try>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    90
            <finally>
179
d8ac696cc51f helium_7.0-r14027
wbernard
parents: 1
diff changeset
    91
                <hlm:tempRecordStopMacro name="${build.id}_ccm_get_input.log" filterref="filterset.prepWorkArea" phase="prep"/>
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    92
                <hlm:assertFileExists file="${build.cache.log.dir}/${build.id}_ccm_get_input.log" />
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    93
            </finally>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    94
        </trycatch>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    95
    </target>
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
    96
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    97
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    98
    <!--
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
    99
     This target will cleanup all snapshoted/checkout project from the disk. Checked out project will
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   100
     also be deleted from the synergy database. 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   101
     -->
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
   102
    <target name="cleanup-work-area" if="internal.ccm.enabled">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   103
        <hlm:tempRecordStartMacro name="${build.id}_cleanup_work_area.log" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   104
        <runtarget target="get-ccm-password"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   105
        <runtarget target="ccm-prepare-input"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   106
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   107
        <hlm:assertPropertySet property="prep.delivery.file" message="Property prep.delivery.file is not defined." />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   108
        <trycatch>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   109
            <try>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   110
                <hlm:python failonerror="true">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   111
import preparation
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   112
import configuration
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   113
import traceback
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   114
import logging            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   115
import ant
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   116
import sys
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   117
import os.path
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   118
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   119
# enabling logging
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   120
logging.basicConfig(level=logging.INFO)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   121
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   122
configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   123
configSet = configBuilder.getConfiguration()
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   124
password = ant.get_property(r'${ccm.user.password}')
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   125
builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   126
try:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   127
    builder.cleanup()
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   128
finally:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   129
    builder.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   130
                </hlm:python>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   131
            </try>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   132
            <finally>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   133
                <hlm:tempRecordStopMacro name="${build.id}_cleanup_work_area.log" filterref="filterset.prepWorkArea" phase="prep"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   134
                <hlm:assertFileExists file="${build.cache.log.dir}/${build.id}_cleanup_work_area.log" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   135
            </finally>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   136
        </trycatch>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   137
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents: 217
diff changeset
   138
    
1
be27ed110b50 Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff changeset
   139
</project>