From 88263b0c2691d4430a203268ba552caafc001844 Mon Sep 17 00:00:00 2001 From: Marcio Costa Silva Date: Fri, 10 Sep 2021 18:15:28 +0700 Subject: [PATCH] Add SPM Support --- Package.swift | 26 ++++++++++++++++++++++++++ Pod/Classes/SEGAmplitudeIntegration.h | 4 +++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Package.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..23ae21b --- /dev/null +++ b/Package.swift @@ -0,0 +1,26 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. +import PackageDescription + +let package = Package( + name: "Segment_Amplitude", + platforms: [ + .iOS(.v10), + .tvOS(.v9), + .macOS(.v10_10) + ], + products: [ + .library(name: "Segment_Amplitude", targets: ["Segment_Amplitude"]), + ], + dependencies: [ + .package(name: "Amplitude", url: "https://github.com/amplitude/Amplitude-iOS", .upToNextMinor(from: "8.3.1")), + .package(name: "Segment", url: "https://github.com/segmentio/analytics-ios", .upToNextMinor(from: "4.1.4")) + ], + targets: [ + .target( + name: "Segment_Amplitude", + dependencies: ["Amplitude", "Segment"], + path: "Pod", + publicHeadersPath: "Classes"), + ] +) diff --git a/Pod/Classes/SEGAmplitudeIntegration.h b/Pod/Classes/SEGAmplitudeIntegration.h index 15df4e1..2ebebf9 100644 --- a/Pod/Classes/SEGAmplitudeIntegration.h +++ b/Pod/Classes/SEGAmplitudeIntegration.h @@ -14,8 +14,10 @@ #import #elif defined(__has_include) && __has_include() #import -#else +#elif defined(__has_include) && __has_include() #import +#else +#import "Amplitude.h" #endif typedef void(^SEGAmplitudeSetupBlock)(Amplitude *amplitude);