Skip to content

Commit

Permalink
Prepare 5.4.2 release (#248)
Browse files Browse the repository at this point in the history
## [5.4.2] - 2021-06-17
### Fixed
- Update `Package.swift` to use SwiftPM tools version 5.2. This prevents test dependencies from being included transitively. (Thanks, [@escakot](#234)!)
- Update `Quick` test dependency to 3.1.2 to avoid build warnings and adopt security fixes. ([#243](#243))
- Use `AnyObject` over `class` in protocol inheritance to avoid compiler warnings. ([#247](#247))
- Improve CI to test against multiple supported Xcode and Swift language versions.
- Restored test suite compatibility with Xcode 11.4 and Swift 5.2.
  • Loading branch information
gwhelanLD authored Jun 18, 2021
1 parent 3da096b commit 6813c0e
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 180 deletions.
91 changes: 68 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
version: 2.1
jobs:
build:
parameters:
xcode-version:
type: string
ios-sim:
type: string
ssh-fix:
type: boolean
default: true
build-doc:
type: boolean
default: false
run-lint:
type: boolean
default: false

shell: /bin/bash --login -eo pipefail

macos:
xcode: '12.0.0'
xcode: <<parameters.xcode-version>>

steps:
- checkout

# This hack shouldn't be necessary, as we don't actually use SSH
# to get any dependencies, but for some reason starting in the
# '12.0.0' Xcode image it's become necessary.
- run:
name: SSH fingerprint fix
command: |
sudo defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM YES
rm ~/.ssh/id_rsa || true
for ip in $(dig @8.8.8.8 bitbucket.org +short); do ssh-keyscan bitbucket.org,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
- when:
condition: <<parameters.ssh-fix>>
steps:
- run:
name: SSH fingerprint fix
command: |
sudo defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM YES
rm ~/.ssh/id_rsa || true
for ip in $(dig @8.8.8.8 bitbucket.org +short); do ssh-keyscan bitbucket.org,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
- run:
name: Setup for builds
Expand All @@ -38,7 +56,7 @@ jobs:

- run:
name: Build & Test on iOS Simulator
command: xcodebuild test -scheme 'LaunchDarkly_iOS' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11 Pro Max' CODE_SIGN_IDENTITY= | tee 'artifacts/raw-logs-iphonesimulator.txt' | xcpretty -r junit -o 'test-results/platform-iphonesimulator/junit.xml'
command: xcodebuild test -scheme 'LaunchDarkly_iOS' -sdk iphonesimulator -destination '<<parameters.ios-sim>>' CODE_SIGN_IDENTITY= | tee 'artifacts/raw-logs-iphonesimulator.txt' | xcpretty -r junit -o 'test-results/platform-iphonesimulator/junit.xml'
when: always

- run:
Expand Down Expand Up @@ -66,23 +84,50 @@ jobs:
command: swift test -v 2>&1 | tee 'artifacts/raw-logs-swiftpm.txt' | xcpretty -r junit -o 'test-results/swiftpm/junit.xml'
when: always

- run:
name: Build Documentation
command: |
sudo gem install jazzy
jazzy -o artifacts/docs
- run:
name: CocoaPods spec lint
command: |
if [ "$CIRCLE_BRANCH" = 'master' ]; then
pod spec lint
else
pod lib lint
fi
- when:
condition: <<parameters.build-doc>>
steps:
- run:
name: Build Documentation
command: |
sudo gem install jazzy
jazzy -o artifacts/docs
- when:
condition: <<parameters.run-lint>>
steps:
- run:
name: CocoaPods spec lint
command: |
if [ "$CIRCLE_BRANCH" = 'master' ]; then
pod spec lint
else
pod lib lint
fi
- store_test_results:
path: test-results

- store_artifacts:
path: artifacts

workflows:
version: 2

build:
jobs:
- build:
name: Xcode 12.5 - Swift 5.4
xcode-version: '12.5.0'
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=14.5'
build-doc: true
run-lint: true
- build:
name: Xcode 12.0 - Swift 5.3
xcode-version: '12.0.1'
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=14.0'
- build:
name: Xcode 11.4 - Swift 5.2
xcode-version: '11.4.1'
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=12.2'
ssh-fix: false
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ xcuserdata
/docs
/Carthage/Checkouts
/.swiftpm
/Package.resolved
/LaunchDarkly.xcworkspace/xcshareddata/swiftpm/Package.resolved
/LaunchDarkly.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to the LaunchDarkly iOS SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [5.4.2] - 2021-06-17
### Fixed
- Update `Package.swift` to use SwiftPM tools version 5.2. This prevents test dependencies from being included transitively. (Thanks, [@escakot](https://github.com/launchdarkly/ios-client-sdk/pull/234)!)
- Update `Quick` test dependency to 3.1.2 to avoid build warnings and adopt security fixes. ([#243](https://github.com/launchdarkly/ios-client-sdk/issues/243))
- Use `AnyObject` over `class` in protocol inheritance to avoid compiler warnings. ([#247](https://github.com/launchdarkly/ios-client-sdk/issues/247))
- Improve CI to test against multiple supported Xcode and Swift language versions.
- Restored test suite compatibility with Xcode 11.4 and Swift 5.2.

## [5.4.1] - 2021-04-06
### Fixed
- Internal throttling logic would sometimes delay new poll or stream connections even when there were no recent connections. This caused switching active user contexts using `identify` to sometimes delay retrieving the most recent flags and calling the completion.
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "launchdarkly/swift-eventsource" ~> 1.2.1
github "launchdarkly/swift-eventsource" == 1.2.1
2 changes: 1 addition & 1 deletion LaunchDarkly.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |ld|

ld.name = "LaunchDarkly"
ld.version = "5.4.1"
ld.version = "5.4.2"
ld.summary = "iOS SDK for LaunchDarkly"

ld.description = <<-DESC
Expand Down
36 changes: 18 additions & 18 deletions LaunchDarkly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.4.1;
MARKETING_VERSION = 5.4.2;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
PRODUCT_NAME = LaunchDarkly_tvOS;
Expand All @@ -1618,7 +1618,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.4.1;
MARKETING_VERSION = 5.4.2;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
PRODUCT_NAME = LaunchDarkly_tvOS;
Expand All @@ -1641,7 +1641,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.4.1;
MARKETING_VERSION = 5.4.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
PRODUCT_NAME = LaunchDarkly_macOS;
SDKROOT = macosx;
Expand All @@ -1662,7 +1662,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.4.1;
MARKETING_VERSION = 5.4.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
PRODUCT_NAME = LaunchDarkly_macOS;
SDKROOT = macosx;
Expand Down Expand Up @@ -1706,7 +1706,7 @@
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 5.4.0;
DYLIB_CURRENT_VERSION = 5.4.1;
DYLIB_CURRENT_VERSION = 5.4.2;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_VERSION = B;
Expand Down Expand Up @@ -1777,7 +1777,7 @@
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 5.4.0;
DYLIB_CURRENT_VERSION = 5.4.1;
DYLIB_CURRENT_VERSION = 5.4.2;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_VERSION = B;
Expand Down Expand Up @@ -1816,7 +1816,7 @@
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
MARKETING_VERSION = 5.4.1;
MARKETING_VERSION = 5.4.2;
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
PRODUCT_NAME = LaunchDarkly;
Expand All @@ -1836,7 +1836,7 @@
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
MARKETING_VERSION = 5.4.1;
MARKETING_VERSION = 5.4.2;
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
PRODUCT_NAME = LaunchDarkly;
Expand Down Expand Up @@ -1878,7 +1878,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.4.1;
MARKETING_VERSION = 5.4.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
PRODUCT_NAME = LaunchDarkly_watchOS;
SDKROOT = watchos;
Expand All @@ -1900,7 +1900,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.4.1;
MARKETING_VERSION = 5.4.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
PRODUCT_NAME = LaunchDarkly_watchOS;
SDKROOT = watchos;
Expand Down Expand Up @@ -1973,32 +1973,32 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/LaunchDarkly/swift-eventsource.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 1.2.1;
kind = exactVersion;
version = 1.2.1;
};
};
B4903D9624BD61B200F087C4 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/AliSoftware/OHHTTPStubs.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 9.0.0;
kind = exactVersion;
version = 9.1.0;
};
};
B4903D9924BD61D000F087C4 /* XCRemoteSwiftPackageReference "Nimble" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Quick/Nimble.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 9.0.0;
kind = exactVersion;
version = 9.2.0;
};
};
B4903D9C24BD61EF00F087C4 /* XCRemoteSwiftPackageReference "Quick" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Quick/Quick.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 3.0.0;
kind = exactVersion;
version = 3.1.2;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions LaunchDarkly/LaunchDarkly/Networking/DarklyService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ typealias ServiceResponse = (data: Data?, urlResponse: URLResponse?, error: Erro
typealias ServiceCompletionHandler = (ServiceResponse) -> Void

//sourcery: autoMockable
protocol DarklyStreamingProvider: class {
protocol DarklyStreamingProvider: AnyObject {
func start()
func stop()
}

extension EventSource: DarklyStreamingProvider {}

protocol DarklyServiceProvider: class {
protocol DarklyServiceProvider: AnyObject {
var config: LDConfig { get }
var user: LDUser { get set }
var diagnosticCache: DiagnosticCaching? { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct EnvironmentReporter: EnvironmentReporting {
var shouldThrottleOnlineCalls: Bool { true }
#endif

let sdkVersion = "5.4.1"
let sdkVersion = "5.4.2"
// Unfortunately, the following does not function in certain configurations, such as when included through SPM
// var sdkVersion: String {
// Bundle(for: LDClient.self).infoDictionary?["CFBundleShortVersionString"] as? String ?? "5.x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ final class DarklyServiceSpec: QuickSpec {
} else {
fail("request path is missing")
}
expect(urlRequest?.cachePolicy) == .reloadRevalidatingCacheData
expect([.reloadIgnoringLocalCacheData, .reloadRevalidatingCacheData]).to(contain(urlRequest?.cachePolicy))
expect(urlRequest?.timeoutInterval) == testContext.config.connectionTimeout
expect(urlRequest?.httpMethod) == URLRequest.HTTPMethods.get
expect(urlRequest?.httpBody).to(beNil())
Expand Down Expand Up @@ -382,7 +382,7 @@ final class DarklyServiceSpec: QuickSpec {
} else {
fail("request path is missing")
}
expect(urlRequest?.cachePolicy) == .reloadRevalidatingCacheData
expect([.reloadIgnoringLocalCacheData, .reloadRevalidatingCacheData]).to(contain(urlRequest?.cachePolicy))
expect(urlRequest?.timeoutInterval) == testContext.config.connectionTimeout
expect(urlRequest?.httpMethod) == URLRequest.HTTPMethods.report
expect(urlRequest?.httpBodyStream).toNot(beNil()) //Although the service sets the httpBody, OHHTTPStubs seems to convert that into an InputStream, which should be ok
Expand Down
Loading

0 comments on commit 6813c0e

Please sign in to comment.