Skip to content

Commit 9cab023

Browse files
migs647Brandon Sneed
andauthored
Bsneed/version fixes (#966)
* Set target OS versions consistently across the board. * Fixed warning w/ shadow var * Use @import directive where possible. * Removed linked frameworks; Prefer language feature imports instead. * Fixed warning about viewDidAppear selector on macOS * Updated version numbers for all dependencies Co-authored-by: Brandon Sneed <[email protected]>
1 parent 70f5c4e commit 9cab023

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+75
-86
lines changed

Analytics.podspec

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ Pod::Spec.new do |s|
1515
s.source = { :git => "https://github.com/segmentio/analytics-ios.git", :tag => s.version.to_s }
1616
s.social_media_url = 'https://twitter.com/segment'
1717

18-
s.ios.deployment_target = '11.0'
19-
s.tvos.deployment_target = '9.0'
20-
21-
s.ios.frameworks = 'CoreTelephony'
22-
s.frameworks = 'Security', 'StoreKit', 'SystemConfiguration', 'UIKit'
18+
s.ios.deployment_target = '10.0'
19+
s.tvos.deployment_target = '10.0'
20+
s.osx.deployment_target = '10.13'
2321

2422
s.source_files = [
2523
'Segment/Classes/**/*.{h,m}',

Package.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PackageDescription
66
let package = Package(
77
name: "Segment",
88
platforms: [
9-
.iOS(.v12), .tvOS(.v12)
9+
.iOS(.v10), .tvOS(.v10), .macOS(.v10_13)
1010
],
1111
products: [
1212
// Products define the executables and libraries produced by a package, and make them visible to other packages.
@@ -31,10 +31,7 @@ let package = Package(
3131
cSettings: [
3232
.headerSearchPath("Internal"),
3333
.headerSearchPath("Classes")
34-
],
35-
linkerSettings: [
36-
.linkedFramework("CoreTelephony", .when(platforms: [.iOS, .macOS]))
3734
]
38-
),
35+
)
3936
]
4037
)

Segment.xcodeproj/project.pbxproj

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@
463463
isa = PBXProject;
464464
attributes = {
465465
LastSwiftUpdateCheck = 0810;
466-
LastUpgradeCheck = 1130;
466+
LastUpgradeCheck = 1200;
467467
ORGANIZATIONNAME = Segment;
468468
TargetAttributes = {
469469
EADEB85A1DECD080005322DA = {
@@ -607,6 +607,7 @@
607607
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
608608
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
609609
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
610+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
610611
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
611612
CLANG_WARN_STRICT_PROTOTYPES = YES;
612613
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -634,13 +635,17 @@
634635
GCC_WARN_UNUSED_FUNCTION = YES;
635636
GCC_WARN_UNUSED_VARIABLE = YES;
636637
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
638+
MACOSX_DEPLOYMENT_TARGET = 10.13;
637639
MTL_ENABLE_DEBUG_INFO = YES;
638640
ONLY_ACTIVE_ARCH = YES;
639641
SDKROOT = iphoneos;
642+
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx";
640643
SWIFT_VERSION = 4.0;
641-
TARGETED_DEVICE_FAMILY = "1,2";
644+
TARGETED_DEVICE_FAMILY = "1,2,3";
645+
TVOS_DEPLOYMENT_TARGET = 10.0;
642646
VERSIONING_SYSTEM = "apple-generic";
643647
VERSION_INFO_PREFIX = "";
648+
WATCHOS_DEPLOYMENT_TARGET = 7.0;
644649
};
645650
name = Debug;
646651
};
@@ -669,6 +674,7 @@
669674
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
670675
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
671676
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
677+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
672678
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
673679
CLANG_WARN_STRICT_PROTOTYPES = YES;
674680
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -690,14 +696,18 @@
690696
GCC_WARN_UNUSED_FUNCTION = YES;
691697
GCC_WARN_UNUSED_VARIABLE = YES;
692698
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
699+
MACOSX_DEPLOYMENT_TARGET = 10.13;
693700
MTL_ENABLE_DEBUG_INFO = NO;
694701
SDKROOT = iphoneos;
702+
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx";
695703
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
696704
SWIFT_VERSION = 4.0;
697-
TARGETED_DEVICE_FAMILY = "1,2";
705+
TARGETED_DEVICE_FAMILY = "1,2,3";
706+
TVOS_DEPLOYMENT_TARGET = 10.0;
698707
VALIDATE_PRODUCT = YES;
699708
VERSIONING_SYSTEM = "apple-generic";
700709
VERSION_INFO_PREFIX = "";
710+
WATCHOS_DEPLOYMENT_TARGET = 7.0;
701711
};
702712
name = Release;
703713
};
@@ -722,9 +732,6 @@
722732
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
723733
SDKROOT = iphoneos;
724734
SKIP_INSTALL = YES;
725-
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx";
726-
TARGETED_DEVICE_FAMILY = "1,2,3";
727-
TVOS_DEPLOYMENT_TARGET = 9.0;
728735
};
729736
name = Debug;
730737
};
@@ -749,9 +756,6 @@
749756
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
750757
SDKROOT = iphoneos;
751758
SKIP_INSTALL = YES;
752-
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx";
753-
TARGETED_DEVICE_FAMILY = "1,2,3";
754-
TVOS_DEPLOYMENT_TARGET = 9.0;
755759
};
756760
name = Release;
757761
};

Segment.xcodeproj/xcshareddata/xcschemes/Segment.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 = "1130"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Segment.xcodeproj/xcshareddata/xcschemes/SegmentTests.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 = "1130"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Segment.xcodeproj/xcshareddata/xcschemes/SegmentTestsTVOS.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 = "1130"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Segment/Classes/SEGAliasPayload.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGPayload.h"
33

44
NS_ASSUME_NONNULL_BEGIN

Segment/Classes/SEGAnalytics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGIntegrationFactory.h"
33
#import "SEGCrypto.h"
44
#import "SEGAnalyticsConfiguration.h"

Segment/Classes/SEGAnalyticsConfiguration.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
// Copyright © 2016 Segment. All rights reserved.
77
//
88

9-
#import <Foundation/Foundation.h>
9+
@import Foundation;
1010

1111
#if TARGET_OS_IPHONE
12-
#import <UIKit/UIKit.h>
12+
@import UIKit;
1313
#elif TARGET_OS_OSX
14-
#import <Cocoa/Cocoa.h>
14+
@import Cocoa;
1515
#endif
1616

1717
NS_SWIFT_NAME(ApplicationProtocol)

Segment/Classes/SEGAnalyticsConfiguration.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#import "SEGMiddleware.h"
1212
#import "SEGCrypto.h"
1313
#if TARGET_OS_IPHONE
14-
#import <UIKit/UIKit.h>
14+
@import UIKit;
1515
#elif TARGET_OS_OSX
16-
#import <Cocoa/Cocoa.h>
16+
@import Cocoa;
1717
#endif
1818

1919
#if TARGET_OS_IPHONE

Segment/Classes/SEGAnalyticsUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22

33
NS_ASSUME_NONNULL_BEGIN
44

Segment/Classes/SEGContext.h

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

9-
#import <Foundation/Foundation.h>
9+
@import Foundation;
1010
#import "SEGIntegration.h"
1111

1212
typedef NS_ENUM(NSInteger, SEGEventType) {

Segment/Classes/SEGCrypto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Copyright © 2016 Segment. All rights reserved.
66
//
77

8-
#import <Foundation/Foundation.h>
8+
@import Foundation;
99

1010
@protocol SEGCrypto <NSObject>
1111

Segment/Classes/SEGGroupPayload.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGPayload.h"
33

44
NS_ASSUME_NONNULL_BEGIN

Segment/Classes/SEGHTTPClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGAnalytics.h"
33

44
// TODO: Make this configurable via SEGAnalyticsConfiguration

Segment/Classes/SEGIdentifyPayload.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGPayload.h"
33

44
NS_ASSUME_NONNULL_BEGIN

Segment/Classes/SEGIntegration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGIdentifyPayload.h"
33
#import "SEGTrackPayload.h"
44
#import "SEGScreenPayload.h"

Segment/Classes/SEGIntegrationFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGIntegration.h"
33
#import "SEGAnalytics.h"
44

Segment/Classes/SEGMiddleware.h

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

9-
#import <Foundation/Foundation.h>
9+
@import Foundation;
1010
#import "SEGContext.h"
1111

1212
typedef void (^SEGMiddlewareNext)(SEGContext *_Nullable newContext);

Segment/Classes/SEGPayload.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGSerializableValue.h"
33

44
NS_ASSUME_NONNULL_BEGIN

Segment/Classes/SEGReachability.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
POSSIBILITY OF SUCH DAMAGE.
2222
*/
2323

24-
#import <Foundation/Foundation.h>
25-
#import <SystemConfiguration/SystemConfiguration.h>
24+
@import Foundation;
25+
@import SystemConfiguration;
2626

2727
/**
2828
* Does ARC support GCD objects?

Segment/Classes/SEGScreenPayload.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGPayload.h"
33

44
NS_ASSUME_NONNULL_BEGIN

Segment/Classes/SEGScreenReporting.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#if TARGET_OS_IPHONE
2-
#import <UIKit/UIKit.h>
2+
@import UIKit;
33
#elif TARGET_OS_OSX
4-
#import <Cocoa/Cocoa.h>
4+
@import Cocoa;
55
#endif
66

77
#import "SEGSerializableValue.h"

Segment/Classes/SEGSegmentIntegration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGIntegration.h"
33
#import "SEGHTTPClient.h"
44
#import "SEGStorage.h"

Segment/Classes/SEGSegmentIntegration.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@
1010
#import "SEGState.h"
1111

1212
#if TARGET_OS_IPHONE
13-
#import <UIKit/UIKit.h>
14-
#endif
15-
16-
#if TARGET_OS_IOS
17-
#import <CoreTelephony/CTCarrier.h>
18-
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
13+
@import UIKit;
1914
#endif
2015

2116
NSString *const SEGSegmentDidSendRequestNotification = @"SegmentDidSendRequest";

Segment/Classes/SEGSegmentIntegrationFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGIntegrationFactory.h"
33
#import "SEGHTTPClient.h"
44
#import "SEGStorage.h"

Segment/Classes/SEGSerializableValue.h

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

9-
#import <Foundation/Foundation.h>
9+
@import Foundation;
1010

1111
/*
1212
Acceptable dictionary values are

Segment/Classes/SEGStorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Copyright © 2016 Segment. All rights reserved.
66
//
77

8-
#import <Foundation/Foundation.h>
8+
@import Foundation;
99
#import "SEGCrypto.h"
1010

1111
@protocol SEGStorage <NSObject>

Segment/Classes/SEGTrackPayload.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGPayload.h"
33

44
NS_ASSUME_NONNULL_BEGIN

Segment/Classes/SEGWebhookIntegration.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import <Foundation/Foundation.h>
1+
@import Foundation;
22
#import "SEGWebhookIntegration.h"
33
#import "SEGHTTPClient.h"
44
#import "SEGState.h"

Segment/Classes/Segment.h

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

9-
#import <Foundation/Foundation.h>
9+
@import Foundation;
1010

1111
//! Project version number for Analytics.
1212
FOUNDATION_EXPORT double SegmentVersionNumber;

Segment/Internal/NSData+SEGGZIP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
//
3232

3333

34-
#import <Foundation/Foundation.h>
34+
@import Foundation;
3535

3636
extern void *_Nullable seg_libzOpen(void);
3737

Segment/Internal/NSViewController+SEGScreen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#import "SEGSerializableValue.h"
1010

1111
#if TARGET_OS_OSX
12-
#import <Cocoa/Cocoa.h>
12+
@import Cocoa;
1313

1414
@interface NSViewController (SEGScreen)
1515

Segment/Internal/NSViewController+SEGScreen.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#import "SEGAnalyticsUtils.h"
1313
#import "SEGScreenReporting.h"
1414

15-
1615
#if TARGET_OS_OSX
1716
@implementation NSViewController (SEGScreen)
1817

@@ -22,7 +21,7 @@ + (void)seg_swizzleViewDidAppear
2221
dispatch_once(&onceToken, ^{
2322
Class class = [self class];
2423

25-
SEL originalSelector = @selector(viewDidAppear:);
24+
SEL originalSelector = @selector(viewDidAppear);
2625
SEL swizzledSelector = @selector(seg_viewDidAppear:);
2726

2827
Method originalMethod = class_getInstanceMethod(class, originalSelector);

Segment/Internal/SEGAES256Crypto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Copyright © 2016 Segment. All rights reserved.
66
//
77

8-
#import <Foundation/Foundation.h>
8+
@import Foundation;
99
#import "SEGCrypto.h"
1010

1111

Segment/Internal/SEGFileStorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Copyright © 2016 Segment. All rights reserved.
66
//
77

8-
#import <Foundation/Foundation.h>
8+
@import Foundation;
99
#import "SEGStorage.h"
1010

1111

0 commit comments

Comments
 (0)