summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-08-21 16:19:43 -0700
committerChris Loer <chris.loer@mapbox.com>2018-08-21 22:02:51 -0700
commitfd1767efba85dcfa5a3db27136306eca53519b8a (patch)
tree01be0a98566dfd07cf54fe0bcc53ebfa9675437c
parent33cd094d853f9c74aeaa1466e9fe6986db448139 (diff)
downloadqtlocation-mapboxgl-fd1767efba85dcfa5a3db27136306eca53519b8a.tar.gz
[core, test] Bump GL JS pin to bring gl-native back in sync with gl-js.
Requires changing `generate-style-code` to treat 'formatted' as being the same as 'string' until gl-native gets 'formatted' support with https://github.com/mapbox/mapbox-gl-native/pull/12624. To make nitpick happy, PropertyFunction.java uses the latest "text-field" description from v8.json. It's technically correct, just kind of pointless since the "If a plain `string` is provided" clause will always be true.
m---------mapbox-gl-js0
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java4
-rwxr-xr-xplatform/android/scripts/generate-style-code.js7
-rwxr-xr-xplatform/darwin/scripts/generate-style-code.js11
-rw-r--r--platform/node/test/ignores.json12
-rwxr-xr-xscripts/generate-style-code.js2
6 files changed, 33 insertions, 3 deletions
diff --git a/mapbox-gl-js b/mapbox-gl-js
-Subproject 6c22a1720dac51eac1c898ca06b3e2f24dbe081
+Subproject 754ec0bf51c3798d096aa38c3f009dcb58d3be7
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java
index 1cedf8c9ca..cd7bd473f3 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java
@@ -2055,7 +2055,7 @@ public class PropertyFactory {
}
/**
- * Value to use for a text label.
+ * Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
*
* @param value a String value
* @return property wrapper around String
@@ -2065,7 +2065,7 @@ public class PropertyFactory {
}
/**
- * Value to use for a text label.
+ * Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
*
* @param value a String value
* @return property wrapper around String
diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js
index 98c5a446b9..0825ef1c26 100755
--- a/platform/android/scripts/generate-style-code.js
+++ b/platform/android/scripts/generate-style-code.js
@@ -55,6 +55,7 @@ global.propertyType = function propertyType(property) {
return 'Boolean';
case 'number':
return 'Float';
+ case 'formatted':
case 'string':
return 'String';
case 'enum':
@@ -74,6 +75,7 @@ global.propertyJavaType = function propertyType(property) {
return 'boolean';
case 'number':
return 'float';
+ case 'formatted':
case 'string':
return 'String';
case 'enum':
@@ -121,6 +123,7 @@ global.propertyNativeType = function (property) {
return 'bool';
case 'number':
return 'float';
+ case 'formatted':
case 'string':
return 'std::string';
case 'enum':
@@ -155,6 +158,7 @@ global.defaultExpressionJava = function(property) {
return 'boolean';
case 'number':
return 'number';
+ case 'formatted':
case 'string':
return "string";
case 'enum':
@@ -179,6 +183,7 @@ global.defaultValueJava = function(property) {
return 'true';
case 'number':
return '0.3f';
+ case 'formatted':
case 'string':
return '"' + property['default'] + '"';
case 'enum':
@@ -187,6 +192,7 @@ global.defaultValueJava = function(property) {
return '"rgba(0, 0, 0, 1)"';
case 'array':
switch (property.value) {
+ case 'formatted':
case 'string':
return '[' + property['default'] + "]";
case 'number':
@@ -301,6 +307,7 @@ global.evaluatedType = function (property) {
return 'bool';
case 'number':
return 'float';
+ case 'formatted':
case 'string':
return 'std::string';
case 'enum':
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 0e5bf89fd4..e89a4e29a3 100755
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -102,6 +102,7 @@ global.objCTestValue = function (property, layerType, arraysAsStructs, indent) {
return property.default ? '@"false"' : '@"true"';
case 'number':
return '@"1"';
+ case 'formatted':
case 'string':
return `@"'${_.startCase(propertyName)}'"`;
case 'enum':
@@ -146,6 +147,7 @@ global.mbglTestValue = function (property, layerType) {
return property.default ? 'false' : 'true';
case 'number':
return '1.0';
+ case 'formatted':
case 'string':
return `"${_.startCase(propertyName)}"`;
case 'enum': {
@@ -218,6 +220,7 @@ global.testHelperMessage = function (property, layerType, isFunction) {
return 'testBool' + fnSuffix;
case 'number':
return 'testNumber' + fnSuffix;
+ case 'formatted':
case 'string':
return 'testString' + fnSuffix;
case 'enum':
@@ -385,6 +388,7 @@ global.describeType = function (property) {
return 'Boolean';
case 'number':
return 'numeric';
+ case 'formatted':
case 'string':
return 'string';
case 'enum':
@@ -428,6 +432,7 @@ global.describeValue = function (value, property, layerType) {
return value ? '`YES`' : '`NO`';
case 'number':
return 'the float ' + '`' + formatNumber(value) + '`';
+ case 'formatted':
case 'string':
if (value === '') {
return 'the empty string';
@@ -509,6 +514,7 @@ global.propertyType = function (property) {
return 'NSNumber *';
case 'number':
return 'NSNumber *';
+ case 'formatted':
case 'string':
return 'NSString *';
case 'enum':
@@ -539,7 +545,8 @@ global.isInterpolatable = function (property) {
const type = property.type === 'array' ? property.value : property.type;
return type !== 'boolean' &&
type !== 'enum' &&
- type !== 'string';
+ type !== 'string' &&
+ type !== 'formatted';
};
global.valueTransformerArguments = function (property) {
@@ -549,6 +556,7 @@ global.valueTransformerArguments = function (property) {
return ['bool', objCType];
case 'number':
return ['float', objCType];
+ case 'formatted':
case 'string':
return ['std::string', objCType];
case 'enum':
@@ -582,6 +590,7 @@ global.mbglType = function(property) {
return 'bool';
case 'number':
return 'float';
+ case 'formatted':
case 'string':
return 'std::string';
case 'enum': {
diff --git a/platform/node/test/ignores.json b/platform/node/test/ignores.json
index 18e9e11c49..2d46317a95 100644
--- a/platform/node/test/ignores.json
+++ b/platform/node/test/ignores.json
@@ -1,5 +1,9 @@
{
"expression-tests/collator/accent-equals-de": "Locale-specific behavior changes based on platform.",
+ "expression-tests/formatted/basic": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
+ "expression-tests/formatted/to-string": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
+ "expression-tests/interpolate-hcl/linear": "https://github.com/mapbox/mapbox-gl-native/issues/8720",
+ "expression-tests/interpolate-lab/linear": "https://github.com/mapbox/mapbox-gl-native/issues/8720",
"expression-tests/is-supported-script/default": "This tests RTL text plugin behavior specific to GL JS",
"expression-tests/resolved-locale/basic": "Even the 'en' locale may not be present on some test systems.",
"query-tests/geometry/multilinestring": "needs investigation",
@@ -9,12 +13,16 @@
"query-tests/world-wrapping/point": "skip - needs issue",
"query-tests/circle-radius/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/circle-stroke-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
+ "query-tests/fill-extrusion-translate/multiple-layers": "https://github.com/mapbox/mapbox-gl-native/issues/12701",
+ "query-tests/fill-translate/multiple-layers": "https://github.com/mapbox/mapbox-gl-native/issues/12701",
"query-tests/line-gap-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/line-offset/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/line-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/feature-state/default": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/regressions/mapbox-gl-js#6555": "skip - no querySourceFeatures in mbgl-node; needs issue",
"render-tests/background-color/transition": "https://github.com/mapbox/mapbox-gl-native/issues/10619",
+ "render-tests/basic-v9/z0-wide": "https://github.com/mapbox/mapbox-gl-native/pull/12611",
+ "render-tests/bright-v9/z0-wide": "https://github.com/mapbox/mapbox-gl-native/pull/12611",
"render-tests/collator/resolved-locale": "Some test platforms don't resolve 'en' locale",
"render-tests/collator/default": "Some test platforms don't resolve 'en' locale",
"render-tests/debug/collision": "https://github.com/mapbox/mapbox-gl-native/issues/3841",
@@ -56,9 +64,13 @@
"render-tests/runtime-styling/image-add-sdf": "https://github.com/mapbox/mapbox-gl-native/issues/9847",
"render-tests/runtime-styling/paint-property-fill-flat-to-extrude": "https://github.com/mapbox/mapbox-gl-native/issues/6745",
"render-tests/runtime-styling/set-style-paint-property-fill-flat-to-extrude": "https://github.com/mapbox/mapbox-gl-native/issues/6745",
+ "render-tests/satellite-v9/z0-wide": "https://github.com/mapbox/mapbox-gl-native/pull/12611",
"render-tests/symbol-cross-fade/chinese": "https://github.com/mapbox/mapbox-gl-native/issues/10619",
"render-tests/symbol-placement/line-overscaled": "https://github.com/mapbox/mapbox-gl-js/issues/5654",
"render-tests/symbol-visibility/visible": "https://github.com/mapbox/mapbox-gl-native/issues/10409",
+ "render-tests/text-field/formatted-arabic": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
+ "render-tests/text-field/formatted-line": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
+ "render-tests/text-field/formatted": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
"render-tests/text-no-cross-source-collision/default": "skip - gl-js only",
"render-tests/text-pitch-alignment/auto-text-rotation-alignment-map": "https://github.com/mapbox/mapbox-gl-native/issues/9732",
"render-tests/text-pitch-alignment/map-text-rotation-alignment-map": "https://github.com/mapbox/mapbox-gl-native/issues/9732",
diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js
index 9a7b2842f7..236df0a921 100755
--- a/scripts/generate-style-code.js
+++ b/scripts/generate-style-code.js
@@ -37,6 +37,7 @@ global.evaluatedType = function (property) {
return 'bool';
case 'number':
return 'float';
+ case 'formatted':
case 'string':
return 'std::string';
case 'enum':
@@ -120,6 +121,7 @@ global.defaultValue = function (property) {
switch (property.type) {
case 'number':
return property.default;
+ case 'formatted':
case 'string':
return JSON.stringify(property.default || "");
case 'enum':