From 028e324b3266a6108163d325c30b830a35b90b4d Mon Sep 17 00:00:00 2001 From: jmkiley Date: Mon, 20 Jan 2020 22:41:54 -0800 Subject: [PATCH 1/5] [ios, macos] always enable SKU, update tests --- platform/darwin/src/http_file_source.mm | 5 ++--- platform/darwin/test/MGLResourceTests.mm | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm index a72a97e2994..6132ba7f9bb 100644 --- a/platform/darwin/src/http_file_source.mm +++ b/platform/darwin/src/http_file_source.mm @@ -207,10 +207,9 @@ BOOL isValidMapboxEndpoint(NSURL *url) { if (resource.usage == Resource::Usage::Offline) { [queryItems addObject:[NSURLQueryItem queryItemWithName:@"offline" value:@"true"]]; - } else { - // Only add SKU token to requests not tagged as "offline" usage. - [queryItems addObject:[NSURLQueryItem queryItemWithName:@"sku" value:MGLNativeNetworkManager.sharedManager.skuToken]]; } + + [queryItems addObject:[NSURLQueryItem queryItemWithName:@"sku" value:MGLNativeNetworkManager.sharedManager.skuToken]]; if (components.queryItems) { [queryItems addObjectsFromArray:components.queryItems]; diff --git a/platform/darwin/test/MGLResourceTests.mm b/platform/darwin/test/MGLResourceTests.mm index 7fcccc535c8..eb8cf849e15 100644 --- a/platform/darwin/test/MGLResourceTests.mm +++ b/platform/darwin/test/MGLResourceTests.mm @@ -62,8 +62,6 @@ - (void)testOfflineQueryParameterIsAddedForOfflineResource { ([item.name isEqualToString:@"a"] && [item.value isEqualToString:@"one"]) || ([item.name isEqualToString:@"b"] && [item.value isEqualToString:@"two"])) { foundCount++; - } - XCTAssertFalse([item.name isEqualToString:@"sku"]); } XCTAssert(foundCount == 3); From dc834040b5da85e8f881851fa0ee63bfa7f5f1d8 Mon Sep 17 00:00:00 2001 From: jmkiley Date: Mon, 20 Jan 2020 22:45:02 -0800 Subject: [PATCH 2/5] [ios, macos] update tests --- platform/darwin/test/MGLResourceTests.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/darwin/test/MGLResourceTests.mm b/platform/darwin/test/MGLResourceTests.mm index eb8cf849e15..17e070ed68b 100644 --- a/platform/darwin/test/MGLResourceTests.mm +++ b/platform/darwin/test/MGLResourceTests.mm @@ -60,11 +60,11 @@ - (void)testOfflineQueryParameterIsAddedForOfflineResource { for (NSURLQueryItem *item in components.queryItems) { if (([item.name isEqualToString:@"offline"] && [item.value isEqualToString:@"true"]) || ([item.name isEqualToString:@"a"] && [item.value isEqualToString:@"one"]) || - ([item.name isEqualToString:@"b"] && [item.value isEqualToString:@"two"])) { + ([item.name isEqualToString:@"b"] && [item.value isEqualToString:@"two"]) || [item.name isEqualToString:@"sku"])) { foundCount++; } - XCTAssert(foundCount == 3); + XCTAssert(foundCount == 4); #else // NOTE: Currently the macOS SDK does not supply the sku or offline query parameters for (NSURLQueryItem *item in components.queryItems) { From 119d97fcc95a124de8fefc500e6fc091ee976a6a Mon Sep 17 00:00:00 2001 From: jmkiley Date: Tue, 21 Jan 2020 10:38:51 -0800 Subject: [PATCH 3/5] [ios, macos] Missing } --- platform/darwin/test/MGLResourceTests.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/darwin/test/MGLResourceTests.mm b/platform/darwin/test/MGLResourceTests.mm index 17e070ed68b..f358bb12e6a 100644 --- a/platform/darwin/test/MGLResourceTests.mm +++ b/platform/darwin/test/MGLResourceTests.mm @@ -62,6 +62,7 @@ - (void)testOfflineQueryParameterIsAddedForOfflineResource { ([item.name isEqualToString:@"a"] && [item.value isEqualToString:@"one"]) || ([item.name isEqualToString:@"b"] && [item.value isEqualToString:@"two"]) || [item.name isEqualToString:@"sku"])) { foundCount++; + } } XCTAssert(foundCount == 4); From 0550beb426ad294c6fb9f312d7e00ade8c190902 Mon Sep 17 00:00:00 2001 From: jmkiley Date: Tue, 21 Jan 2020 11:56:14 -0800 Subject: [PATCH 4/5] [ios] extra ) --- platform/darwin/test/MGLResourceTests.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/darwin/test/MGLResourceTests.mm b/platform/darwin/test/MGLResourceTests.mm index f358bb12e6a..cf6a997ceae 100644 --- a/platform/darwin/test/MGLResourceTests.mm +++ b/platform/darwin/test/MGLResourceTests.mm @@ -60,7 +60,7 @@ - (void)testOfflineQueryParameterIsAddedForOfflineResource { for (NSURLQueryItem *item in components.queryItems) { if (([item.name isEqualToString:@"offline"] && [item.value isEqualToString:@"true"]) || ([item.name isEqualToString:@"a"] && [item.value isEqualToString:@"one"]) || - ([item.name isEqualToString:@"b"] && [item.value isEqualToString:@"two"]) || [item.name isEqualToString:@"sku"])) { + ([item.name isEqualToString:@"b"] && [item.value isEqualToString:@"two"]) || [item.name isEqualToString:@"sku"]) { foundCount++; } } From 79f089494454be70122c584605a5d7e14d4fe92a Mon Sep 17 00:00:00 2001 From: jmkiley Date: Tue, 21 Jan 2020 12:40:34 -0800 Subject: [PATCH 5/5] [ios] disable doc generation for ios-release --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 7aa497708cd..0e2f4c3fb51 100644 --- a/circle.yml +++ b/circle.yml @@ -1219,7 +1219,7 @@ jobs: - install-ios-packaging-dependencies - run: name: Build dynamic framework for device and simulator - command: make iframework + command: make iframework BUILD_DOCS=false no_output_timeout: 5m - deploy: name: Upload snapshot build to s3