Skip to content

Commit ab6b02b

Browse files
authored
Merge branch 'master' into yasir/log-targeted-rollout
2 parents b9ee38f + f94e079 commit ab6b02b

File tree

8 files changed

+75
-30
lines changed

8 files changed

+75
-30
lines changed

.travis.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ stages:
66
- name: 'Lint markdown files'
77
- name: 'Trigger Integration Tests'
88
if: env(RUN_COMPAT_SUITE) = true
9-
- name: 'SourceClear and Lint'
9+
- name: 'Lint'
10+
- name: 'Source Clear'
1011
- name: 'Unit Tests'
1112
- name: 'Prepare for release'
1213
if: env(PREP) = true and type = api
@@ -24,18 +25,6 @@ jobs:
2425
notifications:
2526
email: false
2627

27-
- stage: 'Lint markdown files'
28-
os: linux
29-
language: generic
30-
before_install: skip
31-
install:
32-
- npm i -g markdown-spellcheck
33-
before_script:
34-
- wget --quiet https://raw.githubusercontent.com/optimizely/mdspell-config/master/.spelling
35-
script:
36-
- mdspell -a -n -r --en-us '**/*.md'
37-
after_success: skip
38-
3928
- stage: 'Trigger Integration Tests'
4029
language: minimal
4130
os: linux
@@ -50,7 +39,7 @@ jobs:
5039
script:
5140
- $HOME/travisci-tools/trigger-script-with-status-update.sh
5241

53-
- stage: 'SourceClear and Lint'
42+
- stage: 'Lint'
5443
language: swift
5544
os: osx
5645
osx_image: xcode11.3
@@ -61,6 +50,16 @@ jobs:
6150
after_script:
6251
- curl -sSL https://download.sourceclear.com/ci.sh | bash
6352

53+
- stage: 'Source Clear'
54+
if: type = cron
55+
addons:
56+
srcclr: true
57+
before_install: skip
58+
install: skip
59+
before_script: skip
60+
script: skip
61+
after_success: skip
62+
6463
- &unittests
6564
stage: 'Unit Tests'
6665
language: swift
@@ -107,7 +106,7 @@ jobs:
107106
os: osx
108107
osx_image: xcode11.3
109108
env:
110-
- VERSION=3.3.2
109+
- VERSION=3.4.0
111110
install:
112111
# install hub
113112
- wget https://github.com/github/hub/releases/download/v2.11.2/hub-darwin-amd64-2.11.2.tgz -O /tmp/hub-darwin-amd64-2.11.2.tgz && tar -xvf /tmp/hub-darwin-amd64-2.11.2.tgz -C /usr/local/opt && ln -s /usr/local/opt/hub-darwin-amd64-2.11.2/bin/hub /usr/local/bin/hub
@@ -124,7 +123,7 @@ jobs:
124123
os: osx
125124
osx_image: xcode11.3
126125
env:
127-
- VERSION=3.3.2
126+
- VERSION=3.4.0
128127
install:
129128
# install hub
130129
- wget https://github.com/github/hub/releases/download/v2.11.2/hub-darwin-amd64-2.11.2.tgz -O /tmp/hub-darwin-amd64-2.11.2.tgz && tar -xvf /tmp/hub-darwin-amd64-2.11.2.tgz -C /usr/local/opt && ln -s /usr/local/opt/hub-darwin-amd64-2.11.2/bin/hub /usr/local/bin/hub

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Optimizely Swift SDK Changelog
22

3+
## 3.4.0
4+
July 9, 2020
5+
6+
### New Features
7+
* Add support for JSON feature variables. ([#315](https://github.com/optimizely/swift-sdk/pull/315), [#317](https://github.com/optimizely/swift-sdk/pull/317), [#318](https://github.com/optimizely/swift-sdk/pull/318))
8+
* Add macOS Compatibility. ([#332](https://github.com/optimizely/swift-sdk/pull/332))
9+
10+
### Bug Fixes
11+
* Add more audience evaluation logs. ([#336](https://github.com/optimizely/swift-sdk/pull/336))
12+
313
## 3.3.2
414
May 21, 2020
515

OptimizelySwiftSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "OptimizelySwiftSDK"
33
s.module_name = "Optimizely"
4-
s.version = "3.3.1"
4+
s.version = "3.4.0"
55
s.summary = "Optimizely experiment framework for iOS/tvOS"
66
s.homepage = "https://docs.developers.optimizely.com/full-stack/docs"
77
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ SPEC CHECKSUMS:
1313

1414
PODFILE CHECKSUM: 159491f53ea704c30be049e048d854a49f9b7433
1515

16-
COCOAPODS: 1.8.4
16+
COCOAPODS: 1.9.1

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ Please note below that _\<platform\>_ is used to represent the platform on which
3434
```
3535
dependencies: [
3636
.package(url: "https://github.com/optimizely/swift-sdk.git",
37-
.upToNextMinor(from: “3.3.2”))
37+
.upToNextMinor(from: “3.4.0”))
3838
]
3939
```
4040

4141
#### CocoaPods
4242
1. Add the following lines to the _Podfile_:<pre>
4343
```use_frameworks!```
44-
```pod 'OptimizelySwiftSDK', '~> 3.3.2'```
44+
```pod 'OptimizelySwiftSDK', '~> 3.4.0'```
4545
</pre>
4646

4747
2. Run the following command: <pre>``` pod install ```</pre>
4848

4949
Further installation instructions for Cocoapods: https://guides.cocoapods.org/using/getting-started.html
5050

5151
#### Carthage
52-
1. Add the following lines to the _Cartfile_:<pre>```github "optimizely/swift-sdk" ~> 3.3.2```</pre>
52+
1. Add the following lines to the _Cartfile_:<pre>```github "optimizely/swift-sdk" ~> 3.4.0```</pre>
5353

5454
2. Run the following command:<pre>```carthage update```</pre>
5555

Sources/Optimizely/OptimizelyJSON.swift

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,31 @@ public class OptimizelyJSON: NSObject {
7171
///
7272
/// If JSON Data is {"k1":true, "k2":{"k3":"v3"}}
7373
///
74-
/// Set jsonPath to "k2" to access {"k3":"v3"} or set it to "k2.k3" to access "v3"
75-
/// Set it to nil or empty to access the entire JSON data.
74+
/// Set jsonPath to "k2" to access {"k3":"v3"} or set it to "k2.k3" to access "v3".
75+
/// Set it to nil or empty to access the entire JSON data. See more examples below:
76+
///
77+
///
78+
/// struct Student: Decodable {
79+
/// let name: String
80+
/// let age: Int
81+
/// let address: Address
82+
/// }
83+
///
84+
/// struct Address: Decodable {
85+
/// let state: String
86+
/// let emails: [String]
87+
/// }
88+
///
89+
/// let student: Student? = optimizelyJSON.getValue(jsonPath: nil)
90+
/// let address: Address? = optimizelyJSON.getValue(jsonPath: "address")
91+
/// let name: String? = optimizelyJSON.getValue(jsonPath: "name")
92+
/// let emails: [String]? = optimizelyJSON.getValue(jsonPath: "address.emails")
93+
///
7694
///
7795
/// - Parameters:
7896
/// - jsonPath: Key path for the value.
7997
/// - Returns: Value if decoded successfully
80-
public func getValue<T: Decodable>(jsonPath: String? = nil) -> T? {
98+
public func getValue<T: Decodable>(jsonPath: String?) -> T? {
8199
func handler(value: Any) -> T? {
82100
guard JSONSerialization.isValidJSONObject(value) else {
83101
// Try and typecast value to required return type
@@ -102,8 +120,26 @@ public class OptimizelyJSON: NSObject {
102120
///
103121
/// If JSON Data is {"k1":true, "k2":{"k3":"v3"}}
104122
///
105-
/// Set jsonPath to "k2" to access {"k3":"v3"} or set it to "k2.k3" to access "v3"
106-
/// Set it to nil or empty to access the entire JSON data.
123+
/// Set jsonPath to "k2" to access {"k3":"v3"} or set it to "k2.k3" to access "v3".
124+
/// Set it to nil or empty to access the entire JSON data. See more examples below:
125+
///
126+
///
127+
/// struct Student: Decodable {
128+
/// let name: String
129+
/// let age: Int
130+
/// let address: Address
131+
/// }
132+
///
133+
/// struct Address: Decodable {
134+
/// let state: String
135+
/// let emails: [String]
136+
/// }
137+
///
138+
/// let student: Student? = optimizelyJSON.getValue(jsonPath: nil)
139+
/// let address: Address? = optimizelyJSON.getValue(jsonPath: "address")
140+
/// let name: String? = optimizelyJSON.getValue(jsonPath: "name")
141+
/// let emails: [String]? = optimizelyJSON.getValue(jsonPath: "address.emails")
142+
///
107143
///
108144
/// - Parameters:
109145
/// - jsonPath: Key path for the value.

Sources/Utils/SDKVersion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
/// Do not edit this field.
1919
/// - It is auto updated (Scripts/updated_version.sh) to reflect the current version
2020
/// - Do not put underscores in the name (Swiftlint can modify unexpectedly)
21-
let OPTIMIZELYSDKVERSION = "3.3.1"
21+
let OPTIMIZELYSDKVERSION = "3.4.0"

Tests/OptimizelyTests-APIs/OptimizelyClientTests_OptimizelyJSON.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ extension OptimizelyClientTests_OptimizelyJSON {
280280
}
281281

282282
func testGetValueForNilJSONKeyAndInvalidType() {
283-
let value: Int? = self.optimizelyJSON.getValue()
283+
let value: Int? = self.optimizelyJSON.getValue(jsonPath: nil)
284284
XCTAssertNil(value)
285285
}
286286

@@ -290,7 +290,7 @@ extension OptimizelyClientTests_OptimizelyJSON {
290290
}
291291

292292
func testGetValueForNilJSONKeyAndEmptyDecodableStruct() {
293-
let value: EmptyDecodableStruct? = self.optimizelyJSON.getValue()
293+
let value: EmptyDecodableStruct? = self.optimizelyJSON.getValue(jsonPath: nil)
294294
XCTAssertNotNil(value)
295295
}
296296

@@ -314,7 +314,7 @@ extension OptimizelyClientTests_OptimizelyJSON {
314314
}
315315

316316
func testGetValueForNilJsonKeyAndValidDecodableStruct() {
317-
let value: ValidDecodableStruct? = self.optimizelyJSON.getValue()
317+
let value: ValidDecodableStruct? = self.optimizelyJSON.getValue(jsonPath: nil)
318318
XCTAssertNotNil(value)
319319

320320
let expectedStruct = ValidDecodableStruct(

0 commit comments

Comments
 (0)