Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile with swift 4.2, turn off swift 3 objc inference in tests, cle… #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Carthage/Build

# CocoaPods
Pods
Example/Birdsong.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
4 changes: 2 additions & 2 deletions Birdsong.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Pod::Spec.new do |s|
s.author = { 'Simon Manning' => 'https://github.com/sjrmanning' }
s.social_media_url = 'https://twitter.com/sjrmanning'
s.source = { :git => 'https://github.com/sjrmanning/Birdsong.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.source_files = 'Source/**/*'
s.dependency 'Starscream', '3.0.2'
s.dependency 'Starscream', '3.1.0'
end
89 changes: 25 additions & 64 deletions Example/Birdsong.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
0E3796FC89AB0C2AFCBBC66B /* Pods_Birdsong_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Birdsong_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2F656ACE77B9220D4FA5AA3F /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
3FDEA1DF5861851FD051F1F9 /* Pods_Birdsong_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Birdsong_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
473E2D38760B4DA1DDBAF6DD /* Birdsong.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Birdsong.podspec; path = ../Birdsong.podspec; sourceTree = "<group>"; };
473E2D38760B4DA1DDBAF6DD /* Birdsong.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Birdsong.podspec; path = ../Birdsong.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
5D40F13EA17DC65021D49E6E /* Pods-Birdsong_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Birdsong_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Birdsong_Tests/Pods-Birdsong_Tests.release.xcconfig"; sourceTree = "<group>"; };
607FACD01AFB9204008FA782 /* Birdsong_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Birdsong_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -168,7 +168,6 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
9CE1991E1F6192BB50714C1B /* [CP] Embed Pods Frameworks */,
BE77FC74F235E75957F753B6 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -187,8 +186,6 @@
607FACE11AFB9204008FA782 /* Sources */,
607FACE21AFB9204008FA782 /* Frameworks */,
607FACE31AFB9204008FA782 /* Resources */,
DBE71177C04F62C013D9A65E /* [CP] Embed Pods Frameworks */,
ACB9F40620DF0D3283D0DA63 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -207,16 +204,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
Expand All @@ -226,6 +223,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -266,7 +264,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Birdsong/Birdsong.framework",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
);
Expand All @@ -277,52 +275,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
ACB9F40620DF0D3283D0DA63 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Birdsong_Tests/Pods-Birdsong_Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
BE77FC74F235E75957F753B6 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
DBE71177C04F62C013D9A65E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Birdsong_Tests/Pods-Birdsong_Tests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E5A7D5FF01CFE605A464C460 /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -407,6 +360,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -415,12 +369,14 @@
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;
Expand Down Expand Up @@ -448,7 +404,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -460,6 +416,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -468,12 +425,14 @@
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;
Expand All @@ -494,7 +453,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -509,12 +468,13 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Birdsong/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -525,12 +485,13 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Birdsong/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -550,8 +511,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -567,8 +528,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -70,7 +69,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion Example/Birdsong/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window!.backgroundColor = UIColor.white
self.window!.makeKeyAndVisible()
Expand Down
4 changes: 2 additions & 2 deletions Example/Birdsong/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class ViewController: UIViewController {
width: viewSize.width * 0.8,
height: 100)

sendMessageButton.setTitle("Send message", for: UIControlState())
sendMessageButton.setTitleColor(UIColor.red, for: UIControlState())
sendMessageButton.setTitle("Send message", for: UIControl.State())
sendMessageButton.setTitleColor(UIColor.red, for: UIControl.State())
sendMessageButton.addTarget(self,
action: #selector(sendMessage),
for: .touchUpInside)
Expand Down
8 changes: 0 additions & 8 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,4 @@ target 'Birdsong_Example' do
inherit! :search_paths
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
puts "[post install] " << target.name << ":" << config.name << " set SWIFT_VERSION to 3.0"
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
end
20 changes: 12 additions & 8 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
PODS:
- Birdsong (0.5.2):
- Starscream (= 3.0.2)
- Starscream (3.0.2)
- Birdsong (0.6.1):
- Starscream (= 3.1.0)
- Starscream (3.1.0)

DEPENDENCIES:
- Birdsong (from `../`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Starscream

EXTERNAL SOURCES:
Birdsong:
:path: ../
:path: "../"

SPEC CHECKSUMS:
Birdsong: 71f36b17508bd4c10419a2f9db53fa2625caa43c
Starscream: b512c62f6706421221b5ceb2ba01a9f58aca5bea
Birdsong: ccd865dac4e05e495846367ed7f2d810d9558d51
Starscream: 08172b481e145289c4930cb567230fb55897cfa4

PODFILE CHECKSUM: fd31310a2947ba719ecd745ba9c1838097125604
PODFILE CHECKSUM: 722cbca4358a62b46f06250f5942a254480667ad

COCOAPODS: 1.3.1
COCOAPODS: 1.6.1
4 changes: 2 additions & 2 deletions Source/Channel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import Foundation
open class Channel {
// MARK: - Properties

open let topic: String
open let params: Socket.Payload
public let topic: String
public let params: Socket.Payload
fileprivate weak var socket: Socket?
fileprivate(set) open var state: State

Expand Down
2 changes: 1 addition & 1 deletion Source/Presence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public final class Presence {

// Otherwise, we need to find the phx_ref keys to delete.
let metas = entry["metas"] as? [Meta]
if let refsToDelete = metas?.flatMap({ $0["phx_ref"] as? String }) {
if let refsToDelete = metas?.compactMap({ $0["phx_ref"] as? String }) {
existing = existing.filter {
if let phxRef = $0["phx_ref"] as? String {
return !refsToDelete.contains(phxRef)
Expand Down
8 changes: 4 additions & 4 deletions Source/Response.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import Foundation

open class Response {
open let ref: String
open let topic: String
open let event: String
open let payload: Socket.Payload
public let ref: String
public let topic: String
public let event: String
public let payload: Socket.Payload

init?(data: Data) {
do {
Expand Down