diff --git a/.gitignore b/.gitignore index e7f55eeae..d56c3b6e8 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,10 @@ DerivedData # Bundler .bundle +# Swift Package Manager +.build +.swiftpm + Carthage # CocoaPods typically recommends against ignoring the Pods directory diff --git a/Analytics.podspec b/Analytics.podspec index 7f69c309f..b074793d7 100644 --- a/Analytics.podspec +++ b/Analytics.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Analytics" - s.version = "4.0.0-beta.1" + s.version = "4.0.0-beta.2" s.summary = "The hassle-free way to add analytics to your iOS app." s.description = <<-DESC @@ -22,6 +22,6 @@ Pod::Spec.new do |s| s.source_files = [ 'Analytics/Classes/**/*', - 'Analytics/Vendor/**/*' + 'Analytics/Internal/**/*' ] end diff --git a/Analytics.xcodeproj/project.pbxproj b/Analytics.xcodeproj/project.pbxproj index ac1878bd9..25d2e5ff0 100644 --- a/Analytics.xcodeproj/project.pbxproj +++ b/Analytics.xcodeproj/project.pbxproj @@ -256,16 +256,6 @@ name = Frameworks; sourceTree = ""; }; - EAA5427A1EB42B8C00945DA7 /* Vendor */ = { - isa = PBXGroup; - children = ( - EAA5427B1EB42B8C00945DA7 /* SEGReachability.h */, - EAA5427C1EB42B8C00945DA7 /* SEGReachability.m */, - ); - name = Vendor; - path = Analytics/Vendor; - sourceTree = SOURCE_ROOT; - }; EADEB8511DECD080005322DA = { isa = PBXGroup; children = ( @@ -292,8 +282,8 @@ isa = PBXGroup; children = ( EADEB8751DECD12B005322DA /* Classes */, - EADEB85E1DECD080005322DA /* Analytics.h */, EADEB85F1DECD080005322DA /* Info.plist */, + EADEB88C1DECD12B005322DA /* Internal */, ); path = Analytics; sourceTree = ""; @@ -329,51 +319,43 @@ EADEB8751DECD12B005322DA /* Classes */ = { isa = PBXGroup; children = ( - EAA5427A1EB42B8C00945DA7 /* Vendor */, - EADEB8771DECD12B005322DA /* Crypto */, - EADEB87B1DECD12B005322DA /* Integrations */, - EADEB88C1DECD12B005322DA /* Internal */, - EADEB8A41DECD12B005322DA /* Middlewares */, - EA88A5971DED7608009FB66A /* SEGSerializableValue.h */, + EADEB85E1DECD080005322DA /* Analytics.h */, + EADEB87C1DECD12B005322DA /* SEGAliasPayload.h */, + EADEB87D1DECD12B005322DA /* SEGAliasPayload.m */, EADEB8A91DECD12B005322DA /* SEGAnalytics.h */, EADEB8AA1DECD12B005322DA /* SEGAnalytics.m */, EADEB8AB1DECD12B005322DA /* SEGAnalyticsConfiguration.h */, EADEB8AC1DECD12B005322DA /* SEGAnalyticsConfiguration.m */, - ); - path = Classes; - sourceTree = ""; - }; - EADEB8771DECD12B005322DA /* Crypto */ = { - isa = PBXGroup; - children = ( - EADEB8781DECD12B005322DA /* SEGAES256Crypto.h */, - EADEB8791DECD12B005322DA /* SEGAES256Crypto.m */, + EADEB8A51DECD12B005322DA /* SEGContext.h */, + EADEB8A61DECD12B005322DA /* SEGContext.m */, EADEB87A1DECD12B005322DA /* SEGCrypto.h */, - ); - path = Crypto; - sourceTree = ""; - }; - EADEB87B1DECD12B005322DA /* Integrations */ = { - isa = PBXGroup; - children = ( - EADEB87C1DECD12B005322DA /* SEGAliasPayload.h */, - EADEB87D1DECD12B005322DA /* SEGAliasPayload.m */, EADEB87E1DECD12B005322DA /* SEGGroupPayload.h */, EADEB87F1DECD12B005322DA /* SEGGroupPayload.m */, + EADEB8931DECD12B005322DA /* SEGHTTPClient.h */, + EADEB8941DECD12B005322DA /* SEGHTTPClient.m */, EADEB8801DECD12B005322DA /* SEGIdentifyPayload.h */, EADEB8811DECD12B005322DA /* SEGIdentifyPayload.m */, EADEB8821DECD12B005322DA /* SEGIntegration.h */, EADEB8831DECD12B005322DA /* SEGIntegrationFactory.h */, - EADEB8841DECD12B005322DA /* SEGIntegrationsManager.h */, - EADEB8851DECD12B005322DA /* SEGIntegrationsManager.m */, + EADEB8A71DECD12B005322DA /* SEGMiddleware.h */, + EADEB8A81DECD12B005322DA /* SEGMiddleware.m */, EADEB8861DECD12B005322DA /* SEGPayload.h */, EADEB8871DECD12B005322DA /* SEGPayload.m */, + EAA5427B1EB42B8C00945DA7 /* SEGReachability.h */, + EAA5427C1EB42B8C00945DA7 /* SEGReachability.m */, EADEB8881DECD12B005322DA /* SEGScreenPayload.h */, EADEB8891DECD12B005322DA /* SEGScreenPayload.m */, + 5AF0EDFEDC0EE79A0A0EB713 /* SEGScreenReporting.h */, + EADEB8971DECD12B005322DA /* SEGSegmentIntegration.h */, + EADEB8981DECD12B005322DA /* SEGSegmentIntegration.m */, + EADEB8991DECD12B005322DA /* SEGSegmentIntegrationFactory.h */, + EADEB89A1DECD12B005322DA /* SEGSegmentIntegrationFactory.m */, + EA88A5971DED7608009FB66A /* SEGSerializableValue.h */, + EADEB89B1DECD12B005322DA /* SEGStorage.h */, EADEB88A1DECD12B005322DA /* SEGTrackPayload.h */, EADEB88B1DECD12B005322DA /* SEGTrackPayload.m */, ); - path = Integrations; + path = Classes; sourceTree = ""; }; EADEB88C1DECD12B005322DA /* Internal */ = { @@ -381,42 +363,27 @@ children = ( EADEB88D1DECD12B005322DA /* NSData+SEGGZIP.h */, EADEB88E1DECD12B005322DA /* NSData+SEGGZIP.m */, + EADEB8781DECD12B005322DA /* SEGAES256Crypto.h */, + EADEB8791DECD12B005322DA /* SEGAES256Crypto.m */, EADEB88F1DECD12B005322DA /* SEGAnalyticsUtils.h */, EADEB8901DECD12B005322DA /* SEGAnalyticsUtils.m */, EADEB8911DECD12B005322DA /* SEGFileStorage.h */, EADEB8921DECD12B005322DA /* SEGFileStorage.m */, - EADEB8931DECD12B005322DA /* SEGHTTPClient.h */, - EADEB8941DECD12B005322DA /* SEGHTTPClient.m */, - EADEB8971DECD12B005322DA /* SEGSegmentIntegration.h */, - EADEB8981DECD12B005322DA /* SEGSegmentIntegration.m */, - EADEB8991DECD12B005322DA /* SEGSegmentIntegrationFactory.h */, - EADEB89A1DECD12B005322DA /* SEGSegmentIntegrationFactory.m */, - EADEB89B1DECD12B005322DA /* SEGStorage.h */, + EADEB8841DECD12B005322DA /* SEGIntegrationsManager.h */, + EADEB8851DECD12B005322DA /* SEGIntegrationsManager.m */, + A352175F23AD5825005B07F6 /* SEGMacros.h */, EADEB89C1DECD12B005322DA /* SEGStoreKitTracker.h */, EADEB89D1DECD12B005322DA /* SEGStoreKitTracker.m */, EADEB89E1DECD12B005322DA /* SEGUserDefaultsStorage.h */, EADEB89F1DECD12B005322DA /* SEGUserDefaultsStorage.m */, EADEB8A01DECD12B005322DA /* SEGUtils.h */, EADEB8A11DECD12B005322DA /* SEGUtils.m */, - A352175F23AD5825005B07F6 /* SEGMacros.h */, EADEB8A21DECD12B005322DA /* UIViewController+SEGScreen.h */, EADEB8A31DECD12B005322DA /* UIViewController+SEGScreen.m */, - 5AF0EDFEDC0EE79A0A0EB713 /* SEGScreenReporting.h */, ); path = Internal; sourceTree = ""; }; - EADEB8A41DECD12B005322DA /* Middlewares */ = { - isa = PBXGroup; - children = ( - EADEB8A51DECD12B005322DA /* SEGContext.h */, - EADEB8A61DECD12B005322DA /* SEGContext.m */, - EADEB8A71DECD12B005322DA /* SEGMiddleware.h */, - EADEB8A81DECD12B005322DA /* SEGMiddleware.m */, - ); - path = Middlewares; - sourceTree = ""; - }; EADEB8E11DECD335005322DA /* Utils */ = { isa = PBXGroup; children = ( diff --git a/Analytics/Classes/.gitkeep b/Analytics/Classes/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/Analytics/Analytics.h b/Analytics/Classes/Analytics.h similarity index 100% rename from Analytics/Analytics.h rename to Analytics/Classes/Analytics.h diff --git a/Analytics/Classes/Integrations/SEGAliasPayload.h b/Analytics/Classes/SEGAliasPayload.h similarity index 100% rename from Analytics/Classes/Integrations/SEGAliasPayload.h rename to Analytics/Classes/SEGAliasPayload.h diff --git a/Analytics/Classes/Integrations/SEGAliasPayload.m b/Analytics/Classes/SEGAliasPayload.m similarity index 100% rename from Analytics/Classes/Integrations/SEGAliasPayload.m rename to Analytics/Classes/SEGAliasPayload.m diff --git a/Analytics/Classes/SEGAnalytics.m b/Analytics/Classes/SEGAnalytics.m index e6221b21f..1a955c02a 100644 --- a/Analytics/Classes/SEGAnalytics.m +++ b/Analytics/Classes/SEGAnalytics.m @@ -14,7 +14,7 @@ #import "SEGMiddleware.h" #import "SEGContext.h" #import "SEGIntegrationsManager.h" -#import "Internal/SEGUtils.h" +#import "SEGUtils.h" static SEGAnalytics *__sharedInstance = nil; diff --git a/Analytics/Classes/Middlewares/SEGContext.h b/Analytics/Classes/SEGContext.h similarity index 100% rename from Analytics/Classes/Middlewares/SEGContext.h rename to Analytics/Classes/SEGContext.h diff --git a/Analytics/Classes/Middlewares/SEGContext.m b/Analytics/Classes/SEGContext.m similarity index 100% rename from Analytics/Classes/Middlewares/SEGContext.m rename to Analytics/Classes/SEGContext.m diff --git a/Analytics/Classes/Crypto/SEGCrypto.h b/Analytics/Classes/SEGCrypto.h similarity index 100% rename from Analytics/Classes/Crypto/SEGCrypto.h rename to Analytics/Classes/SEGCrypto.h diff --git a/Analytics/Classes/Integrations/SEGGroupPayload.h b/Analytics/Classes/SEGGroupPayload.h similarity index 100% rename from Analytics/Classes/Integrations/SEGGroupPayload.h rename to Analytics/Classes/SEGGroupPayload.h diff --git a/Analytics/Classes/Integrations/SEGGroupPayload.m b/Analytics/Classes/SEGGroupPayload.m similarity index 100% rename from Analytics/Classes/Integrations/SEGGroupPayload.m rename to Analytics/Classes/SEGGroupPayload.m diff --git a/Analytics/Classes/Internal/SEGHTTPClient.h b/Analytics/Classes/SEGHTTPClient.h similarity index 100% rename from Analytics/Classes/Internal/SEGHTTPClient.h rename to Analytics/Classes/SEGHTTPClient.h diff --git a/Analytics/Classes/Internal/SEGHTTPClient.m b/Analytics/Classes/SEGHTTPClient.m similarity index 100% rename from Analytics/Classes/Internal/SEGHTTPClient.m rename to Analytics/Classes/SEGHTTPClient.m diff --git a/Analytics/Classes/Integrations/SEGIdentifyPayload.h b/Analytics/Classes/SEGIdentifyPayload.h similarity index 100% rename from Analytics/Classes/Integrations/SEGIdentifyPayload.h rename to Analytics/Classes/SEGIdentifyPayload.h diff --git a/Analytics/Classes/Integrations/SEGIdentifyPayload.m b/Analytics/Classes/SEGIdentifyPayload.m similarity index 100% rename from Analytics/Classes/Integrations/SEGIdentifyPayload.m rename to Analytics/Classes/SEGIdentifyPayload.m diff --git a/Analytics/Classes/Integrations/SEGIntegration.h b/Analytics/Classes/SEGIntegration.h similarity index 100% rename from Analytics/Classes/Integrations/SEGIntegration.h rename to Analytics/Classes/SEGIntegration.h diff --git a/Analytics/Classes/Integrations/SEGIntegrationFactory.h b/Analytics/Classes/SEGIntegrationFactory.h similarity index 100% rename from Analytics/Classes/Integrations/SEGIntegrationFactory.h rename to Analytics/Classes/SEGIntegrationFactory.h diff --git a/Analytics/Classes/Middlewares/SEGMiddleware.h b/Analytics/Classes/SEGMiddleware.h similarity index 100% rename from Analytics/Classes/Middlewares/SEGMiddleware.h rename to Analytics/Classes/SEGMiddleware.h diff --git a/Analytics/Classes/Middlewares/SEGMiddleware.m b/Analytics/Classes/SEGMiddleware.m similarity index 100% rename from Analytics/Classes/Middlewares/SEGMiddleware.m rename to Analytics/Classes/SEGMiddleware.m diff --git a/Analytics/Classes/Integrations/SEGPayload.h b/Analytics/Classes/SEGPayload.h similarity index 100% rename from Analytics/Classes/Integrations/SEGPayload.h rename to Analytics/Classes/SEGPayload.h diff --git a/Analytics/Classes/Integrations/SEGPayload.m b/Analytics/Classes/SEGPayload.m similarity index 100% rename from Analytics/Classes/Integrations/SEGPayload.m rename to Analytics/Classes/SEGPayload.m diff --git a/Analytics/Vendor/SEGReachability.h b/Analytics/Classes/SEGReachability.h similarity index 100% rename from Analytics/Vendor/SEGReachability.h rename to Analytics/Classes/SEGReachability.h diff --git a/Analytics/Vendor/SEGReachability.m b/Analytics/Classes/SEGReachability.m similarity index 100% rename from Analytics/Vendor/SEGReachability.m rename to Analytics/Classes/SEGReachability.m diff --git a/Analytics/Classes/Integrations/SEGScreenPayload.h b/Analytics/Classes/SEGScreenPayload.h similarity index 100% rename from Analytics/Classes/Integrations/SEGScreenPayload.h rename to Analytics/Classes/SEGScreenPayload.h diff --git a/Analytics/Classes/Integrations/SEGScreenPayload.m b/Analytics/Classes/SEGScreenPayload.m similarity index 100% rename from Analytics/Classes/Integrations/SEGScreenPayload.m rename to Analytics/Classes/SEGScreenPayload.m diff --git a/Analytics/Classes/Internal/SEGScreenReporting.h b/Analytics/Classes/SEGScreenReporting.h similarity index 100% rename from Analytics/Classes/Internal/SEGScreenReporting.h rename to Analytics/Classes/SEGScreenReporting.h diff --git a/Analytics/Classes/Internal/SEGSegmentIntegration.h b/Analytics/Classes/SEGSegmentIntegration.h similarity index 100% rename from Analytics/Classes/Internal/SEGSegmentIntegration.h rename to Analytics/Classes/SEGSegmentIntegration.h diff --git a/Analytics/Classes/Internal/SEGSegmentIntegration.m b/Analytics/Classes/SEGSegmentIntegration.m similarity index 100% rename from Analytics/Classes/Internal/SEGSegmentIntegration.m rename to Analytics/Classes/SEGSegmentIntegration.m diff --git a/Analytics/Classes/Internal/SEGSegmentIntegrationFactory.h b/Analytics/Classes/SEGSegmentIntegrationFactory.h similarity index 100% rename from Analytics/Classes/Internal/SEGSegmentIntegrationFactory.h rename to Analytics/Classes/SEGSegmentIntegrationFactory.h diff --git a/Analytics/Classes/Internal/SEGSegmentIntegrationFactory.m b/Analytics/Classes/SEGSegmentIntegrationFactory.m similarity index 100% rename from Analytics/Classes/Internal/SEGSegmentIntegrationFactory.m rename to Analytics/Classes/SEGSegmentIntegrationFactory.m diff --git a/Analytics/Classes/Internal/SEGStorage.h b/Analytics/Classes/SEGStorage.h similarity index 100% rename from Analytics/Classes/Internal/SEGStorage.h rename to Analytics/Classes/SEGStorage.h diff --git a/Analytics/Classes/Integrations/SEGTrackPayload.h b/Analytics/Classes/SEGTrackPayload.h similarity index 100% rename from Analytics/Classes/Integrations/SEGTrackPayload.h rename to Analytics/Classes/SEGTrackPayload.h diff --git a/Analytics/Classes/Integrations/SEGTrackPayload.m b/Analytics/Classes/SEGTrackPayload.m similarity index 100% rename from Analytics/Classes/Integrations/SEGTrackPayload.m rename to Analytics/Classes/SEGTrackPayload.m diff --git a/Analytics/Classes/Internal/NSData+SEGGZIP.h b/Analytics/Internal/NSData+SEGGZIP.h similarity index 100% rename from Analytics/Classes/Internal/NSData+SEGGZIP.h rename to Analytics/Internal/NSData+SEGGZIP.h diff --git a/Analytics/Classes/Internal/NSData+SEGGZIP.m b/Analytics/Internal/NSData+SEGGZIP.m similarity index 100% rename from Analytics/Classes/Internal/NSData+SEGGZIP.m rename to Analytics/Internal/NSData+SEGGZIP.m diff --git a/Analytics/Classes/Crypto/SEGAES256Crypto.h b/Analytics/Internal/SEGAES256Crypto.h similarity index 100% rename from Analytics/Classes/Crypto/SEGAES256Crypto.h rename to Analytics/Internal/SEGAES256Crypto.h diff --git a/Analytics/Classes/Crypto/SEGAES256Crypto.m b/Analytics/Internal/SEGAES256Crypto.m similarity index 100% rename from Analytics/Classes/Crypto/SEGAES256Crypto.m rename to Analytics/Internal/SEGAES256Crypto.m diff --git a/Analytics/Classes/Internal/SEGAnalyticsUtils.h b/Analytics/Internal/SEGAnalyticsUtils.h similarity index 97% rename from Analytics/Classes/Internal/SEGAnalyticsUtils.h rename to Analytics/Internal/SEGAnalyticsUtils.h index 98dca482e..ec7610211 100644 --- a/Analytics/Classes/Internal/SEGAnalyticsUtils.h +++ b/Analytics/Internal/SEGAnalyticsUtils.h @@ -1,5 +1,5 @@ #import -#import +#import "SEGSerializableValue.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Analytics/Classes/Internal/SEGAnalyticsUtils.m b/Analytics/Internal/SEGAnalyticsUtils.m similarity index 100% rename from Analytics/Classes/Internal/SEGAnalyticsUtils.m rename to Analytics/Internal/SEGAnalyticsUtils.m diff --git a/Analytics/Classes/Internal/SEGFileStorage.h b/Analytics/Internal/SEGFileStorage.h similarity index 100% rename from Analytics/Classes/Internal/SEGFileStorage.h rename to Analytics/Internal/SEGFileStorage.h diff --git a/Analytics/Classes/Internal/SEGFileStorage.m b/Analytics/Internal/SEGFileStorage.m similarity index 100% rename from Analytics/Classes/Internal/SEGFileStorage.m rename to Analytics/Internal/SEGFileStorage.m diff --git a/Analytics/Classes/Integrations/SEGIntegrationsManager.h b/Analytics/Internal/SEGIntegrationsManager.h similarity index 100% rename from Analytics/Classes/Integrations/SEGIntegrationsManager.h rename to Analytics/Internal/SEGIntegrationsManager.h diff --git a/Analytics/Classes/Integrations/SEGIntegrationsManager.m b/Analytics/Internal/SEGIntegrationsManager.m similarity index 100% rename from Analytics/Classes/Integrations/SEGIntegrationsManager.m rename to Analytics/Internal/SEGIntegrationsManager.m diff --git a/Analytics/Classes/Internal/SEGMacros.h b/Analytics/Internal/SEGMacros.h similarity index 100% rename from Analytics/Classes/Internal/SEGMacros.h rename to Analytics/Internal/SEGMacros.h diff --git a/Analytics/Classes/Internal/SEGStoreKitTracker.h b/Analytics/Internal/SEGStoreKitTracker.h similarity index 100% rename from Analytics/Classes/Internal/SEGStoreKitTracker.h rename to Analytics/Internal/SEGStoreKitTracker.h diff --git a/Analytics/Classes/Internal/SEGStoreKitTracker.m b/Analytics/Internal/SEGStoreKitTracker.m similarity index 100% rename from Analytics/Classes/Internal/SEGStoreKitTracker.m rename to Analytics/Internal/SEGStoreKitTracker.m diff --git a/Analytics/Classes/Internal/SEGUserDefaultsStorage.h b/Analytics/Internal/SEGUserDefaultsStorage.h similarity index 100% rename from Analytics/Classes/Internal/SEGUserDefaultsStorage.h rename to Analytics/Internal/SEGUserDefaultsStorage.h diff --git a/Analytics/Classes/Internal/SEGUserDefaultsStorage.m b/Analytics/Internal/SEGUserDefaultsStorage.m similarity index 100% rename from Analytics/Classes/Internal/SEGUserDefaultsStorage.m rename to Analytics/Internal/SEGUserDefaultsStorage.m diff --git a/Analytics/Classes/Internal/SEGUtils.h b/Analytics/Internal/SEGUtils.h similarity index 100% rename from Analytics/Classes/Internal/SEGUtils.h rename to Analytics/Internal/SEGUtils.h diff --git a/Analytics/Classes/Internal/SEGUtils.m b/Analytics/Internal/SEGUtils.m similarity index 100% rename from Analytics/Classes/Internal/SEGUtils.m rename to Analytics/Internal/SEGUtils.m diff --git a/Analytics/Classes/Internal/UIViewController+SEGScreen.h b/Analytics/Internal/UIViewController+SEGScreen.h similarity index 100% rename from Analytics/Classes/Internal/UIViewController+SEGScreen.h rename to Analytics/Internal/UIViewController+SEGScreen.h diff --git a/Analytics/Classes/Internal/UIViewController+SEGScreen.m b/Analytics/Internal/UIViewController+SEGScreen.m similarity index 100% rename from Analytics/Classes/Internal/UIViewController+SEGScreen.m rename to Analytics/Internal/UIViewController+SEGScreen.m diff --git a/Package.swift b/Package.swift new file mode 100644 index 000000000..289c556a9 --- /dev/null +++ b/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.2 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "Analytics", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "Analytics", + type: .dynamic, + targets: ["Analytics"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "Analytics", + dependencies: [], + path: "Analytics/", + exclude: ["SwiftSources"], + sources: ["Classes", "Internal"], + publicHeadersPath: "Classes", + cSettings: [ + .headerSearchPath("Internal"), + .headerSearchPath("Classes"), + ]), + ] +)