From 5f8aae1bce12659d16ef41d61a9185915a9f7813 Mon Sep 17 00:00:00 2001 From: Todd Anderson <127344469+tanderson-ld@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:41:57 -0500 Subject: [PATCH] prepare 9.2.0 release (#315) ## [9.2.0] - 2023-10-24 ### Changed: - Updated swift-tools-version from 5.2 to 5.3. ### Removed: - Removed support for iOS 11 and tvOS 11 to support XCode15. This is being released as a minor change because those platforms can no longer use any portion of this SDKs APIs. --------- Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com> Co-authored-by: torchhound <5600929+torchhound@users.noreply.github.com> Co-authored-by: Gavin Whelan Co-authored-by: Louis Chan Co-authored-by: Matthew Keeler Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com> Co-authored-by: Ember Stevens Co-authored-by: Ember Stevens <79482775+ember-stevens@users.noreply.github.com> Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com> Co-authored-by: Kane Parkinson <93555788+kparkinson-ld@users.noreply.github.com> --- .circleci/config.yml | 11 ++- CHANGELOG.md | 7 ++ ContractTests/Package.swift | 6 +- LaunchDarkly.podspec | 6 +- LaunchDarkly.xcodeproj/project.pbxproj | 80 +++++++++---------- .../ReportingConsts.swift | 2 +- LaunchDarkly/LaunchDarkly/Util.swift | 2 +- .../LaunchDarklyTests/Matcher/Match.swift | 41 ---------- .../Models/Context/LDContextCodableSpec.swift | 11 +-- .../Models/Context/ModifierSpec.swift | 2 +- LaunchDarkly/LaunchDarklyTests/UtilSpec.swift | 2 +- Package.swift | 6 +- README.md | 14 ++-- 13 files changed, 78 insertions(+), 112 deletions(-) delete mode 100644 LaunchDarkly/LaunchDarklyTests/Matcher/Match.swift diff --git a/.circleci/config.yml b/.circleci/config.yml index f0a20bc4..b00f6879 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 jobs: contract-tests: macos: - xcode: '14.2.0' + xcode: '15.0.0' steps: - checkout @@ -31,6 +31,9 @@ jobs: - run: command: make start-contract-test-service background: true + - run: + name: wait for contract test service to be ready + command: sleep 5 - run: name: run contract tests command: TEST_HARNESS_PARAMS="-junit /tmp/test-results/contract-tests-junit.xml" make run-contract-tests @@ -54,7 +57,7 @@ jobs: macos: xcode: <> - resource_class: macos.x86.medium.gen2 + resource_class: macos.m1.medium.gen1 steps: - checkout @@ -158,6 +161,10 @@ workflows: build: jobs: + - build: + name: Xcode 15.0.0 - Swift 5.9 + xcode-version: '15.0.0' + ios-sim: 'platform=iOS Simulator,name=iPhone 15,OS=17.0.1' - build: name: Xcode 14.0 - Swift 5.7 xcode-version: '14.0.1' diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eeb5445..9083b60d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to the LaunchDarkly iOS SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +## [9.2.0] - 2023-10-24 +### Changed: +- Updated swift-tools-version from 5.2 to 5.3. + +### Removed: +- Removed support for iOS 11 and tvOS 11 to support XCode15. This is being released as a minor change because those platforms can no longer use any portion of this SDKs APIs. + ## [9.1.1] - 2023-09-19 ### Fixed: - Fixed rare bug in key generation in some contexts generated by the Auto Environment Attributes feature. diff --git a/ContractTests/Package.swift b/ContractTests/Package.swift index 3341987b..59c2b8e8 100644 --- a/ContractTests/Package.swift +++ b/ContractTests/Package.swift @@ -1,14 +1,14 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 import PackageDescription let package = Package( name: "ContractTests", platforms: [ - .iOS(.v11), + .iOS(.v12), .macOS(.v10_15), .watchOS(.v4), - .tvOS(.v11) + .tvOS(.v12) ], products: [ .executable( diff --git a/LaunchDarkly.podspec b/LaunchDarkly.podspec index 771749e0..e82de522 100644 --- a/LaunchDarkly.podspec +++ b/LaunchDarkly.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |ld| ld.name = "LaunchDarkly" - ld.version = "9.1.1" + ld.version = "9.2.0" ld.summary = "iOS SDK for LaunchDarkly" ld.description = <<-DESC @@ -21,9 +21,9 @@ Pod::Spec.new do |ld| ld.author = { "LaunchDarkly" => "sdks@launchdarkly.com" } - ld.ios.deployment_target = "11.0" + ld.ios.deployment_target = "12.0" ld.watchos.deployment_target = "4.0" - ld.tvos.deployment_target = "11.0" + ld.tvos.deployment_target = "12.0" ld.osx.deployment_target = "10.13" ld.source = { :git => ld.homepage + '.git', :tag => ld.version} diff --git a/LaunchDarkly.xcodeproj/project.pbxproj b/LaunchDarkly.xcodeproj/project.pbxproj index 3ae7e07c..3bf3d8e1 100644 --- a/LaunchDarkly.xcodeproj/project.pbxproj +++ b/LaunchDarkly.xcodeproj/project.pbxproj @@ -64,7 +64,6 @@ 831AAE2D20A9E4F600B46DBA /* Throttler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831AAE2B20A9E4F600B46DBA /* Throttler.swift */; }; 831AAE2E20A9E4F600B46DBA /* Throttler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831AAE2B20A9E4F600B46DBA /* Throttler.swift */; }; 831AAE3020A9E75D00B46DBA /* ThrottlerSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831AAE2F20A9E75D00B46DBA /* ThrottlerSpec.swift */; }; - 831CE0661F853A1700A13A3A /* Match.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831CE0651F853A1700A13A3A /* Match.swift */; }; 831D2AAF2061AAA000B4AC3C /* Thread.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D2AAE2061AAA000B4AC3C /* Thread.swift */; }; 831D8B6F1F71532300ED65E8 /* HTTPHeaders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D8B6E1F71532300ED65E8 /* HTTPHeaders.swift */; }; 831D8B721F71D3E700ED65E8 /* DarklyService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D8B711F71D3E700ED65E8 /* DarklyService.swift */; }; @@ -379,7 +378,6 @@ 831425B0206B030100F2EF36 /* EnvironmentReporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnvironmentReporter.swift; sourceTree = ""; }; 831AAE2B20A9E4F600B46DBA /* Throttler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Throttler.swift; sourceTree = ""; }; 831AAE2F20A9E75D00B46DBA /* ThrottlerSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThrottlerSpec.swift; sourceTree = ""; }; - 831CE0651F853A1700A13A3A /* Match.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Match.swift; sourceTree = ""; }; 831D2AAE2061AAA000B4AC3C /* Thread.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Thread.swift; sourceTree = ""; }; 831D8B6E1F71532300ED65E8 /* HTTPHeaders.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPHeaders.swift; sourceTree = ""; }; 831D8B711F71D3E700ED65E8 /* DarklyService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DarklyService.swift; sourceTree = ""; }; @@ -530,14 +528,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 831CE0671F853CB700A13A3A /* Matcher */ = { - isa = PBXGroup; - children = ( - 831CE0651F853A1700A13A3A /* Match.swift */, - ); - path = Matcher; - sourceTree = ""; - }; 831D8B701F71D3A600ED65E8 /* Networking */ = { isa = PBXGroup; children = ( @@ -660,7 +650,6 @@ 831D8B751F72A48900ED65E8 /* ServiceObjects */, 83396BC71F7C3688000E256E /* Networking */, 83D17EA81FCDA16300B2823C /* Extensions */, - 831CE0671F853CB700A13A3A /* Matcher */, 8354EFD21F22491C00C05156 /* Info.plist */, B4265EB024E7390C001CFD2C /* TestUtil.swift */, ); @@ -1427,7 +1416,6 @@ 83CFE7CE1F7AD81D0010544E /* EventReporterSpec.swift in Sources */, 8392FFA32033565700320914 /* HTTPURLResponse.swift in Sources */, 83411A5F1FABDA8700E5CF39 /* mocks.generated.swift in Sources */, - 831CE0661F853A1700A13A3A /* Match.swift in Sources */, 83DDBF001FA2589900E428B6 /* FlagStoreSpec.swift in Sources */, B4F689142497B2FC004D3CE0 /* DiagnosticEventSpec.swift in Sources */, 83396BC91F7C3711000E256E /* DarklyServiceSpec.swift in Sources */, @@ -1571,19 +1559,20 @@ CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = NO; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - MARKETING_VERSION = 9.1.1; + MARKETING_VERSION = 9.2.0; MODULEMAP_FILE = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS"; PRODUCT_NAME = LaunchDarkly_tvOS; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Debug; }; @@ -1596,19 +1585,20 @@ CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = NO; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - MARKETING_VERSION = 9.1.1; + MARKETING_VERSION = 9.2.0; MODULEMAP_FILE = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS"; PRODUCT_NAME = LaunchDarkly_tvOS; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Release; }; @@ -1621,13 +1611,13 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = NO; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - MARKETING_VERSION = 9.1.1; + MARKETING_VERSION = 9.2.0; PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS"; PRODUCT_NAME = LaunchDarkly_macOS; SDKROOT = macosx; @@ -1644,13 +1634,13 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = NO; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - MARKETING_VERSION = 9.1.1; + MARKETING_VERSION = 9.2.0; PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS"; PRODUCT_NAME = LaunchDarkly_macOS; SDKROOT = macosx; @@ -1693,8 +1683,8 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_VERSION = F; @@ -1713,7 +1703,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1722,7 +1712,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 11.0; + TVOS_DEPLOYMENT_TARGET = 12.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; WATCHOS_DEPLOYMENT_TARGET = 4.0; @@ -1764,8 +1754,8 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_VERSION = F; @@ -1778,7 +1768,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; @@ -1786,7 +1776,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 11.0; + TVOS_DEPLOYMENT_TARGET = 12.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1800,13 +1790,14 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; CODE_SIGN_IDENTITY = ""; DEFINES_MODULE = NO; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; - MARKETING_VERSION = 9.1.1; + MARKETING_VERSION = 9.2.0; MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly; PRODUCT_NAME = LaunchDarkly; @@ -1822,13 +1813,14 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; CODE_SIGN_IDENTITY = ""; DEFINES_MODULE = NO; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; - MARKETING_VERSION = 9.1.1; + MARKETING_VERSION = 9.2.0; MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly; PRODUCT_NAME = LaunchDarkly; @@ -1866,13 +1858,13 @@ CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = NO; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - MARKETING_VERSION = 9.1.1; + MARKETING_VERSION = 9.2.0; PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS"; PRODUCT_NAME = LaunchDarkly_watchOS; SDKROOT = watchos; @@ -1890,13 +1882,13 @@ CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = NO; - DYLIB_COMPATIBILITY_VERSION = 9.1.0; - DYLIB_CURRENT_VERSION = 9.1.1; + DYLIB_COMPATIBILITY_VERSION = 9.2.0; + DYLIB_CURRENT_VERSION = 9.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - MARKETING_VERSION = 9.1.1; + MARKETING_VERSION = 9.2.0; PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS"; PRODUCT_NAME = LaunchDarkly_watchOS; SDKROOT = watchos; diff --git a/LaunchDarkly/LaunchDarkly/ServiceObjects/EnvironmentReporting/ReportingConsts.swift b/LaunchDarkly/LaunchDarkly/ServiceObjects/EnvironmentReporting/ReportingConsts.swift index 25470384..0a4bff8a 100644 --- a/LaunchDarkly/LaunchDarkly/ServiceObjects/EnvironmentReporting/ReportingConsts.swift +++ b/LaunchDarkly/LaunchDarkly/ServiceObjects/EnvironmentReporting/ReportingConsts.swift @@ -1,6 +1,6 @@ import Foundation struct ReportingConsts { - static let sdkVersion = "9.1.1" + static let sdkVersion = "9.2.0" static let sdkName = "ios-client-sdk" } diff --git a/LaunchDarkly/LaunchDarkly/Util.swift b/LaunchDarkly/LaunchDarkly/Util.swift index debf9cd4..aa7deeee 100644 --- a/LaunchDarkly/LaunchDarkly/Util.swift +++ b/LaunchDarkly/LaunchDarkly/Util.swift @@ -8,7 +8,7 @@ class Util { class func sha256base64(_ str: String) -> String { sha256(str).base64EncodedString() } - + class func sha256(_ str: String) -> Data { let data = Data(str.utf8) var digest = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH)) diff --git a/LaunchDarkly/LaunchDarklyTests/Matcher/Match.swift b/LaunchDarkly/LaunchDarklyTests/Matcher/Match.swift deleted file mode 100644 index 59e611b9..00000000 --- a/LaunchDarkly/LaunchDarklyTests/Matcher/Match.swift +++ /dev/null @@ -1,41 +0,0 @@ -import Foundation -import Nimble - -/** - Used by the `toMatch` matcher. - - This is the return type for the closure. - */ -public enum ToMatchResult { - case matched - case failed(reason: String) -} - -/** - A Nimble matcher that takes in a closure for validation. - - Return `.matched` when the validation succeeds. - Return `.failed` with a failure reason when the validation fails. - */ -public func match() -> Predicate<() -> ToMatchResult> { - Predicate.define { actualExpression in - let optActual = try actualExpression.evaluate() - guard let actual = optActual - else { - return PredicateResult(status: .fail, message: .fail("expected a closure, got ")) - } - - switch actual() { - case .matched: - return PredicateResult( - bool: true, - message: .expectedCustomValueTo("match", actual: "") - ) - case .failed(let reason): - return PredicateResult( - bool: false, - message: .expectedCustomValueTo("match", actual: " because <\(reason)>") - ) - } - } -} diff --git a/LaunchDarkly/LaunchDarklyTests/Models/Context/LDContextCodableSpec.swift b/LaunchDarkly/LaunchDarklyTests/Models/Context/LDContextCodableSpec.swift index 0dcda1fa..edbaddda 100644 --- a/LaunchDarkly/LaunchDarklyTests/Models/Context/LDContextCodableSpec.swift +++ b/LaunchDarkly/LaunchDarklyTests/Models/Context/LDContextCodableSpec.swift @@ -35,16 +35,17 @@ final class LDContextCodableSpec: XCTestCase { func testSingleContextKindsAreDecodedAndEncodedWithoutLossOfInformation() throws { let testCases = [ - "{\"kind\":\"org\",\"key\":\"foo\"}", - "{\"kind\":\"user\",\"key\":\"foo\"}", - "{\"kind\":\"foo\",\"key\":\"bar\",\"anonymous\":true}", - "{\"kind\":\"foo\",\"key\":\"bar\",\"name\":\"Foo\",\"_meta\":{\"privateAttributes\":[\"a\"]}}", - "{\"kind\":\"foo\",\"key\":\"bar\",\"object\":{\"a\":\"b\"}}" + "{\"key\":\"foo\",\"kind\":\"org\"}", + "{\"key\":\"foo\",\"kind\":\"user\"}", + "{\"anonymous\":true,\"key\":\"bar\",\"kind\":\"foo\"}", + "{\"_meta\":{\"privateAttributes\":[\"a\"]},\"key\":\"bar\",\"kind\":\"foo\",\"name\":\"Foo\"}", + "{\"key\":\"bar\",\"kind\":\"foo\",\"object\":{\"a\":\"b\"}}" ] for json in testCases { let context = try JSONDecoder().decode(LDContext.self, from: Data(json.utf8)) let jsonEncoder = JSONEncoder() + jsonEncoder.outputFormatting = [.sortedKeys] jsonEncoder.userInfo = [LDContext.UserInfoKeys.includePrivateAttributes: true] let output = try jsonEncoder.encode(context) let outputJson = String(data: output, encoding: .utf8) diff --git a/LaunchDarkly/LaunchDarklyTests/Models/Context/ModifierSpec.swift b/LaunchDarkly/LaunchDarklyTests/Models/Context/ModifierSpec.swift index d1efc569..924b9a52 100644 --- a/LaunchDarkly/LaunchDarklyTests/Models/Context/ModifierSpec.swift +++ b/LaunchDarkly/LaunchDarklyTests/Models/Context/ModifierSpec.swift @@ -151,7 +151,7 @@ final class ModifierSpec: XCTestCase { let expectedKey = Util.sha256("idStub").base64UrlEncodedString.toLDValue() XCTAssertEqual(expectedKey, outputKey) } - + func testGeneratedLdApplicationKeyWithVersionMissing() throws { var info = ApplicationInfo() info.applicationIdentifier("myID") diff --git a/LaunchDarkly/LaunchDarklyTests/UtilSpec.swift b/LaunchDarkly/LaunchDarklyTests/UtilSpec.swift index 8efc545e..6f3c0493 100644 --- a/LaunchDarkly/LaunchDarklyTests/UtilSpec.swift +++ b/LaunchDarkly/LaunchDarklyTests/UtilSpec.swift @@ -11,7 +11,7 @@ final class UtilSpec: XCTestCase { let output = Util.sha256base64(input) XCTAssertEqual(output, expectedOutput) } - + func testSha256base64UrlEncoding() throws { let input = "OhYeah?HashThis!!!" // hash is KzDwVRpvTuf//jfMK27M4OMpIRTecNcJoaffvAEi+as= and it has a + and a / let expectedOutput = "KzDwVRpvTuf__jfMK27M4OMpIRTecNcJoaffvAEi-as=" diff --git a/Package.swift b/Package.swift index 8aab3b45..57771f4e 100644 --- a/Package.swift +++ b/Package.swift @@ -1,14 +1,14 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 import PackageDescription let package = Package( name: "LaunchDarkly", platforms: [ - .iOS(.v11), + .iOS(.v12), .macOS(.v10_13), .watchOS(.v4), - .tvOS(.v11) + .tvOS(.v12) ], products: [ .library( diff --git a/README.md b/README.md index 47ae5d0f..dc41f50f 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,16 @@ The LaunchDarkly iOS SDK requires the following minimum build tool versions: | Tool | Version | | ----- | ------- | -| Xcode | 11.4+ | -| Swift | 5.2+ | +| Xcode | 12.5+ | +| Swift | 5.3+ | And supports the following device platforms: | Platform | Version | | -------- | ------- | -| iOS | 11.0 | +| iOS | 12.0 | | watchOS | 4.0 | -| tvOS | 11.0 | +| tvOS | 12.0 | | macOS | 10.13 | Installation @@ -49,7 +49,7 @@ To include LaunchDarkly in a Swift package, simply add it to the dependencies se ```swift dependencies: [ - .package(url: "https://github.com/launchdarkly/ios-client-sdk.git", .upToNextMinor(from: "9.1.1")) + .package(url: "https://github.com/launchdarkly/ios-client-sdk.git", .upToNextMinor(from: "9.2.0")) ] ``` @@ -60,7 +60,7 @@ To use the [CocoaPods](https://cocoapods.org) dependency manager to integrate La ```ruby use_frameworks! target 'YourTargetName' do - pod 'LaunchDarkly', '~> 9.1' + pod 'LaunchDarkly', '~> 9.2' end ``` @@ -71,7 +71,7 @@ To use the [Carthage](https://github.com/Carthage/Carthage) dependency manager t To integrate LaunchDarkly into your Xcode project using Carthage, specify it in your `Cartfile`: ```ogdl -github "launchdarkly/ios-client-sdk" ~> 9.1 +github "launchdarkly/ios-client-sdk" ~> 9.2 ``` ### Manual installation