buildframework/helium/tools/preparation/synergy/ccmgetinput.ant.xml
changeset 1 be27ed110b50
child 179 d8ac696cc51f
equal deleted inserted replaced
0:044383f39525 1:be27ed110b50
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!-- 
       
     3 ============================================================================ 
       
     4 Name        : ccmgetinput.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="ccmgetinput" xmlns:hlm="http://www.nokia.com/helium">
       
    24     <description>
       
    25       Retrieves content from Synergy
       
    26     </description>
       
    27 
       
    28     <hlm:logfilterset id="prepWorkArea.logextract.config">
       
    29         <logfilter category="error" regex="^ERROR:" />
       
    30         <logfilter category="warning" regex="^WARNING:" />
       
    31         <logfilter category="info" regex="^INFO:" />
       
    32     </hlm:logfilterset>
       
    33 
       
    34     
       
    35     <!-- This target uses an XML input file to retrieve content from Synergy.
       
    36       -->
       
    37     <target name="prep-work-area" depends="log-build-start" if="run.ccm">
       
    38         <hlm:tempRecordStartMacro name="${build.id}_ccm_get_input.log" />
       
    39         <runtarget target="get-ccm-password"/>
       
    40         <runtarget target="ccm-prepare-input"/>
       
    41         
       
    42         <hlm:assertPropertySet property="prep.delivery.file" message="Property prep.delivery.file is not defined." />
       
    43         <trycatch>
       
    44             <try>
       
    45                 <hlm:python failonerror="true">
       
    46 import preparation
       
    47 import configuration
       
    48 import traceback
       
    49 import logging            
       
    50 import ant
       
    51 import sys
       
    52 import os.path
       
    53 
       
    54 # enabling logging
       
    55 logging.basicConfig(level=logging.INFO)
       
    56 
       
    57 builder = None           
       
    58 try:
       
    59     configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
       
    60     configSet = configBuilder.getConfiguration()
       
    61     builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), ant.get_property(r'${ccm.user.password}'), cache=ant.get_property(r'${ccm.cache.xml}'))
       
    62     builder.check()
       
    63     builder.get_content()
       
    64     builder.close()
       
    65 except Exception, e:
       
    66     print "ERROR: error found during preparation phase:" 
       
    67     for l in traceback.format_exc().splitlines(False):
       
    68         print "ERROR: %s" % l         
       
    69     print "ERROR: this is a critical error, build will fail now:"
       
    70     for l in str(e).splitlines(False):
       
    71         print "ERROR: %s" % l         
       
    72     if builder != None:
       
    73         builder.close()
       
    74     sys.exit(-1)
       
    75 sys.exit(0)
       
    76                 </hlm:python>
       
    77             </try>
       
    78             <finally>
       
    79                 <hlm:tempRecordStopMacro name="${build.id}_ccm_get_input.log" filterref="filterset.prepWorkArea"/>
       
    80                 <hlm:assertFileExists file="${build.cache.log.dir}/${build.id}_ccm_get_input.log" />
       
    81             </finally>
       
    82         </trycatch>
       
    83     </target>
       
    84 
       
    85     <!--
       
    86         This target uses an XML input file to retrieve content from Synergy.
       
    87         <deprecated>Please use prep-work-area</deprecated>
       
    88     -->
       
    89     <target name="ccm-get-input" depends="prep-work-area" />
       
    90 
       
    91 </project>