Skip to content

Commit

Permalink
Update to run with Swift 4.2 & ReSwift-Thunk (#20)
Browse files Browse the repository at this point in the history
* Modification to run with Swift 4.2 and the latest libraries.
    * Update libraries to the versionis those are compatible with Swift 4.2 and Xcode 10.1
    * Modify the source code to compile with current libraries and Swift 4.2
    * Update the project settings to the recommendation from Xcode 10.1.
* update .travis.yml to use Xcode 10.1
* use ReSwiftThunk instead of depreacted APIs.
  • Loading branch information
yamoridon authored and DivineDominion committed Jul 3, 2019
1 parent 35705ac commit 05eb29a
Show file tree
Hide file tree
Showing 16 changed files with 207 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ env:
- LANG=en_US.UTF-8
- APP_NAME="SwiftFlowGitHubBrowser"

osx_image: xcode9
osx_image: xcode10.1

matrix:
include:
- env: SDK="iphonesimulator" DESTINATION="OS=11.0,name=iPhone 8"
- env: SDK="iphonesimulator" DESTINATION="OS=12.1,name=iPhone 8"

before_install:
- carthage update --no-use-binaries --platform iOS
Expand Down
14 changes: 8 additions & 6 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
github "nerdishbynature/octokit.swift" ~> 0.7.0
github "Quick/Quick"
github "Quick/Nimble"
github "soffes/SSKeychain"
github "nerdishbynature/octokit.swift"
github "nerdishbynature/RequestKit" "2.3.0"
github "Quick/Quick" "master"
github "Quick/Nimble" "master"
github "soffes/SSKeychain" "master"
github "Ben-G/ListKit"
github "ReSwift/ReSwift" ~> 4.0.0
github "ReSwift/ReSwiftRouter" ~> 0.6.0
github "ReSwift/ReSwift" "master"
github "ReSwift/ReSwiftRouter" "master"
github "ReSwift/ReSwift-Thunk" "1.1.0"
15 changes: 8 additions & 7 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
github "Ben-G/ListKit" "2.0.0"
github "Quick/Nimble" "v7.0.2"
github "Quick/Quick" "v1.2.0"
github "ReSwift/ReSwift" "4.0.0"
github "ReSwift/ReSwiftRouter" "0.6.0"
github "nerdishbynature/RequestKit" "2.0.2"
github "nerdishbynature/octokit.swift" "0.7.4"
github "soffes/SSKeychain" "v1.5.3"
github "Quick/Nimble" "d7a8451738e22e76f0465d72b9f3c054df16a56b"
github "Quick/Quick" "5ba1cef76f4dbd24a2ce5a804571667ebfef71a3"
github "ReSwift/ReSwift" "5b7a5c6cd05fa2b7d3f68ef7765acb2ba696d83c"
github "ReSwift/ReSwift-Thunk" "1.1.0"
github "ReSwift/ReSwiftRouter" "17773950b0d1031e185fe6c15cda705fe2b5c204"
github "nerdishbynature/RequestKit" "2.3.0"
github "nerdishbynature/octokit.swift" "0.9.0"
github "soffes/SSKeychain" "d3d64f8c5fa14bf2adb2d51a18ee8b6639232ca5"
101 changes: 90 additions & 11 deletions SwiftFlowGitHubBrowser.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
62EF0AB61C700D4900D13711 /* GitHubAuthSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62EF0AB51C700D4900D13711 /* GitHubAuthSpec.swift */; };
62EF0ABA1C700D9D00D13711 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62EF0AA81C700D1F00D13711 /* Nimble.framework */; };
62EF0ABB1C700DA200D13711 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62EF0A8D1C700D1200D13711 /* Quick.framework */; };
66C463FC22270A970006963A /* ReSwiftThunk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66C463F922270A7C0006963A /* ReSwiftThunk.framework */; };
66C463FD22270A970006963A /* ReSwiftThunk.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 66C463F922270A7C0006963A /* ReSwiftThunk.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
7A7A57191C91D78C00670D38 /* ListKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 62C935581C8CD6B400887A23 /* ListKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -490,6 +492,27 @@
remoteGlobalIDString = 1F5DF15E1BDCA0CE00C3A531;
remoteInfo = "Nimble-tvOSTests";
};
66C463F822270A7C0006963A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 66C463F322270A7C0006963A /* ReSwift-Thunk.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 65A3D6D5218B89A60075CB92;
remoteInfo = "ReSwift-Thunk";
};
66C463FA22270A7C0006963A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 66C463F322270A7C0006963A /* ReSwift-Thunk.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 65A3D6DE218B89A60075CB92;
remoteInfo = "ReSwift-Thunk-Tests";
};
66C463FE22270A970006963A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 66C463F322270A7C0006963A /* ReSwift-Thunk.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 65A3D6D4218B89A60075CB92;
remoteInfo = "ReSwift-Thunk";
};
7A7A571A1C91D78C00670D38 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 62C9354C1C8CD6B300887A23 /* ListKit.xcodeproj */;
Expand All @@ -508,6 +531,7 @@
files = (
254B3B961D3ABBFF00B1E4F0 /* OctoKit.framework in Embed Frameworks */,
254B3B9A1D3ABC0400B1E4F0 /* RequestKit.framework in Embed Frameworks */,
66C463FD22270A970006963A /* ReSwiftThunk.framework in Embed Frameworks */,
2565B89F1DE7506C0016371D /* ReSwift.framework in Embed Frameworks */,
7A7A57191C91D78C00670D38 /* ListKit.framework in Embed Frameworks */,
2565B86A1DE74F440016371D /* SAMKeychain.framework in Embed Frameworks */,
Expand Down Expand Up @@ -557,6 +581,7 @@
62EF0A801C700D1200D13711 /* Quick.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Quick.xcodeproj; path = Carthage/Checkouts/Quick/Quick.xcodeproj; sourceTree = SOURCE_ROOT; };
62EF0A9E1C700D1F00D13711 /* Nimble.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Nimble.xcodeproj; path = Carthage/Checkouts/Nimble/Nimble.xcodeproj; sourceTree = SOURCE_ROOT; };
62EF0AB51C700D4900D13711 /* GitHubAuthSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GitHubAuthSpec.swift; sourceTree = "<group>"; };
66C463F322270A7C0006963A /* ReSwift-Thunk.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "ReSwift-Thunk.xcodeproj"; path = "Carthage/Checkouts/ReSwift-Thunk/ReSwift-Thunk.xcodeproj"; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -566,6 +591,7 @@
files = (
254B3B951D3ABBFF00B1E4F0 /* OctoKit.framework in Frameworks */,
254B3B9D1D3ABC0A00B1E4F0 /* ReSwift.framework in Frameworks */,
66C463FC22270A970006963A /* ReSwiftThunk.framework in Frameworks */,
254B3B991D3ABC0400B1E4F0 /* RequestKit.framework in Frameworks */,
62C935791C8CD6E500887A23 /* ListKit.framework in Frameworks */,
254B3BA11D3ABC1300B1E4F0 /* ReSwiftRouter.framework in Frameworks */,
Expand Down Expand Up @@ -733,6 +759,7 @@
25BB76321C3CBA99008EA13B /* Dependencies */ = {
isa = PBXGroup;
children = (
66C463F322270A7C0006963A /* ReSwift-Thunk.xcodeproj */,
253038E91D92D8B900AA49F4 /* SAMKeychain.xcodeproj */,
254B3B7D1D3ABBCE00B1E4F0 /* OctoKit.xcodeproj */,
254B3B651D3ABBC400B1E4F0 /* RequestKit.xcodeproj */,
Expand Down Expand Up @@ -878,6 +905,15 @@
path = GithubAuthSpec;
sourceTree = "<group>";
};
66C463F422270A7C0006963A /* Products */ = {
isa = PBXGroup;
children = (
66C463F922270A7C0006963A /* ReSwiftThunk.framework */,
66C463FB22270A7C0006963A /* ReSwift-Thunk-Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -899,6 +935,7 @@
254B3B9C1D3ABC0400B1E4F0 /* PBXTargetDependency */,
254B3BA01D3ABC0A00B1E4F0 /* PBXTargetDependency */,
254B3BA41D3ABC1300B1E4F0 /* PBXTargetDependency */,
66C463FF22270A970006963A /* PBXTargetDependency */,
);
name = SwiftFlowGitHubBrowser;
productName = SwiftFlowGitHubBrowser;
Expand Down Expand Up @@ -930,7 +967,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0730;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "Benji Encz";
TargetAttributes = {
25BB761C1C3CB8CB008EA13B = {
Expand Down Expand Up @@ -976,6 +1013,10 @@
ProductGroup = 254B3B661D3ABBC400B1E4F0 /* Products */;
ProjectRef = 254B3B651D3ABBC400B1E4F0 /* RequestKit.xcodeproj */;
},
{
ProductGroup = 66C463F422270A7C0006963A /* Products */;
ProjectRef = 66C463F322270A7C0006963A /* ReSwift-Thunk.xcodeproj */;
},
{
ProductGroup = 254B3B4E1D3ABBB400B1E4F0 /* Products */;
ProjectRef = 254B3B4D1D3ABBB400B1E4F0 /* ReSwift.xcodeproj */;
Expand Down Expand Up @@ -1404,6 +1445,20 @@
remoteRef = 62EF0AB11C700D1F00D13711 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
66C463F922270A7C0006963A /* ReSwiftThunk.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = ReSwiftThunk.framework;
remoteRef = 66C463F822270A7C0006963A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
66C463FB22270A7C0006963A /* ReSwift-Thunk-Tests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = "ReSwift-Thunk-Tests.xctest";
remoteRef = 66C463FA22270A7C0006963A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
Expand Down Expand Up @@ -1508,6 +1563,11 @@
target = 25BB761C1C3CB8CB008EA13B /* SwiftFlowGitHubBrowser */;
targetProxy = 62EF0A7A1C700C2300D13711 /* PBXContainerItemProxy */;
};
66C463FF22270A970006963A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "ReSwift-Thunk";
targetProxy = 66C463FE22270A970006963A /* PBXContainerItemProxy */;
};
7A7A571B1C91D78C00670D38 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = ListKit;
Expand Down Expand Up @@ -1543,13 +1603,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -1571,7 +1641,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -1588,13 +1658,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -1610,9 +1690,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand All @@ -1621,36 +1702,34 @@
25BB76301C3CB8CB008EA13B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)/**",
"$(SRCROOT)/Carthage/Build/iOS/**",
);
INFOPLIST_FILE = SwiftFlowGitHubBrowser/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "Swift-Flow.SwiftFlowGitHubBrowser";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
25BB76311C3CB8CB008EA13B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)/**",
"$(SRCROOT)/Carthage/Build/iOS/**",
);
INFOPLIST_FILE = SwiftFlowGitHubBrowser/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "Swift-Flow.SwiftFlowGitHubBrowser";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1668,7 +1747,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "de.benjamin-encz.SwiftFlowGitHubBrowserTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftFlowGitHubBrowser.app/SwiftFlowGitHubBrowser";
};
name = Debug;
Expand All @@ -1686,7 +1765,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "de.benjamin-encz.SwiftFlowGitHubBrowserTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftFlowGitHubBrowser.app/SwiftFlowGitHubBrowser";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
11 changes: 5 additions & 6 deletions SwiftFlowGitHubBrowser/APIRequests/GitHubRepositories.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
import Foundation
import OctoKit
import ReSwift
import ReSwiftThunk

func fetchGitHubRepositories(state: State, store: Store<State>) -> Action? {
guard case let .loggedIn(configuration) = state.authenticationState.loggedInState else { return nil }
let fetchGitHubRepositories = Thunk<State> { dispatch, getState in
guard case let .loggedIn(configuration)? = getState()?.authenticationState.loggedInState else { return }

Octokit(configuration).repositories { response in
_ = Octokit(configuration).repositories { response in
DispatchQueue.main.async {
store.dispatch(SetRepositories(repositories: response))
dispatch(SetRepositories(repositories: response))
}
}

return nil
}
Loading

0 comments on commit 05eb29a

Please sign in to comment.