Skip to content
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/check-package-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# We want to ensure that the Package.swift and Package@swift-5.9.swift are in sync.

name: Check Package.swift Diff

on:
push:
branches:
- main

pull_request:
paths:
- ".github/workflows/check-package-diff.yml"
- "Package*.swift"
- "Makefile"
- "Utils/expected_package_diff.patch"

jobs:
check:
name: Check Package.swift Diff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Package.swift Diff
run: make check-package-diff
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@ Sentry-Dynamic-WithARM64e.xcframework*
SentrySwiftUI.xcframework*
Sentry-WithoutUIKitOrAppKit.xcframework*
Sentry-WithoutUIKitOrAppKit-WithARM64e.xcframework*

current_package_diff.patch
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,18 @@ xcode-ci:
xcodegen --spec Samples/watchOS-Swift/watchOS-Swift.yml
xcodegen --spec TestSamples/SwiftUITestSample/SwiftUITestSample.yml
xcodegen --spec TestSamples/SwiftUICrashTest/SwiftUICrashTest.yml

.PHONY: check-package-diff update-package-diff
# Diff will return an error if the files are different, so we need to ignore it with `|| true`.
check-package-diff:
diff Package.swift Package@swift-5.9.swift > current_package_diff.patch || true
@if diff ./Utils/expected_package_diff.patch current_package_diff.patch > /dev/null 2>&1; then \
echo "--> Package diff check passed - no changes detected"; \
else \
echo "--> Package diff check failed - changes detected! Make sure to run \"make update-package-diff\" to update the expected diff."; \
exit 1; \
fi

# Diff will return an error if the files are different, so we need to ignore it with `|| true`.
update-package-diff:
diff Package.swift Package@swift-5.9.swift > ./Utils/expected_package_diff.patch || true
25 changes: 25 additions & 0 deletions Utils/expected_package_diff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
1,2c1,5
< // swift-tools-version:5.3
< #if canImport(Darwin)
---
> // swift-tools-version:5.9
> // This Package.swift for Swift 5.9 (and newer) fixes an issue on Xcode 26 when linking `SentrySwiftUI`.
> // Don't remove this comment.
>
> #if canImport(Darwin)
15d17
< .library(name: "Sentry-Dynamic-WithARM64e", targets: ["Sentry-Dynamic-WithARM64e"]),
39a42,44
> swiftSettings: [
> .interoperabilityMode(.Cxx, .when(platforms: [.visionOS]))
> ],
53c58
< if let env = env, String(cString: env, encoding: .utf8) == "1" {
---
> if let env = env, String(cString: env) == "1" {
84a90
> publicHeadersPath: "",
100c106
< platforms: [.iOS(.v11), .macOS(.v10_13), .tvOS(.v11), .watchOS(.v4)],
---
> platforms: [.iOS(.v11), .macOS(.v10_13), .tvOS(.v11), .watchOS(.v4), .visionOS(.v1)],
Loading