summaryrefslogtreecommitdiff
path: root/platform/darwin/scripts/generate-style-code.js
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-12-12 23:05:09 -0800
committerGitHub <noreply@github.com>2016-12-12 23:05:09 -0800
commit1ab791c3dc15ee5d7bb8045e15a6ea4782b2e337 (patch)
treeec51874bf147d69f0cc793adf421b975324df0e2 /platform/darwin/scripts/generate-style-code.js
parente38b4b590df2f74b47e25df9c44f4152ef1c582c (diff)
downloadqtlocation-mapboxgl-1ab791c3dc15ee5d7bb8045e15a6ea4782b2e337.tar.gz
[ios, macos] Override references to property names in property requirements lists (#7391)
* [ios, macos] Refer to template images in documentation SDF icons are known as template images in AppKit and UIKit. * [ios, macos] Override property names in requirements
Diffstat (limited to 'platform/darwin/scripts/generate-style-code.js')
-rw-r--r--platform/darwin/scripts/generate-style-code.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 015bb19a78..de0e7d69a0 100644
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -15,6 +15,23 @@ _.forOwn(cocoaConventions, function (properties, kind) {
spec[kind][newName] = spec[kind][oldName];
spec[kind][newName].original = oldName;
delete spec[kind][oldName];
+
+ // Update requirements in other properties.
+ let updateRequirements = function (property, name) {
+ let requires = property.requires || [];
+ for (let i = 0; i < requires.length; i++) {
+ if (requires[i] in cocoaConventions[kind]) {
+ property.requires[i] = cocoaConventions[kind][requires[i]];
+ }
+ _.forOwn(requires[i], function (values, name, require) {
+ if (require in cocoaConventions[kind]) {
+ require[cocoaConventions[kind][name]] = values;
+ }
+ });
+ }
+ };
+ _.forOwn(spec[kind.replace(/^layout_/, 'paint_')], updateRequirements);
+ _.forOwn(spec[kind.replace(/^paint_/, 'layout_')], updateRequirements);
})
});