Skip to content

Commit 81d7fc0

Browse files
committed
Merge targets and schemes and fix xcode warnings and errors
1 parent 53fac56 commit 81d7fc0

File tree

10 files changed

+53
-555
lines changed

10 files changed

+53
-555
lines changed

JSONHelper.xcodeproj/project.pbxproj

Lines changed: 28 additions & 297 deletions
Large diffs are not rendered by default.

JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelper-Mac.xcscheme

Lines changed: 0 additions & 114 deletions
This file was deleted.

JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelper-tvOS.xcscheme

Lines changed: 0 additions & 114 deletions
This file was deleted.

JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelper-iOS.xcscheme renamed to JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelper.xcscheme

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -16,32 +16,17 @@
1616
BuildableIdentifier = "primary"
1717
BlueprintIdentifier = "5FAD07631A70F2FC00C4D09E"
1818
BuildableName = "JSONHelper.framework"
19-
BlueprintName = "JSONHelper-iOS"
20-
ReferencedContainer = "container:JSONHelper.xcodeproj">
21-
</BuildableReference>
22-
</BuildActionEntry>
23-
<BuildActionEntry
24-
buildForTesting = "YES"
25-
buildForRunning = "YES"
26-
buildForProfiling = "NO"
27-
buildForArchiving = "NO"
28-
buildForAnalyzing = "YES">
29-
<BuildableReference
30-
BuildableIdentifier = "primary"
31-
BlueprintIdentifier = "5FAD076E1A70F2FC00C4D09E"
32-
BuildableName = "JSONHelperTests.xctest"
33-
BlueprintName = "JSONHelperTests"
19+
BlueprintName = "JSONHelper"
3420
ReferencedContainer = "container:JSONHelper.xcodeproj">
3521
</BuildableReference>
3622
</BuildActionEntry>
3723
</BuildActionEntries>
3824
</BuildAction>
3925
<TestAction
40-
buildConfiguration = "Release"
26+
buildConfiguration = "Debug"
4127
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4228
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
shouldUseLaunchSchemeArgsEnv = "YES"
44-
codeCoverageEnabled = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES">
4530
<Testables>
4631
<TestableReference
4732
skipped = "NO">
@@ -59,7 +44,7 @@
5944
BuildableIdentifier = "primary"
6045
BlueprintIdentifier = "5FAD07631A70F2FC00C4D09E"
6146
BuildableName = "JSONHelper.framework"
62-
BlueprintName = "JSONHelper-iOS"
47+
BlueprintName = "JSONHelper"
6348
ReferencedContainer = "container:JSONHelper.xcodeproj">
6449
</BuildableReference>
6550
</MacroExpansion>
@@ -81,7 +66,7 @@
8166
BuildableIdentifier = "primary"
8267
BlueprintIdentifier = "5FAD07631A70F2FC00C4D09E"
8368
BuildableName = "JSONHelper.framework"
84-
BlueprintName = "JSONHelper-iOS"
69+
BlueprintName = "JSONHelper"
8570
ReferencedContainer = "container:JSONHelper.xcodeproj">
8671
</BuildableReference>
8772
</MacroExpansion>
@@ -99,7 +84,7 @@
9984
BuildableIdentifier = "primary"
10085
BlueprintIdentifier = "5FAD07631A70F2FC00C4D09E"
10186
BuildableName = "JSONHelper.framework"
102-
BlueprintName = "JSONHelper-iOS"
87+
BlueprintName = "JSONHelper"
10388
ReferencedContainer = "container:JSONHelper.xcodeproj">
10489
</BuildableReference>
10590
</MacroExpansion>

JSONHelper.xcodeproj/xcshareddata/xcschemes/JSONHelperExample.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

JSONHelper/Conversion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public protocol Convertible {
105105
return lhs
106106
}
107107

108-
if let elements = rhs as? NSArray as? [AnyObject] {
108+
if let elements = rhs as? NSArray as [AnyObject]? {
109109
return lhs <-- elements
110110
}
111111

JSONHelper/Deserialization.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private func dataStringToObject(_ dataString: String) -> AnyObject? {
7373
@discardableResult public func <-- <D: Deserializable, T>(lhs: inout [D]?, rhs: T?) -> [D]? {
7474
guard let rhs = rhs else { return nil }
7575

76-
if let elements = rhs as? NSArray as? [AnyObject] {
76+
if let elements = rhs as? NSArray as [AnyObject]? {
7777
return lhs <-- elements
7878
}
7979

JSONHelper/Extensions/Color.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extension NSColor: Convertible {
5959
return self.init(red: rgba.red, green: rgba.green, blue: rgba.blue, alpha: rgba.alpha)
6060
}
6161

62-
throw ConversionError.UnsupportedType
62+
throw ConversionError.unsupportedType
6363
}
6464
}
6565

JSONHelperTests/JSONHelperTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Copyright © 2016 Baris Sencan. All rights reserved.
33
//
44

5-
import UIKit
5+
import Foundation
66
import XCTest
77
import JSONHelper
88

scripts/test.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@
22

33
cd "$(dirname "$0")/.."
44

5-
xcodebuild test -project JSONHelper.xcodeproj -scheme JSONHelper-iOS -destination 'platform=iOS Simulator,name=iPhone SE' -derivedDataPath='./build' | bundle exec xcpretty
5+
xcodebuild test -project JSONHelper.xcodeproj -scheme JSONHelper -destination 'platform=iOS Simulator,name=iPhone SE' -derivedDataPath='./build' | bundle exec xcpretty
66

77
IOS_STATUS=${PIPESTATUS[0]}
88

9-
xcodebuild test -project JSONHelper.xcodeproj -scheme JSONHelper-Mac -destination 'platform=OS X,arch=x86_64' | bundle exec xcpretty
9+
xcodebuild test -project JSONHelper.xcodeproj -scheme JSONHelper -destination 'platform=OS X,arch=x86_64' | bundle exec xcpretty
1010

1111
MAC_STATUS=${PIPESTATUS[0]}
1212

13-
exit $IOS_STATUS || $MAC_STATUS
13+
xcodebuild test -project JSONHelper.xcodeproj -scheme JSONHelper -destination 'platform=tvOS Simulator,name=Apple TV 1080p' | bundle exec xcpretty
14+
15+
TVOS_STATUS=${PIPESTATUS[0]}
16+
17+
if [[ $IOS_STATUS == 0 && $MAC_STATUS == 0 && $TVOS_STATUS == 0 ]]; then
18+
echo "All tests have passed."
19+
exit 0
20+
else
21+
echo "Some tests have failed."
22+
exit 1
23+
fi

0 commit comments

Comments
 (0)