author | Bob Rosenberg <bob.rosenberg@nokia.com> |
Mon, 18 Oct 2010 10:33:54 +0100 | |
changeset 660 | 66ff3e731c60 |
parent 645 | b8d81fa19e7d |
permissions | -rw-r--r-- |
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 : validate-policy.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 | 23 |
<!--* @package quality --> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
24 |
<project name="quality.validate-policy" 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 |
Policy file validation. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
27 |
</description> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
28 |
|
217 | 29 |
<!-- Location validate policy xml log. |
30 |
@type string |
|
31 |
@scope private |
|
32 |
--> |
|
179 | 33 |
<property name="validate.policy.log" location="${temp.build.dir}/${build.id}_validate-policy.summary.xml" /> |
217 | 34 |
<!-- Location of the LogXML output file. |
35 |
@type string |
|
36 |
@scope private |
|
37 |
--> |
|
179 | 38 |
<property name="validate.policy.log.xml" location="${temp.build.dir}/${build.id}_validate-policy.log.xml" /> |
217 | 39 |
<!-- Location of the CSV file that defines policy IDs. |
40 |
@type string |
|
41 |
--> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
42 |
<property name="validate.policy.csv" location="${helium.dir}/tests/minibuilds/compile/distribution.policy.extended_for_sf.id_status.csv" /> |
628 | 43 |
|
44 |
<!--* @property validate.policy.ignoreroot.enabled |
|
45 |
Skip the validation of the given root folders if set to true. |
|
46 |
@type boolean |
|
47 |
@scope public |
|
48 |
@since 11.0 |
|
49 |
--> |
|
50 |
||
51 |
<!--* @property validate.policy.ignoreroot |
|
52 |
Skip the validation of the given root folders if set to true. - deprecated: Start using validate.policy.ignoreroot.enabled. |
|
217 | 53 |
@type boolean |
628 | 54 |
@scope public |
55 |
@deprecated since 11.0 |
|
217 | 56 |
--> |
628 | 57 |
|
58 |
<!-- * @property internal.validate.policy.ignoreroot.enabled |
|
59 |
If the property is set to "true", if validate.policy.ignoreroot.enabled set to true. |
|
60 |
@type boolean |
|
61 |
@scope private |
|
62 |
--> |
|
63 |
<condition property="internal.validate.policy.ignoreroot.enabled" value="true" else="false"> |
|
64 |
<or> |
|
65 |
<istrue value="${validate.policy.ignoreroot.enabled}"/> |
|
66 |
<istrue value="${validate.policy.ignoreroot}"/> |
|
67 |
</or> |
|
68 |
</condition> |
|
69 |
||
70 |
||
71 |
||
588 | 72 |
<!-- Comma separated list of pattern for policy validation. |
73 |
Default value is, distribution.policy.s60,distribution.policy,distribution.policy.pp |
|
217 | 74 |
@type string |
75 |
--> |
|
588 | 76 |
<property name="validate.policy.pattern" value="distribution.policy.s60,distribution.policy,distribution.policy.pp" /> |
77 |
<!-- Comma separated list of filename to exclude while scanning for missing policy files. |
|
78 |
Default value is .static_wa,_ccmwaid.inf |
|
79 |
@type string |
|
80 |
--> |
|
81 |
<property name="validate.policy.exclude.pattern" value=".static_wa,_ccmwaid.inf" /> |
|
628 | 82 |
|
83 |
<!--* Set to true to validate distribution.policy.S60 files values. |
|
84 |
@type boolean |
|
85 |
@editable required |
|
86 |
@scope public |
|
87 |
@since 11.0 |
|
88 |
--> |
|
89 |
<property name="policy.file.validation.enabled" value="true"/> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
90 |
|
628 | 91 |
|
92 |
<!--* @property internal.policy.file.validation.enabled |
|
93 |
Set to run targets to validate distribution.policy.S60 files values if policy.file.validation.enabled set to true. |
|
94 |
@type boolean |
|
95 |
@scope private |
|
96 |
--> |
|
97 |
||
98 |
<!--* @property skip.policy-validation |
|
99 |
Set to false to disbale validate distribution.policy.S60 files values. - deprecated: Start using policy.file.validation.enabled property. |
|
100 |
@type boolean |
|
101 |
@editable required |
|
102 |
@scope public |
|
103 |
@deprecated since 11.0 |
|
104 |
--> |
|
105 |
||
106 |
<!-- Check, is distribution.policy.S60 files validation is enabled.--> |
|
107 |
<condition property="internal.policy.file.validation.enabled"> |
|
108 |
<and> |
|
109 |
<not> |
|
110 |
<isfalse value="${policy.file.validation.enabled}" /> |
|
111 |
</not> |
|
112 |
<not> |
|
113 |
<isset property="skip.policy-validation"/> |
|
114 |
</not> |
|
115 |
</and> |
|
116 |
</condition> |
|
117 |
||
118 |
||
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
119 |
<!-- Default path settings for policy validation. --> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
120 |
<path id="reference.policy.path.list"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
121 |
<pathelement path="${build.drive}/s60" /> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
122 |
</path> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
123 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
124 |
<!-- |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
125 |
This task scan the directory provided by the path element, and valitate the content of the |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
126 |
Distribution.policy.S60 file using some default rules. IDs could also be validate using a CSV input file. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
127 |
'ignoreroot' specifies to ignore the toplevel directory. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
128 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
129 |
e.g. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
130 |
<pre> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
131 |
<hlm:validatePolicyMacro output="${validate.policy.log}" |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
132 |
ids="${validate.policy.csv}" |
628 | 133 |
ignoreroot="${internal.validate.policy.ignoreroot.enabled}"> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
134 |
<path refid="reference.policy.path.list"/> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
135 |
</hlm:validatePolicyMacro> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
136 |
</pre> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
137 |
--> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
138 |
<scriptdef name="validatePolicyMacro" language="jython" uri="http://www.nokia.com/helium"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
139 |
<attribute name="output" /> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
140 |
<attribute name="ignoreroot" /> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
141 |
<attribute name="ids" /> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
142 |
<attribute name="pattern" /> |
588 | 143 |
<attribute name="excludes" /> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
144 |
<element name="path" type="path" /> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
145 |
<![CDATA[ |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
146 |
import integration.quality |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
147 |
import os |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
148 |
ignoreroot = False |
588 | 149 |
excludes = [] |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
150 |
if (attributes.get('ignoreroot') != None) and (str(attributes.get('ignoreroot')).lower() == "true"): |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
151 |
self.log("Ignoring root path.") |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
152 |
ignoreroot = True |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
153 |
|
588 | 154 |
if (attributes.get('excludes') != None): |
155 |
self.log("Adding excludes patterns.") |
|
156 |
excludes = [pattern.strip() for pattern in str(attributes.get('excludes')).split(',')] |
|
157 |
||
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
158 |
output = None |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
159 |
if attributes.get('output') is not None: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
160 |
self.log("Creating %s" % str(attributes.get('output'))) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
161 |
output = open(str(attributes.get('output')), "w+") |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
162 |
output.write("<?xml version=\"1.0\"?>\n<policyvalidation>\n") |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
163 |
components_per_file = {} |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
164 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
165 |
pattern = ['distribution.policy.s60'] |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
166 |
if attributes.get('pattern') != None: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
167 |
pattern = str(attributes.get('pattern')).split(',') |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
168 |
|
588 | 169 |
validator = integration.quality.PolicyValidator(pattern, ignoreroot=ignoreroot, excludes=excludes) |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
170 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
171 |
if attributes.get('ids') is not None: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
172 |
self.log("Loading policy ids from: %s" % str(attributes.get('ids'))) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
173 |
if not os.path.exists(str(attributes.get('ids'))): |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
174 |
self.log("ERROR: Could not find: %s" % str(attributes.get('ids')), project.MSG_ERR) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
175 |
else: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
176 |
for result in validator.load_policy_ids(str(attributes.get('ids'))): |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
177 |
self.log(str("%s: - %s - %s" % (result[0], result[1], result[2])), project.MSG_ERR) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
178 |
if output is not None: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
179 |
output.write(" <error type=\"%s\" message=\"%s\" value=\"%s\"/>\n" % (result[0], result[1], result[2])) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
180 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
181 |
for eid in range(elements.get("path").size()): |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
182 |
iterator = elements.get("path").get(int(eid)).iterator() |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
183 |
while iterator.hasNext(): |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
184 |
path = str(iterator.next()) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
185 |
self.log("Scanning " + path) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
186 |
for result in validator.validate(path): |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
187 |
self.log("%s: %s" % (result[0], result[1]), project.MSG_ERR) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
188 |
if output is not None: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
189 |
output.write(" <error type=\"%s\" message=\"%s\" value=\"%s\"/>\n" % (result[0], result[1], result[2])) |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
190 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
191 |
if output is not None: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
192 |
output.write("</policyvalidation>\n") |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
193 |
output.close() |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
194 |
]]> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
195 |
</scriptdef> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
196 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
197 |
<!-- |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
198 |
Parse all the path defined by 'reference.policy.path.list' and check all policy files. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
199 |
It generates an XML log defined by property 'validate.policy.log'. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
200 |
--> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
201 |
<target name="integration-validate-policy"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
202 |
<mkdir dir="${build.log.dir}"/> |
179 | 203 |
<mkdir dir="${post.log.dir}"/> |
217 | 204 |
<mkdir dir="${temp.build.dir}"/> |
588 | 205 |
<hlm:validatePolicyMacro output="${validate.policy.log}" ids="${validate.policy.csv}" |
628 | 206 |
ignoreroot="${internal.validate.policy.ignoreroot.enabled}" pattern="${validate.policy.pattern}" |
588 | 207 |
excludes="${validate.policy.exclude.pattern}"> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
208 |
<path refid="reference.policy.path.list" /> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
209 |
</hlm:validatePolicyMacro> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
210 |
<hlm:metadatarecord database="${metadata.dbfile}"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
211 |
<hlm:policymetadatainput> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
212 |
<fileset casesensitive="false" file="${validate.policy.log}/" /> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
213 |
</hlm:policymetadatainput> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
214 |
</hlm:metadatarecord> |
628 | 215 |
<hlm:generateBuildStatus file="${validate.policy.log}" /> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
216 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
217 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
218 |
<!-- |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
219 |
Render the policy validation xml file ('validate.policy.log') into an text output. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
220 |
--> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
221 |
<target name="render-validate-policy" depends="integration-validate-policy"> |
645 | 222 |
<fmpp sourceFile="${helium.dir}/tools/quality/templates/validate-policy.log.ftl" outputFile="${post.log.dir}/${build.id}_validate-policy.log"> |
628 | 223 |
<freemarkerLinks expandProperties="yes"> |
224 |
macro: ${helium.dir}/tools/common/templates/macro |
|
225 |
</freemarkerLinks> |
|
226 |
<data expandProperties="yes"> |
|
227 |
doc: xml(${validate.policy.log}) |
|
228 |
ant: antProperties() |
|
229 |
</data> |
|
230 |
</fmpp> |
|
645 | 231 |
<fmpp sourceFile="${helium.dir}/tools/quality/templates/validate-policy.log.xml.ftl" outputFile="${validate.policy.log.xml}"> |
628 | 232 |
<freemarkerLinks expandProperties="yes"> |
233 |
macro: ${helium.dir}/tools/common/templates/macro |
|
234 |
</freemarkerLinks> |
|
235 |
<data expandProperties="yes"> |
|
236 |
doc: xml(${validate.policy.log}) |
|
237 |
ant: antProperties() |
|
238 |
</data> |
|
239 |
</fmpp> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
240 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
241 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
242 |
<!-- Target that will apply regular IDO validation rules on Helium. --> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
243 |
<target name="validate-helium-policy"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
244 |
<hlm:validatePolicyMacro> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
245 |
<path> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
246 |
<pathelement path="${helium.dir}/" /> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
247 |
</path> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
248 |
</hlm:validatePolicyMacro> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
249 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
250 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
251 |
<!-- Policy validation target for IDO. Only detected ADO will get scanned. --> |
645 | 252 |
<target name="ido-validate-policy" if="internal.policy.file.validation.enabled"> |
253 |
<property name="policy.mapping.file" location="${build.output.dir}/build/ado_mapping_policy.ini" /> |
|
254 |
<hlm:createAdoMappingMacro adoMapFile="${policy.mapping.file}" mapForQuality="true"/> |
|
628 | 255 |
<hlm:record name="${temp.build.dir}/${build.id}_validate-policy.ant.log" action="start" /> |
645 | 256 |
<hlm:iniKeys2Path ini="${policy.mapping.file}" pathid="reference.policy.path.list"/> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
257 |
<runtarget target="render-validate-policy" /> |
628 | 258 |
<hlm:record name="${temp.build.dir}/${build.id}_validate-policy.ant.log" action="stop" /> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
259 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
260 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
261 |
</project> |