Skip to content

Commit 70dbd47

Browse files
bsneedBrandon Sneed
and
Brandon Sneed
authored
Codify plugin versioning through the system (#121)
Co-authored-by: Brandon Sneed <[email protected]>
1 parent 9c7dff2 commit 70dbd47

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Sources/Segment/Plugins.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public protocol DestinationPlugin: EventPlugin {
5858

5959
public protocol UtilityPlugin: EventPlugin { }
6060

61+
public protocol VersionedPlugin {
62+
static func version() -> String
63+
}
64+
6165
// For internal platform-specific bits
6266
internal protocol PlatformPlugin: Plugin { }
6367

Sources/Segment/Plugins/SegmentDestination.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,11 @@ extension SegmentDestination {
211211
}
212212
}
213213
}
214+
215+
// MARK: Versioning
216+
217+
extension SegmentDestination: VersionedPlugin {
218+
public static func version() -> String {
219+
return __segment_version
220+
}
221+
}

0 commit comments

Comments
 (0)