Skip to content

Commit acc2ff0

Browse files
committed
move to swift as main spm package
1 parent 6034522 commit acc2ff0

File tree

5 files changed

+8
-45
lines changed

5 files changed

+8
-45
lines changed

flutter/ios/sentry_flutter/Package.swift

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let package = Package(
1010
.macOS("10.13")
1111
],
1212
products: [
13-
.library(name: "sentry-flutter", targets: ["sentry_flutter", "sentry_flutter_swift", "sentry_flutter_objc"])
13+
.library(name: "sentry-flutter", targets: ["sentry_flutter", "sentry_flutter_objc"])
1414
],
1515
dependencies: [
1616
// .package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.36.0")
@@ -19,21 +19,12 @@ let package = Package(
1919
.target(
2020
name: "sentry_flutter",
2121
dependencies: [
22-
"sentry_flutter_swift",
23-
// .target(name: "Sentry")
24-
// .product(name: "Sentry", package: "sentry-cocoa")
25-
],
26-
publicHeadersPath:"include"
27-
),
28-
// SPM does not support mixed-language, so we need to move the swift files into a separate target
29-
.target(
30-
name: "sentry_flutter_swift",
31-
dependencies: [
32-
.target(name: "sentry_flutter_objc"),
22+
"sentry_flutter_objc",
3323
.target(name: "Sentry")
3424
// .product(name: "Sentry", package: "sentry-cocoa")
3525
]
3626
),
27+
// SPM does not support mixed-language targets, so we need to move the ObjC files into a separate one
3728
.target(
3829
name: "sentry_flutter_objc",
3930
dependencies: [

flutter/ios/sentry_flutter/Sources/sentry_flutter/SentryFlutterPlugin.m

Lines changed: 0 additions & 20 deletions
This file was deleted.

flutter/ios/sentry_flutter/Sources/sentry_flutter_swift/SentryFlutterPluginApple.swift renamed to flutter/ios/sentry_flutter/Sources/sentry_flutter/SentryFlutterPlugin.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import CoreVideo
1717
// swiftlint:disable file_length function_body_length
1818

1919
// swiftlint:disable:next type_body_length
20-
public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
20+
public class SentryFlutterPlugin: NSObject, FlutterPlugin {
2121
private let channel: FlutterMethodChannel
2222

2323
private static let nativeClientName = "sentry.cocoa.flutter"
@@ -45,7 +45,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
4545
let channel = FlutterMethodChannel(name: "sentry_flutter", binaryMessenger: registrar.messenger)
4646
#endif
4747

48-
let instance = SentryFlutterPluginApple(channel: channel)
48+
let instance = SentryFlutterPlugin(channel: channel)
4949
instance.registerObserver()
5050
registrar.addMethodCallDelegate(instance, channel: channel)
5151
}
@@ -306,7 +306,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
306306
}
307307

308308
let version = PrivateSentrySDKOnly.getSdkVersionString()
309-
PrivateSentrySDKOnly.setSdkName(SentryFlutterPluginApple.nativeClientName, andVersionString: version)
309+
PrivateSentrySDKOnly.setSdkName(SentryFlutterPlugin.nativeClientName, andVersionString: version)
310310

311311
// note : for now, in sentry-cocoa, beforeSend is not called before captureEnvelope
312312
options.beforeSend = { event in
@@ -368,7 +368,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
368368
if isValidSdk(sdk: sdk) {
369369

370370
switch sdk["name"] as? String {
371-
case SentryFlutterPluginApple.nativeClientName:
371+
case SentryFlutterPlugin.nativeClientName:
372372
#if os(OSX)
373373
let origin = "mac"
374374
#elseif os(watchOS)
@@ -483,7 +483,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
483483
let isColdStart = appStartMeasurement.type == .cold
484484

485485
let item: [String: Any] = [
486-
"pluginRegistrationTime": SentryFlutterPluginApple.pluginRegistrationTime,
486+
"pluginRegistrationTime": SentryFlutterPlugin.pluginRegistrationTime,
487487
"appStartTime": appStartTime,
488488
"isColdStart": isColdStart,
489489
"nativeSpanTimes": nativeSpanTimes

flutter/ios/sentry_flutter/Sources/sentry_flutter/include/SentryFlutterPlugin.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)