You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/09/19 22:13:04 UTC
git commit: CB-7601 Build fails due to capabilities with m: prefixes
are incorrectly sorted
Repository: cordova-windows
Updated Branches:
refs/heads/master eb3a46887 -> 36b20a7b4
CB-7601 Build fails due to capabilities with m: prefixes are incorrectly sorted
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/36b20a7b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/36b20a7b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/36b20a7b
Branch: refs/heads/master
Commit: 36b20a7b431aeb57e28201e04fc9cb80143b2943
Parents: eb3a468
Author: sgrebnov <v-...@microsoft.com>
Authored: Fri Sep 19 15:06:13 2014 +0400
Committer: sgrebnov <v-...@microsoft.com>
Committed: Fri Sep 19 15:06:13 2014 +0400
----------------------------------------------------------------------
windows/template/cordova/lib/prepare.js | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/36b20a7b/windows/template/cordova/lib/prepare.js
----------------------------------------------------------------------
diff --git a/windows/template/cordova/lib/prepare.js b/windows/template/cordova/lib/prepare.js
index f28ebea..5e3f533 100644
--- a/windows/template/cordova/lib/prepare.js
+++ b/windows/template/cordova/lib/prepare.js
@@ -165,16 +165,25 @@ function applyAccessRules (config, manifest) {
}
function sortCapabilities(manifest) {
+
+ // removes namespace prefix (m3:Capability -> Capability)
+ // this is required since elementtree returns qualified name with namespace
+ function extractLocalName(tag) {
+ return tag.split(':').pop(); // takes last part of string after ':'
+ }
+
var capabilitiesRoot = manifest.find('.//Capabilities'),
capabilities = capabilitiesRoot._children || [];
// to sort elements we remove them and then add again in the appropriate order
capabilities.forEach(function(elem) { // no .clear() method
capabilitiesRoot.remove(0, elem);
+ // CB-7601 we need local name w/o namespace prefix to sort capabilities correctly
+ elem.localName = extractLocalName(elem.tag);
});
capabilities.sort(function(a, b) {
- return (a.tag > b.tag) ? 1: -1;
+ return (a.localName > b.localName) ? 1: -1;
});
- capabilities.forEach(function(elem){
+ capabilities.forEach(function(elem) {
capabilitiesRoot.append(elem);
});
}