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

Swift 4 support and general build setting updates #741

Merged
merged 12 commits into from
Dec 31, 2017
18 changes: 15 additions & 3 deletions Analytics.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0810;
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = Segment;
TargetAttributes = {
EADEB85A1DECD080005322DA = {
Expand Down Expand Up @@ -649,15 +649,21 @@
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_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
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_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_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
Expand Down Expand Up @@ -686,6 +692,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -701,15 +708,21 @@
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_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
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_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_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
Expand All @@ -732,6 +745,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -796,7 +810,6 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "AnalyticsTests/AnalyticsTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -810,7 +823,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "AnalyticsTests/AnalyticsTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
};
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 = "0810"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
Expand Down Expand Up @@ -56,6 +57,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
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 = "0810"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -10,6 +10,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -30,6 +31,7 @@
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 AnalyticsTests/HTTPClientTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class HTTPClientTest: QuickSpec {
var done = false
let task = client.settings(forWriteKey: "foo", completionHandler: { success, settings in
expect(success) == true
expect((settings as? NSDictionary)) == [
expect(settings as NSDictionary?) == [
"integrations": [
"Segment.io": [
"apiKey":"foo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand Down Expand Up @@ -274,6 +275,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -290,7 +292,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.segment.CarthageExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -306,7 +307,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.segment.CarthageExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
EADEB9111DED460A005322DA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = Segment;
TargetAttributes = {
EADEB9181DED460A005322DA = {
Expand Down Expand Up @@ -268,15 +268,22 @@
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_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
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_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_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -315,15 +322,22 @@
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_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
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_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_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down
6 changes: 3 additions & 3 deletions Examples/CocoapodsExample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Analytics (3.6.8)
- Analytics (3.6.9)

DEPENDENCIES:
- Analytics (from `../../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: ../../

SPEC CHECKSUMS:
Analytics: 6f00cff963ca3b9a4ffdfe3b6dc5564405431f60
Analytics: a4812262f46dde43a218c5663ca07d177f30372c

PODFILE CHECKSUM: 20b258e875ed60a69591787e49bdc3ca9f7c4ad3

COCOAPODS: 1.3.1
COCOAPODS: 1.4.0.rc.1
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
SDK ?= "iphonesimulator"
DESTINATION ?= "platform=iOS Simulator,name=iPhone 7"
DESTINATION ?= "platform=iOS Simulator,name=iPhone X"
PROJECT := Analytics
XC_ARGS := -scheme $(PROJECT) -workspace $(PROJECT).xcworkspace -sdk $(SDK) -destination $(DESTINATION) ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
XC_ARGS := -scheme $(PROJECT) -workspace $(PROJECT).xcworkspace -sdk $(SDK) -destination $(DESTINATION) GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES
XC_BUILD_ARGS := ONLY_ACTIVE_ARCH=NO
XC_TEST_ARGS := GCC_GENERATE_TEST_COVERAGE_FILES=YES

bootstrap:
.buildscript/bootstrap.sh
Expand All @@ -22,19 +24,19 @@ clean:
xcodebuild $(XC_ARGS) clean

build:
xcodebuild $(XC_ARGS)
xcodebuild $(XC_ARGS) $(XC_BUILD_ARGS)

test:
xcodebuild test $(XC_ARGS)
xcodebuild test $(XC_ARGS) $(XC_TEST_ARGS)

clean-pretty:
set -o pipefail && xcodebuild $(XC_ARGS) clean | xcpretty

build-pretty:
set -o pipefail && xcodebuild $(XC_ARGS) | xcpretty
set -o pipefail && xcodebuild $(XC_ARGS) $(XC_BUILD_ARGS) | xcpretty

test-pretty:
set -o pipefail && xcodebuild test $(XC_ARGS) | xcpretty --report junit
set -o pipefail && xcodebuild test $(XC_ARGS) $(XC_TEST_ARGS) | xcpretty --report junit

xcbuild:
xctool $(XC_ARGS)
Expand Down
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@


target 'AnalyticsTests' do
platform :ios, '10.1'
platform :ios, '11'

use_frameworks!

pod 'Quick', '~> 1.2.0' # runner lib
pod 'Nimble', '~> 7.0.2' # Matcher lib
pod 'Nimble', '~> 7.0.3' # Matcher lib
pod 'Nocilla', '~> 0.11.0' # HTTP Mocking Library
pod 'SwiftTryCatch', :git => 'https://github.com/segmentio/SwiftTryCatch.git' # Utils lib

Expand Down
16 changes: 8 additions & 8 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- Nimble (7.0.2)
- Nimble (7.0.3)
- Nocilla (0.11.0)
- Quick (1.2.0)
- SwiftTryCatch (0.0.1)
- SwiftTryCatch (1.0.0)

DEPENDENCIES:
- Nimble (~> 7.0.2)
- Nimble (~> 7.0.3)
- Nocilla (~> 0.11.0)
- Quick (~> 1.2.0)
- SwiftTryCatch (from `https://github.com/segmentio/SwiftTryCatch.git`)
Expand All @@ -16,15 +16,15 @@ EXTERNAL SOURCES:

CHECKOUT OPTIONS:
SwiftTryCatch:
:commit: dcdc954cb0945faaf33800b4b913e04d2ebdd965
:commit: 2cdec294628f73350c5d8f6f05d08886af57668b
:git: https://github.com/segmentio/SwiftTryCatch.git

SPEC CHECKSUMS:
Nimble: bfe1f814edabba69ff145cb1283e04ed636a67f2
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
Nocilla: 7af7a386071150cc8aa5da4da97d060f049dd61c
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
SwiftTryCatch: fb6d2b34abe48efd69578dac919293a44f95b481
SwiftTryCatch: 2f4ef36cf5396bdb450006b70633dbce5260d3b3

PODFILE CHECKSUM: 25d553a80951f726d31098fb274eedfdc7fce4d9
PODFILE CHECKSUM: ceb786c99293d3658014513be0e69ec381216acd

COCOAPODS: 1.3.1
COCOAPODS: 1.4.0.rc.1
3 changes: 2 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# TODO: Upgrade to circle 2.0 syntax
machine:
xcode:
version: "8.2.1"
version: "9.0"

dependencies:
pre:
Expand Down