Skip to content

Commit

Permalink
Merge pull request #242 from contentful/config/prune-nimble
Browse files Browse the repository at this point in the history
Prune Nimble; fix deployment version on macOS module header
  • Loading branch information
loudmouth committed Nov 8, 2018
2 parents 8cbe2e8 + 67482b8 commit 798781b
Show file tree
Hide file tree
Showing 26 changed files with 504 additions and 523 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CONTENTFUL_SDK_VERSION=4.1.2
CONTENTFUL_SDK_VERSION=4.1.3
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "Carthage/Checkouts/DVR"]
path = Carthage/Checkouts/DVR
url = https://github.com/venmo/DVR.git
[submodule "Carthage/Checkouts/Nimble"]
path = Carthage/Checkouts/Nimble
url = https://github.com/Quick/Nimble.git
[submodule "Carthage/Checkouts/OHHTTPStubs"]
path = Carthage/Checkouts/OHHTTPStubs
url = https://github.com/AliSoftware/OHHTTPStubs.git
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) starting from
## Table of contents

#### 4.x Releases
- `4.1.0` Releases - [4.1.0](#410)
- `4.1.0` Releases - [4.1.0](#410) | [4.1.3](#413)
- `4.0.0` Releases - [4.0.0](#400) | [4.0.1](#401)

#### 3.x Releases
Expand All @@ -37,6 +37,15 @@ This project adheres to [Semantic Versioning](http://semver.org/) starting from
- `0.4.x` Releases - [0.4.0](#040) | [0.4.1](#041)
- `0.3.x` Releases - [0.3.0](#030) | [0.3.1](#031)


---

## [`4.1.3`](https://github.com/contentful/contentful.swift/releases/tag/4.1.3)
Released on 2018-11-08

#### Changed
- `4.1.1`, `4.1.2`, and `4.1.3` are all hotfix releases that fixed small corruptions in the Xcode project configuration. `4.1.3` specifically sets the deployment version on the macOS target, even though the correct deployment version was set on the macOS framework target.

---

## [`4.1.0`](https://github.com/contentful/contentful.swift/releases/tag/4.1.0)
Expand Down
1 change: 0 additions & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
github "Quick/Nimble" ~> 7.1.3
github "venmo/DVR" ~> 1.2.0
github "AliSoftware/OHHTTPStubs" ~> 6.1.0
1 change: 0 additions & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble deleted from cd6dfb
2 changes: 1 addition & 1 deletion Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CONTENTFUL_SDK_VERSION=4.1.2
CONTENTFUL_SDK_VERSION=4.1.3
12 changes: 6 additions & 6 deletions Contentful.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,10 @@
5D52E2932193384100C88FC9 /* SyncTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A114BBC11C50E9E200DE6679 /* SyncTests.swift */; };
5D52E2942193384100C88FC9 /* UtilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A17D044C1C4F974F002E568B /* UtilityTests.swift */; };
5D52E2962193386900C88FC9 /* DVR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E2952193386900C88FC9 /* DVR.framework */; };
5D52E2982193386900C88FC9 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E2972193386900C88FC9 /* Nimble.framework */; };
5D52E29A2193386900C88FC9 /* OHHTTPStubs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E2992193386900C88FC9 /* OHHTTPStubs.framework */; };
5D52E29C2193387600C88FC9 /* DVR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E29B2193387600C88FC9 /* DVR.framework */; };
5D52E29E2193387600C88FC9 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E29D2193387600C88FC9 /* Nimble.framework */; };
5D52E2A02193387600C88FC9 /* OHHTTPStubs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E29F2193387600C88FC9 /* OHHTTPStubs.framework */; };
5D52E2A22193388200C88FC9 /* DVR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E2A12193388200C88FC9 /* DVR.framework */; };
5D52E2A42193388200C88FC9 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E2A32193388200C88FC9 /* Nimble.framework */; };
5D52E2A62193388200C88FC9 /* OHHTTPStubs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D52E2A52193388200C88FC9 /* OHHTTPStubs.framework */; };
5DD410472190BC8B003FC01E /* RichText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD410462190BC8B003FC01E /* RichText.swift */; };
5DD410482190BC8B003FC01E /* RichText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD410462190BC8B003FC01E /* RichText.swift */; };
Expand Down Expand Up @@ -366,7 +363,6 @@
buildActionMask = 2147483647;
files = (
5D52E2A22193388200C88FC9 /* DVR.framework in Frameworks */,
5D52E2A42193388200C88FC9 /* Nimble.framework in Frameworks */,
5D52E2A62193388200C88FC9 /* OHHTTPStubs.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -383,7 +379,6 @@
buildActionMask = 2147483647;
files = (
5D52E2962193386900C88FC9 /* DVR.framework in Frameworks */,
5D52E2982193386900C88FC9 /* Nimble.framework in Frameworks */,
5D52E29A2193386900C88FC9 /* OHHTTPStubs.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -393,7 +388,6 @@
buildActionMask = 2147483647;
files = (
5D52E29C2193387600C88FC9 /* DVR.framework in Frameworks */,
5D52E29E2193387600C88FC9 /* Nimble.framework in Frameworks */,
5D52E2A02193387600C88FC9 /* OHHTTPStubs.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1465,6 +1459,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -1474,6 +1469,7 @@
TVOS_DEPLOYMENT_TARGET = 9.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 3.1;
};
name = Debug;
};
Expand Down Expand Up @@ -1523,6 +1519,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = NO;
SDKROOT = iphoneos;
Expand All @@ -1532,6 +1529,7 @@
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 3.1;
};
name = Release;
};
Expand Down Expand Up @@ -1862,6 +1860,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -1871,6 +1870,7 @@
TVOS_DEPLOYMENT_TARGET = 9.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 3.1;
};
name = API_Coverage;
};
Expand Down
3 changes: 0 additions & 3 deletions Contentful.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 19 additions & 20 deletions Tests/ContentfulTests/AssetTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@testable import Contentful
import XCTest
import DVR
import Nimble

func url(_ asset: Asset) -> URL {
var url = URL(string: "http://example.com")
Expand Down Expand Up @@ -40,11 +39,11 @@ class AssetTests: XCTestCase {
AssetTests.client.fetch(Asset.self, id: "nyancat") { (result) in
switch result {
case let .success(asset):
expect(asset.sys.id).to(equal("nyancat"))
expect(asset.sys.type).to(equal("Asset"))
expect(url(asset).absoluteString).to(equal("https://images.ctfassets.net/dumri3ebknon/nyancat/c78aa97bf55b7de229ee5a5f88261aa4/Nyan_cat_250px_frame.png"))
XCTAssertEqual(asset.sys.id, "nyancat")
XCTAssertEqual(asset.sys.type, "Asset")
XCTAssertEqual(url(asset).absoluteString, "https://images.ctfassets.net/dumri3ebknon/nyancat/c78aa97bf55b7de229ee5a5f88261aa4/Nyan_cat_250px_frame.png")
case let .error(error):
fail("\(error)")
XCTFail("\(error)")
}

expectation.fulfill()
Expand All @@ -58,17 +57,17 @@ class AssetTests: XCTestCase {
AssetTests.client.fetchArray(of: Asset.self) { result in
switch result {
case .success(let assetsReponse):
expect(assetsReponse.items.count).to(equal(5))
XCTAssertEqual(assetsReponse.items.count, 5)

if let asset = (assetsReponse.items.filter { $0.sys.id == "nyancat" }).first {
expect(asset.sys.id).to(equal("nyancat"))
expect(asset.sys.type).to(equal("Asset"))
expect(url(asset).absoluteString).to(equal("https://images.ctfassets.net/dumri3ebknon/nyancat/c78aa97bf55b7de229ee5a5f88261aa4/Nyan_cat_250px_frame.png"))
XCTAssertEqual(asset.sys.id, "nyancat")
XCTAssertEqual(asset.sys.type, "Asset")
XCTAssertEqual(url(asset).absoluteString, "https://images.ctfassets.net/dumri3ebknon/nyancat/c78aa97bf55b7de229ee5a5f88261aa4/Nyan_cat_250px_frame.png")
} else {
fail("Could not find asset with id 'nyancat'")
XCTFail("Could not find asset with id 'nyancat'")
}
case .error(let error):
fail("\(error)")
XCTFail("\(error)")
}
expectation.fulfill()
}
Expand All @@ -83,15 +82,15 @@ class AssetTests: XCTestCase {
case .success(let asset):
AssetTests.client.fetchImage(for: asset) { imageResult in
if let image = imageResult.value {
expect(image.size.width).to(equal(250.0))
expect(image.size.height).to(equal(250.0))
XCTAssertEqual(image.size.width, 250.0)
XCTAssertEqual(image.size.height, 250.0)
} else if let error = imageResult.error {
fail("\(error)")
XCTFail("\(error)")
}
expectation.fulfill()
}
case .error(let error):
fail("\(error)")
XCTFail("\(error)")
expectation.fulfill()
}
}
Expand All @@ -105,10 +104,10 @@ class AssetTests: XCTestCase {
AssetTests.client.fetchArray(of: Asset.self, matching: .where(mimetypeGroup: .image)) { result in
switch result {
case .success(let assets):
expect(assets.items.count).to(equal(4))
XCTAssertEqual(assets.items.count, 4)

case .error(let error):
fail("\(error)")
XCTFail("\(error)")
}
expectation.fulfill()
}
Expand All @@ -123,10 +122,10 @@ class AssetTests: XCTestCase {
switch result {
case .success(let assetsResponse):
let assets = assetsResponse.items
expect(assets.count).to(equal(1))
expect(assets.first?.urlString).to(equal("https://videos.ctfassets.net/dumri3ebknon/Gluj9lzquYcK0agoCkMUs/1104fffefa098062fd9f888a0a571edd/Cute_Cat_-_3092.mp4"))
XCTAssertEqual(assets.count, 1)
XCTAssertEqual(assets.first?.urlString, "https://videos.ctfassets.net/dumri3ebknon/Gluj9lzquYcK0agoCkMUs/1104fffefa098062fd9f888a0a571edd/Cute_Cat_-_3092.mp4")
case .error(let error):
fail("\(error)")
XCTFail("\(error)")
}
expectation.fulfill()
}
Expand Down
21 changes: 10 additions & 11 deletions Tests/ContentfulTests/ClientConfigurationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

@testable import Contentful
import XCTest
import Nimble
import DVR

class FakePersistenceIntegration: PersistenceIntegration {
Expand Down Expand Up @@ -44,13 +43,13 @@ class ClientConfigurationTests: XCTestCase {
for validVersionString in ["0.10.0", "10.3.2-RC", "10.2.0-beta1", "0.4.79-alpha"] {
// expect 1 matc
let matches = versionMatchingRegex.matches(in: validVersionString, options: [], range: NSRange(location: 0, length: validVersionString.count))
expect(matches.count).to(equal(1))
XCTAssertEqual(matches.count, 1)
}

for invalidVersionString in ["0..9","0.a.9", "9.1", "0.10.9-", "0.10.9-ri", "0.10.9-RCHU"] {
// expect 0 matches
let matches = versionMatchingRegex.matches(in: invalidVersionString, options: [], range: NSRange(location: 0, length: invalidVersionString.count))
expect(matches.count).to(equal(0))
XCTAssertEqual(matches.count, 0)
}

#if os(macOS)
Expand All @@ -63,34 +62,34 @@ class ClientConfigurationTests: XCTestCase {

let regex = try! NSRegularExpression(pattern: "sdk contentful.swift/\(onlyVersionNumberRegexString); platform Swift/4.0; os \(platform)/\(osVersionString);" , options: [])
let matches = regex.matches(in: userAgentString, options: [], range: NSRange(location: 0, length: userAgentString.count))
expect(matches.count).to(equal(1))
XCTAssertEqual(matches.count, 1)

let client = Client(spaceId: "", accessToken: "", clientConfiguration: clientConfiguration)

if let userAgent = client.urlSession.configuration.httpAdditionalHeaders?["X-Contentful-User-Agent"] as? String {
let regex = try! NSRegularExpression(pattern: "sdk contentful.swift/\(onlyVersionNumberRegexString); platform Swift/4.0; os \(platform)/\(osVersionString);" , options: [])
let matches = regex.matches(in: userAgent, options: [], range: NSRange(location: 0, length: userAgent.count))
expect(matches.count).to(equal(1))
XCTAssertEqual(matches.count, 1)
} else {
fail("User agent should be set")
XCTFail("User agent should be set")
}

client.persistenceIntegration = FakePersistenceIntegration()
if let userAgent = client.urlSession.configuration.httpAdditionalHeaders?["X-Contentful-User-Agent"] as? String {
let regex = try! NSRegularExpression(pattern: "sdk contentful.swift/\(onlyVersionNumberRegexString); platform Swift/4.0; os \(platform)/\(osVersionString); integration fake-integration/1.0.0;" , options: [])
let matches = regex.matches(in: userAgent, options: [], range: NSRange(location: 0, length: userAgent.count))
expect(matches.count).to(equal(1))
XCTAssertEqual(matches.count, 1)
} else {
fail("User agent should be set")
XCTFail("User agent should be set")
}
}

func testDefaultConfiguration() {
let client = Client(spaceId: "", accessToken: "")
expect(client.host).to(equal(Host.delivery))
XCTAssertEqual(client.host, Host.delivery)
let previewClient = Client(spaceId: "", accessToken: "", host: Host.preview)
expect(previewClient.host).to(equal(Host.preview))
XCTAssertEqual(previewClient.host, Host.preview)
let customHostClient = Client(spaceId: "", accessToken: "", host: "myenterprise.contentful.com")
expect(customHostClient.host).to(equal("myenterprise.contentful.com"))
XCTAssertEqual(customHostClient.host, "myenterprise.contentful.com")
}
}
Loading

0 comments on commit 798781b

Please sign in to comment.