Skip to content

Commit

Permalink
package renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed May 6, 2024
1 parent 217a747 commit a2ebf84
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 38 deletions.
14 changes: 11 additions & 3 deletions Apps/APN-UIKit/APN UIKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
30678B7D2BE9647E000C3E2D /* Segment in Frameworks */ = {isa = PBXBuildFile; productRef = 30678B7C2BE9647E000C3E2D /* Segment */; };
4650330229F68FEB001B6552 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4650330129F68FEB001B6552 /* NotificationService.swift */; };
4650330629F68FEB001B6552 /* NotificationServiceExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 465032FF29F68FEB001B6552 /* NotificationServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
4650330D29F69374001B6552 /* MessagingPushAPN in Frameworks */ = {isa = PBXBuildFile; productRef = 4650330C29F69374001B6552 /* MessagingPushAPN */; };
Expand Down Expand Up @@ -161,6 +162,7 @@
buildActionMask = 2147483647;
files = (
F7D35F0A2BC9869900D25BC2 /* MessagingPushFCM in Frameworks */,
30678B7D2BE9647E000C3E2D /* Segment in Frameworks */,
A776886E2B9875D0004F2A49 /* DataPipelines in Frameworks */,
46EE275529E9E2960068F9A3 /* MessagingInApp in Frameworks */,
46EE275729E9E2960068F9A3 /* MessagingPushAPN in Frameworks */,
Expand Down Expand Up @@ -402,6 +404,7 @@
46EE275629E9E2960068F9A3 /* MessagingPushAPN */,
A776886D2B9875D0004F2A49 /* DataPipelines */,
F7D35F092BC9869900D25BC2 /* MessagingPushFCM */,
30678B7C2BE9647E000C3E2D /* Segment */,
);
productName = "APN UIKit";
productReference = 46D5D97D29E459D600EAF40B /* APN UIKit.app */;
Expand Down Expand Up @@ -479,7 +482,7 @@
);
mainGroup = 46D5D97429E459D600EAF40B;
packageReferences = (
301A7CF52BB80A1E007AF8A5 /* XCRemoteSwiftPackageReference "analytics-swift" */,
30678B7B2BE9647E000C3E2D /* XCRemoteSwiftPackageReference "analytics-swift" */,
);
productRefGroup = 46D5D97E29E459D600EAF40B /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -1001,17 +1004,22 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
301A7CF52BB80A1E007AF8A5 /* XCRemoteSwiftPackageReference "analytics-swift" */ = {
30678B7B2BE9647E000C3E2D /* XCRemoteSwiftPackageReference "analytics-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/segmentio/analytics-swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.5.9;
minimumVersion = 1.5.11;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
30678B7C2BE9647E000C3E2D /* Segment */ = {
isa = XCSwiftPackageProductDependency;
package = 30678B7B2BE9647E000C3E2D /* XCRemoteSwiftPackageReference "analytics-swift" */;
productName = Segment;
};
4650330C29F69374001B6552 /* MessagingPushAPN */ = {
isa = XCSwiftPackageProductDependency;
productName = MessagingPushAPN;
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let package = Package(
.package(name: "Firebase", url: "https://github.com/firebase/firebase-ios-sdk.git", "8.7.0"..<"11.0.0"),

// Make sure the version number is same for DataPipelines cocoapods.
.package(name: "CDPAnalyticsSwift", url: "https://github.com/customerio/cdp-analytics-swift.git", .branch("shahroz/different-target"))
.package(name: "CioAnalytics", url: "https://github.com/customerio/cdp-analytics-swift.git", .branch("shahroz/different-target"))
],
targets: [
// Common - Code used by multiple modules in the SDK project.
Expand Down Expand Up @@ -82,7 +82,7 @@ let package = Package(
// Data Pipeline
.target(name: "CioDataPipelines",
dependencies: ["CioInternalCommon", "CioTrackingMigration",
.product(name: "CDPAnalyticsSwift", package: "CDPAnalyticsSwift")],
.product(name: "CioAnalytics", package: "CioAnalytics")],
path: "Sources/DataPipeline", resources: [
.process("Resources/PrivacyInfo.xcprivacy"),
]),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon
import Foundation

Expand Down
2 changes: 1 addition & 1 deletion Sources/DataPipeline/Config/SDKConfigBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon
import Foundation
#if canImport(UIKit)
Expand Down
2 changes: 1 addition & 1 deletion Sources/DataPipeline/CustomerIO+Plugins.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon
import Foundation

Expand Down
2 changes: 1 addition & 1 deletion Sources/DataPipeline/CustomerIO+Segment.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon
import Foundation

Expand Down
4 changes: 2 additions & 2 deletions Sources/DataPipeline/DataPipeline.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon
import CioTrackingMigration

Expand All @@ -11,7 +11,7 @@ public class DataPipeline: ModuleTopLevelObject<DataPipelineInstance>, DataPipel
ModuleTopLevelObject is intentionally designed to allow null implementations, matching our requirements overall. Customer who have correctly initialized the SDK will consistently find the implementation set correctly and operational. However, customers who attempt to use functions dependent on this implementation without initializing the SDK may not see the desired results, which is an expected behavior. To align our SDK with Segment API practices (e.g., add(Plugin)), which require returning non-null objects, we face a challenge when the SDK is not initialized.
To avoid force unwrapping and to maintain consistency with Segment APIs, we’ve introduced a ‘dead instance’ to handle these edge cases. This implementation acts as a safeguard, capturing calls made without SDK initialization and logging a warning, yet it does not perform any operations for these calls. This approach ensures stability and consistency in the API’s behavior.
*/
public var analytics: CDPAnalyticsSwift.Analytics {
public var analytics: CioAnalytics.Analytics {
implementation?.analytics ?? Analytics(configuration: Configuration(writeKey: "DEADINSTANCE"))
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/DataPipeline/DataPipelineImplementation.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon

class DataPipelineImplementation: DataPipelineInstance {
Expand Down
4 changes: 2 additions & 2 deletions Sources/DataPipeline/Plugins/AutoTrackingScreenViews.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon
import Foundation
#if canImport(UIKit)
Expand All @@ -11,7 +11,7 @@ import UIKit
public class AutoTrackingScreenViews: UtilityPlugin {
public let type = PluginType.utility

public var analytics: CDPAnalyticsSwift.Analytics?
public var analytics: CioAnalytics.Analytics?
public var diGraph: DIGraphShared {
DIGraphShared.shared
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/DataPipeline/Plugins/Context.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon

/// Plugin class that update the context properties in the request payload
Expand Down
2 changes: 1 addition & 1 deletion Sources/DataPipeline/Plugins/CustomerIODestination.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics

// inherits from SegmentDestination and is used to send events to Customer.io servers
public class CustomerIODestination: SegmentDestination {}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon
import Foundation

/// This class serves as a centralized hub for dispatching events generated from DataPipeline module.
/// It is designed to reduce redundancy and enhance maintainability by funneling these operations through a single plugin.
/// This plugin allows for decoupled modules to subscribe and react to these events.
class DataPipelinePublishedEvents: EventPlugin {
var type: CDPAnalyticsSwift.PluginType = .before
var type: CioAnalytics.PluginType = .before

var analytics: CDPAnalyticsSwift.Analytics?
var analytics: CioAnalytics.Analytics?
var eventBusHandler: EventBusHandler

public required init(diGraph: DIGraphShared) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import Foundation

// This plugin is used to add contextual data to the device attributes
Expand Down
2 changes: 1 addition & 1 deletion Sources/DataPipeline/Plugins/Logger.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon

/// Logger plugin for logging all requests sent to analytics
Expand Down
34 changes: 17 additions & 17 deletions Sources/DataPipeline/Type/Aliases.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CDPAnalyticsSwift
import CioAnalytics
import CioInternalCommon
import Foundation

Expand All @@ -8,25 +8,25 @@ import Foundation
the 'Segment' module in their code.
*/

public typealias Plugin = CDPAnalyticsSwift.Plugin
public typealias PluginType = CDPAnalyticsSwift.PluginType
public typealias EventPlugin = CDPAnalyticsSwift.EventPlugin
public typealias DestinationPlugin = CDPAnalyticsSwift.DestinationPlugin
public typealias UtilityPlugin = CDPAnalyticsSwift.UtilityPlugin
public typealias VersionedPlugin = CDPAnalyticsSwift.VersionedPlugin
public typealias Plugin = CioAnalytics.Plugin
public typealias PluginType = CioAnalytics.PluginType
public typealias EventPlugin = CioAnalytics.EventPlugin
public typealias DestinationPlugin = CioAnalytics.DestinationPlugin
public typealias UtilityPlugin = CioAnalytics.UtilityPlugin
public typealias VersionedPlugin = CioAnalytics.VersionedPlugin

public typealias Analytics = CDPAnalyticsSwift.Analytics
public typealias Analytics = CioAnalytics.Analytics

public typealias RawEvent = CDPAnalyticsSwift.RawEvent
public typealias TrackEvent = CDPAnalyticsSwift.TrackEvent
public typealias ScreenEvent = CDPAnalyticsSwift.ScreenEvent
public typealias AliasEvent = CDPAnalyticsSwift.AliasEvent
public typealias GroupEvent = CDPAnalyticsSwift.GroupEvent
public typealias IdentifyEvent = CDPAnalyticsSwift.IdentifyEvent
public typealias RawEvent = CioAnalytics.RawEvent
public typealias TrackEvent = CioAnalytics.TrackEvent
public typealias ScreenEvent = CioAnalytics.ScreenEvent
public typealias AliasEvent = CioAnalytics.AliasEvent
public typealias GroupEvent = CioAnalytics.GroupEvent
public typealias IdentifyEvent = CioAnalytics.IdentifyEvent

public typealias Settings = CDPAnalyticsSwift.Settings
public typealias FlushPolicy = CDPAnalyticsSwift.FlushPolicy
public typealias OperatingMode = CDPAnalyticsSwift.OperatingMode
public typealias Settings = CioAnalytics.Settings
public typealias FlushPolicy = CioAnalytics.FlushPolicy
public typealias OperatingMode = CioAnalytics.OperatingMode

public typealias Metric = CioInternalCommon.Metric
public typealias CustomerIO = CioInternalCommon.CustomerIO
Expand Down

0 comments on commit a2ebf84

Please sign in to comment.