Skip to content

Commit c1751bf

Browse files
committed
Create universal framework to support watchOS & tvOS by using xcconfigs.
1 parent e49b1c6 commit c1751bf

File tree

12 files changed

+114
-386
lines changed

12 files changed

+114
-386
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Carthage/Checkouts/xcconfigs"]
2+
path = Carthage/Checkouts/xcconfigs
3+
url = https://github.com/mrackwitz/xcconfigs.git

Cartfile.private

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github "mrackwitz/xcconfigs"

Cartfile.resolved

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github "mrackwitz/xcconfigs" "3.0"

Carthage/Checkouts/xcconfigs

Submodule xcconfigs added at 6b2682f

Configurations/Base.xcconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// Base.xcconfig
3+
// SwiftState
4+
//
5+
// Created by Yasuhiro Inami on 2015-12-09.
6+
// Copyright © 2015 Yasuhiro Inami. All rights reserved.
7+
//
8+
9+
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer;
10+
MACOSX_DEPLOYMENT_TARGET = 10.9;
11+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
12+
WATCHOS_DEPLOYMENT_TARGET = 2.0;
13+
TVOS_DEPLOYMENT_TARGET = 9.0;

Configurations/Debug.xcconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// Debug.xcconfig
3+
// SwiftState
4+
//
5+
// Created by Yasuhiro Inami on 2015-12-09.
6+
// Copyright © 2015 Yasuhiro Inami. All rights reserved.
7+
//
8+
9+
#include "Base.xcconfig"
10+
11+
SWIFT_OPTIMIZATION_LEVEL = -Onone;

Configurations/Release.xcconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// Release.xcconfig
3+
// SwiftState
4+
//
5+
// Created by Yasuhiro Inami on 2015-12-09.
6+
// Copyright © 2015 Yasuhiro Inami. All rights reserved.
7+
//
8+
9+
#include "Base.xcconfig"
10+
11+
SWIFT_OPTIMIZATION_LEVEL = -Owholemodule;

Sources/_Random.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2015 Yasuhiro Inami. All rights reserved.
77
//
88

9-
#if os(OSX) || os(iOS)
9+
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
1010
import Darwin
1111
#else
1212
import Glibc

SwiftState.xcodeproj/project.pbxproj

Lines changed: 58 additions & 276 deletions
Large diffs are not rendered by default.

SwiftState.xcodeproj/xcshareddata/xcschemes/SwiftState-iOS.xcscheme

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

SwiftState.xcodeproj/xcshareddata/xcschemes/SwiftState-OSX.xcscheme renamed to SwiftState.xcodeproj/xcshareddata/xcschemes/SwiftState.xcscheme

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
BuildableIdentifier = "primary"
1717
BlueprintIdentifier = "1FA61FFF1996601000460108"
1818
BuildableName = "SwiftState.framework"
19-
BlueprintName = "SwiftState-OSX"
19+
BlueprintName = "SwiftState"
2020
ReferencedContainer = "container:SwiftState.xcodeproj">
2121
</BuildableReference>
2222
</BuildActionEntry>
@@ -34,8 +34,8 @@
3434
<BuildableReference
3535
BuildableIdentifier = "primary"
3636
BlueprintIdentifier = "1FA6200A1996601000460108"
37-
BuildableName = "SwiftState-OSXTests.xctest"
38-
BlueprintName = "SwiftState-OSXTests"
37+
BuildableName = "SwiftStateTests.xctest"
38+
BlueprintName = "SwiftStateTests"
3939
ReferencedContainer = "container:SwiftState.xcodeproj">
4040
</BuildableReference>
4141
</TestableReference>
@@ -45,7 +45,7 @@
4545
BuildableIdentifier = "primary"
4646
BlueprintIdentifier = "1FA61FFF1996601000460108"
4747
BuildableName = "SwiftState.framework"
48-
BlueprintName = "SwiftState-OSX"
48+
BlueprintName = "SwiftState"
4949
ReferencedContainer = "container:SwiftState.xcodeproj">
5050
</BuildableReference>
5151
</MacroExpansion>
@@ -67,7 +67,7 @@
6767
BuildableIdentifier = "primary"
6868
BlueprintIdentifier = "1FA61FFF1996601000460108"
6969
BuildableName = "SwiftState.framework"
70-
BlueprintName = "SwiftState-OSX"
70+
BlueprintName = "SwiftState"
7171
ReferencedContainer = "container:SwiftState.xcodeproj">
7272
</BuildableReference>
7373
</MacroExpansion>
@@ -85,7 +85,7 @@
8585
BuildableIdentifier = "primary"
8686
BlueprintIdentifier = "1FA61FFF1996601000460108"
8787
BuildableName = "SwiftState.framework"
88-
BlueprintName = "SwiftState-OSX"
88+
BlueprintName = "SwiftState"
8989
ReferencedContainer = "container:SwiftState.xcodeproj">
9090
</BuildableReference>
9191
</MacroExpansion>

circle.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
machine:
22
xcode:
33
version: "7.0"
4-
4+
5+
checkout:
6+
post:
7+
- git submodule sync
8+
- git submodule update --init
9+
510
test:
611
override:
712
- set -o pipefail &&
813
xcodebuild
9-
-scheme "SwiftState-OSX"
14+
-scheme "SwiftState"
1015
clean build test |
1116
tee $CIRCLE_ARTIFACTS/xcode_raw-OSX.log |
1217
xcpretty --color --report junit --output $CIRCLE_TEST_REPORTS/xcode/results-OSX.xml
@@ -18,7 +23,7 @@ test:
1823
PROVISIONING_PROFILE=
1924
-sdk iphonesimulator
2025
-destination 'platform=iOS Simulator,OS=9.0,name=iPhone 6'
21-
-scheme "SwiftState-iOS"
26+
-scheme "SwiftState"
2227
clean build test |
2328
tee $CIRCLE_ARTIFACTS/xcode_raw-iOS.log |
2429
xcpretty --color --report junit --output $CIRCLE_TEST_REPORTS/xcode/results-iOS.xml

0 commit comments

Comments
 (0)