|
1 <?xml version="1.0" encoding="UTF-8"?> |
|
2 <!-- |
|
3 ============================================================================ |
|
4 Name : ivalidate_overlay.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="integration.validate-overlay" xmlns:hlm="http://www.nokia.com/helium"> |
|
24 <description>Validation and merging of overlays to resolve conflicts.</description> |
|
25 |
|
26 <!-- Validates the overlay and outputs a log file listing any files that need to be merged |
|
27 because a more recent version is present in Synergy. --> |
|
28 <target name="validate-overlay" depends="get-ccm-password,ccm-prepare-input,prep-prepare-input"> |
|
29 <fail unless="prep.config.file"/> |
|
30 |
|
31 <delete file="${build.cache.dir}\validate_overlay.html" failonerror="false"/> |
|
32 <delete file="${build.cache.dir}\validate_overlay.xml" failonerror="false"/> |
|
33 <delete file="${build.cache.dir}\validate_overlay.input.xml" failonerror="false"/> |
|
34 |
|
35 <!-- Analysing and creating the Virtual Build area configuration --> |
|
36 <preset.exec executable="python" dir="${build.cache.dir}"> |
|
37 <arg file="${helium.dir}/tools/integration/validate_overlay/generate_vo_conf_${ccmgetinput}.py"/> |
|
38 <arg line="${prep.delivery.conf.parsed}"/> |
|
39 <arg line="${prep.config.file.parsed}"/> |
|
40 <arg line="${build.cache.dir}/validate_overlay.input.xml"/> |
|
41 </preset.exec> |
|
42 |
|
43 <hlm:python> |
|
44 import nokia.nokiaccm |
|
45 import sys |
|
46 import validateoverlay |
|
47 import ant |
|
48 import traceback |
|
49 session = None |
|
50 try: |
|
51 database = ant.get_property(r'${ccm.database}') |
|
52 username = ant.get_property(r'${ccm.user.login}') |
|
53 password = ant.get_property(r'${ccm.user.password}') |
|
54 engine = ant.get_property(r'${ccm.engine.host}') |
|
55 dbpath = ant.get_property(r'${ccm.database.path}') |
|
56 if database != None: |
|
57 session = nokia.nokiaccm.open_session(username, password, database=database) |
|
58 else: |
|
59 session = nokia.nokiaccm.open_session(username, password, engine, dbpath) |
|
60 |
|
61 objects = validateoverlay.get_additional_delivery_objects(session, ant.get_property(r'${prep.delivery.conf.parsed}')) |
|
62 # overlay validation |
|
63 #validate(session, inputfile, overlaydir, showBranchInfo, createtask=False, releasetag=None, extra_objects=[]): |
|
64 validateoverlay.validate(session, ant.get_property(r'${build.cache.dir}/validate_overlay.input.xml'), ant.get_property(r'${common.overlay.dir}'), True, False, None, objects, r'${build.cache.dir}\validate_overlay') |
|
65 |
|
66 session.close() |
|
67 except Exception, e: |
|
68 print "ERROR: %s" % e |
|
69 print traceback.format_exc() |
|
70 session.close() |
|
71 sys.exit(-1) |
|
72 sys.exit(0) |
|
73 </hlm:python> |
|
74 <preset.exec executable="cmd.exe"> |
|
75 <!--<arg line="/c ${env.TEMP}\validate_overlay.html"/>--> |
|
76 <arg line="/c ${build.cache.dir}\validate_overlay.html"/> |
|
77 </preset.exec> |
|
78 </target> |
|
79 |
|
80 |
|
81 <!-- Creates a task containing merged files. This must be manually reviewed and submitted. --> |
|
82 <target name="merge-overlay" depends="get-ccm-password,ccm-prepare-input,prep-prepare-input"> |
|
83 <fail unless="prep.config.file"/> |
|
84 |
|
85 <delete file="${build.cache.dir}\validate_overlay.html" failonerror="false"/> |
|
86 <delete file="${build.cache.dir}\validate_overlay.xml" failonerror="false"/> |
|
87 <delete file="${build.cache.dir}\validate_overlay.input.xml" failonerror="false"/> |
|
88 |
|
89 <!-- Analysing and creating the Virtual Build area configuration --> |
|
90 <preset.exec executable="python" dir="${build.cache.dir}"> |
|
91 <arg file="${helium.dir}/tools/integration/validate_overlay/generate_vo_conf_${ccmgetinput}.py"/> |
|
92 <arg line="${prep.delivery.conf.parsed}"/> |
|
93 <arg line="${prep.config.file.parsed}"/> |
|
94 <arg line="${build.cache.dir}/validate_overlay.input.xml"/> |
|
95 </preset.exec> |
|
96 <hlm:python> |
|
97 import nokia.nokiaccm |
|
98 import sys |
|
99 import validateoverlay |
|
100 import ant |
|
101 import traceback |
|
102 session = None |
|
103 try: |
|
104 database = ant.get_property(r'${ccm.database}') |
|
105 username = ant.get_property(r'${ccm.user.login}') |
|
106 password = ant.get_property(r'${ccm.user.password}') |
|
107 engine = ant.get_property(r'${ccm.engine.host}') |
|
108 dbpath = ant.get_property(r'${ccm.database.path}') |
|
109 if database != None: |
|
110 session = nokia.nokiaccm.open_session(username, password, database=database) |
|
111 else: |
|
112 session = nokia.nokiaccm.open_session(username, password, engine, dbpath) |
|
113 objects = validateoverlay.get_additional_delivery_objects(session, ant.get_property(r'${prep.delivery.conf.parsed}')) |
|
114 # overlay validation |
|
115 validateoverlay.validate(session, ant.get_property(r'${build.cache.dir}/validate_overlay.input.xml'), ant.get_property(r'${common.overlay.dir}'), True, True, 'mc/integration', objects, r'${build.cache.dir}\validate_overlay') |
|
116 |
|
117 session.close() |
|
118 except Exception, e: |
|
119 print "ERROR: %s" % e |
|
120 print traceback.format_exc() |
|
121 sys.exit(-1) |
|
122 sys.exit(0) |
|
123 </hlm:python> |
|
124 <preset.exec executable="cmd.exe"> |
|
125 <arg line="/c ${build.cache.dir}\validate_overlay.html"/> |
|
126 </preset.exec> |
|
127 </target> |
|
128 </project> |