Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPM Support #2280

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions flutter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ build/

.vscode/launch.json
cocoa_bindings_temp

ios/sentry_flutter/Package.resolved

Empty file removed flutter/ios/Assets/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions flutter/ios/sentry_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Sentry SDK for Flutter with support to native through sentry-cocoa.
s.authors = "Sentry"
s.source = { :git => "https://github.com/getsentry/sentry-dart.git",
:tag => s.version.to_s }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.source_files = 'sentry_flutter/Sources/**/*'
s.public_header_files = 'sentry_flutter/Sources/**/*.h'
s.dependency 'Sentry/HybridSDK', '8.36.0'
s.ios.dependency 'Flutter'
s.osx.dependency 'FlutterMacOS'
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions flutter/ios/sentry_flutter/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "sentry_flutter",
platforms: [
.iOS("12.0"),
.macOS("10.13")
],
products: [
.library(name: "sentry-flutter", targets: ["sentry_flutter", "sentry_flutter_swift"])
],
dependencies: [
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.36.0")
],
targets: [
.target(
name: "sentry_flutter",
dependencies: [
"sentry_flutter_swift",
.product(name: "Sentry", package: "sentry-cocoa")
],
publicHeadersPath:"include"

Check failure on line 25 in flutter/ios/sentry_flutter/Package.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Colon Spacing Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals (colon)
),
// SPM does not support mixed-language, so we need to move the swift files into a separate target
.target(
name: "sentry_flutter_swift",
dependencies: [
.product(name: "Sentry", package: "sentry-cocoa")
],
publicHeadersPath:"include"

Check failure on line 33 in flutter/ios/sentry_flutter/Package.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Colon Spacing Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals (colon)
)
]
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "SentryFlutterPlugin.h"
#import "include/SentryFlutterPlugin.h"
#if __has_include(<sentry_flutter/sentry_flutter-Swift.h>)
#import <sentry_flutter/sentry_flutter-Swift.h>
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "SentryFlutterReplayBreadcrumbConverter.h"
#import "include/SentryFlutterReplayBreadcrumbConverter.h"

@import Sentry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {

#if canImport(UIKit) && !SENTRY_NO_UIKIT
#if os(iOS) || os(tvOS)
let breadcrumbConverter = SentryFlutterReplayBreadcrumbConverter()
let screenshotProvider = SentryFlutterReplayScreenshotProvider(channel: self.channel)
PrivateSentrySDKOnly.configureSessionReplay(with: breadcrumbConverter, screenshotProvider: screenshotProvider)
let breadcrumbConverter = SentryFlutterReplayBreadcrumbConverter()
let screenshotProvider = SentryFlutterReplayScreenshotProvider(channel: self.channel)
PrivateSentrySDKOnly.configureSessionReplay(with: breadcrumbConverter, screenshotProvider: screenshotProvider)
#endif
#endif

Expand Down
Binary file added flutter/macos/sentry_flutter/Package.swift
Binary file not shown.
Loading