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

ref: Remove SentryPrivate #3623

Merged
merged 78 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
90184c0
Update project.pbxproj
brustolin Feb 8, 2024
64510cd
Fix header
brustolin Feb 8, 2024
d2cf616
Format code
getsentry-bot Feb 8, 2024
e1662f7
Update SentrySwift.h
brustolin Feb 8, 2024
24afb92
Format code
getsentry-bot Feb 8, 2024
f5735ef
Fixing tests
brustolin Feb 8, 2024
16efe5a
Merge branch 'fix/no-sentryprivate-for-self-build' of github.com:gets…
brustolin Feb 8, 2024
ac7fdfe
Format code
getsentry-bot Feb 8, 2024
a9faa57
Remove SentryPrivate from cocoapod
brustolin Feb 9, 2024
a4b5db3
Update pod-lib-lint.sh
brustolin Feb 9, 2024
01b0ce9
Update SentrySwift.h
brustolin Feb 9, 2024
cf0cead
Format code
getsentry-bot Feb 9, 2024
704b1ec
Update CHANGELOG.md
brustolin Feb 9, 2024
818ff21
Update CHANGELOG.md
brustolin Feb 12, 2024
f45f7c3
Merge branch 'main' into fix/no-sentryprivate-for-self-build
brustolin Feb 16, 2024
b4897d8
Pre compile framework for SPM
brustolin Feb 23, 2024
7908b73
Merge branch 'main' into fix/no-sentryprivate-for-self-build
brustolin Feb 23, 2024
9f73fc0
Merge branch 'main' into fix/no-sentryprivate-for-self-build
brustolin Feb 23, 2024
13036b9
Merge branch 'fix/no-sentryprivate-for-self-build' of github.com:gets…
brustolin Feb 23, 2024
87cb649
Update CHANGELOG.md
brustolin Feb 23, 2024
afeeedc
fix carthage
brustolin Feb 23, 2024
681437a
Update build.yml
brustolin Feb 23, 2024
ab970ca
Update build.yml
brustolin Feb 23, 2024
33ea8e9
Update build.yml
brustolin Feb 23, 2024
c081906
Update build.yml
brustolin Feb 23, 2024
e5d1d40
Merge branch 'main' into fix/no-sentryprivate-for-self-build
brustolin Feb 23, 2024
a6c8e13
remove perf
brustolin Feb 23, 2024
69504fe
Update release.yml
brustolin Feb 23, 2024
c92f2bf
Merge branch 'chore/fix-release-workflow' into intermediate/8.22.0
brustolin Feb 23, 2024
0acb870
Cache xcframework
brustolin Feb 26, 2024
e9f9444
Merge branch 'fix/no-sentryprivate-for-self-build' into intermediate/…
brustolin Feb 26, 2024
55e1143
Update Package.swift framework SHA
getsentry-bot Feb 26, 2024
70c0ecc
Update build.yml
brustolin Feb 26, 2024
ae9890e
Update release.yml
brustolin Feb 26, 2024
5065071
Update build.yml
brustolin Feb 26, 2024
058ccb3
Update Package.swift framework SHA
getsentry-bot Feb 26, 2024
a3b844d
Update Package.swift framework SHA
getsentry-bot Feb 26, 2024
4b1653e
using artefact
brustolin Feb 26, 2024
c581e28
Merge branch 'intermediate/8.22.0' of github.com:getsentry/sentry-coc…
brustolin Feb 26, 2024
d0afa59
Update xcframework-generated-run.sh
brustolin Feb 26, 2024
a6246e3
Update build.yml
brustolin Feb 26, 2024
2c4323f
Update Package.swift framework SHA
getsentry-bot Feb 26, 2024
3290d91
fixing artefact check
brustolin Feb 26, 2024
2c0aaf1
Merge branch 'intermediate/8.22.0' of github.com:getsentry/sentry-coc…
brustolin Feb 26, 2024
7cfe9a4
Update release.yml
brustolin Feb 26, 2024
5c89a2b
Update bump.sh
brustolin Feb 26, 2024
ebef537
Update update-package-sha.sh
brustolin Feb 26, 2024
dc24d43
Update update-package-sha.sh
brustolin Feb 26, 2024
f05bae5
Update update-package-sha.sh
brustolin Feb 26, 2024
6c7d447
Merge branch 'main' into intermediate/8.22.0
brustolin Feb 26, 2024
f2369e9
Update update-package-sha.sh
brustolin Feb 26, 2024
aa2e765
SwiftUI too
brustolin Feb 26, 2024
914d069
Apply suggestions from code review
brustolin Feb 26, 2024
c8d6e0a
Merge branch 'fix/no-sentryprivate-for-self-build' of github.com:gets…
brustolin Feb 26, 2024
a67aab7
restore perf tests
brustolin Feb 26, 2024
2bd640f
format
brustolin Feb 26, 2024
2f1a880
use a file for runid
brustolin Feb 27, 2024
820b575
No Carthage
brustolin Feb 27, 2024
56eac9c
Create build-xcframework.sh
brustolin Feb 27, 2024
0cbc391
Format code
getsentry-bot Feb 27, 2024
890bdd2
format
brustolin Feb 27, 2024
f420340
Merge branch 'fix/no-sentryprivate-for-self-build' of github.com:gets…
brustolin Feb 27, 2024
c8e6b24
Update AppDelegate.swift
brustolin Feb 27, 2024
630de64
Make pod works
brustolin Feb 28, 2024
05aeccf
Merge branch 'main' into fix/no-sentryprivate-for-self-build
brustolin Feb 28, 2024
335c1d0
Fix SentrySwiftUI for pods
brustolin Feb 28, 2024
49babe4
Merge branch 'fix/no-sentryprivate-for-self-build' of github.com:gets…
brustolin Feb 28, 2024
0a6d52b
fixing test
brustolin Feb 28, 2024
92a52d4
Update project.pbxproj
brustolin Feb 28, 2024
524355d
more fixes and enabling more ci
brustolin Feb 28, 2024
5f28a38
SPM validation
brustolin Feb 28, 2024
88822d6
Update build.yml
brustolin Feb 28, 2024
a9a593f
Update build.yml
brustolin Feb 29, 2024
574d762
Apply suggestions from code review
brustolin Mar 1, 2024
6d245ba
Apply suggestions from code review
brustolin Mar 1, 2024
e20f1a5
Update CHANGELOG.md
brustolin Mar 1, 2024
177f4ff
Merge branch 'main' into fix/no-sentryprivate-for-self-build
brustolin Mar 4, 2024
5f46b57
Update CHANGELOG.md
brustolin Mar 4, 2024
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: 0 additions & 3 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ changelogPolicy: auto
preReleaseCommand: bash ./scripts/bump.sh
targets:
- name: github
- name: cocoapods
id: sentryprivate-cocoapod
specPath: SentryPrivate.podspec
- name: cocoapods
id: sentry-cocoapod
specPath: Sentry.podspec
Expand Down
1 change: 1 addition & 0 deletions .github/last-release-runid
brustolin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
philipphofmann marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ jobs:
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Build Framework
run: make build-xcframework
brustolin marked this conversation as resolved.
Show resolved Hide resolved
- name: Build test app with sentry
run: bundle exec fastlane build_perf_test_app_sentry
env:
Expand Down
69 changes: 53 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,30 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh 15.2
- run: make build-xcframework
- run: echo "FRAMEWORK_RUN_ID=$(./scripts/xcframework-generated-run.sh)" >> $GITHUB_ENV

- uses: actions/download-artifact@v4
if: startsWith(github.ref, 'refs/heads/release/')
with:
name: xcframeworks.zip
path: Carthage/
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.FRAMEWORK_RUN_ID }}

- name: Check XCFramework
#We dont compile the framework during releases to not change the artefact SHA value
#instead we use the one archive as an artefact
if: startsWith(github.ref, 'refs/heads/release/')
run: |
ls -R Carthage
if [ ! -f Carthage/Sentry.xcframework.zip ]; then
echo "XCFramework is not available"
exit 1
fi

- name: Build xcframework
if: startsWith(github.ref, 'refs/heads/release/') == false
run: make build-xcframework
shell: sh

- name: Archiving XCFramework.zip
Expand All @@ -106,7 +129,7 @@ jobs:
name: ${{ github.sha }}
if-no-files-found: error
path: |
${{ github.workspace }}/*.zip
${{ github.workspace }}/Carthage/*.zip

- name: Archive build log if failed
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -135,15 +158,17 @@ jobs:
validate-spm:
name: Validate Swift Package Manager
runs-on: macos-13
needs: build-xcframework
steps:
- uses: actions/checkout@v4
- name: Set SPM revision to current git commit
run: >-
if [[ "${{ github.event.pull_request.head.sha }}" != "" ]]; then
sed -i '' 's/.branch("main")/.revision("${{ github.event.pull_request.head.sha }}")/g' Samples/macOS-SPM-CommandLine/Package.swift
else
sed -i '' 's/.branch("main")/.revision("${{ github.sha }}")/g' Samples/macOS-SPM-CommandLine/Package.swift
fi
- uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}
- name: Change path of the framework
run: |
sed -i '' 's/url.*//g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
shell: bash
- run: swift build
working-directory: Samples/macOS-SPM-CommandLine
Expand All @@ -152,15 +177,17 @@ jobs:
validate-spm-dynamic:
name: Validate Swift Package Manager Dynamic
runs-on: macos-13
needs: build-xcframework
steps:
- uses: actions/checkout@v4
- name: Set SPM revision to current git commit
run: >-
if [[ "${{ github.event.pull_request.head.sha }}" != "" ]]; then
sed -i '' 's/.branch("main")/.revision("${{ github.event.pull_request.head.sha }}")/g' Samples/SPM-Dynamic/Package.swift
else
sed -i '' 's/.branch("main")/.revision("${{ github.sha }}")/g' Samples/SPM-Dynamic/Package.swift
fi
- uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}
- name: Change path of the framework
run: |
sed -i '' 's/url.*//g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
shell: bash
- run: swift build
working-directory: Samples/SPM-Dynamic
Expand All @@ -169,8 +196,18 @@ jobs:
swift-build:
name: Build with Swift
runs-on: macos-13
needs: build-xcframework
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}
- name: Change path of the framework
run: |
sed -i '' 's/url.*//g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
shell: bash
- run: swift build
shell: sh

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ jobs:
- run: ./scripts/ci-select-xcode.sh
- run: pod repo update
- name: Validate HybridPod Podspec
run: pod lib lint ./Tests/HybridSDKTest/HybridPod.podspec --allow-warnings --verbose --platforms=ios "--include-podspecs={SentryPrivate.podspec,Sentry.podspec}"
run: pod lib lint ./Tests/HybridSDKTest/HybridPod.podspec --allow-warnings --verbose --platforms=ios "--include-podspecs={Sentry.podspec}"
35 changes: 34 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,49 @@ on:
required: false

jobs:
prepare_framework:
runs-on: macos-13-xlarge
name: 'Create XCFramework'
steps:
- uses: actions/checkout@v4

- name: 'Generate XCFramework'
run: |
./scripts/ci-select-xcode.sh 15.2
# We need to build the framework during release to get it's SHA value
# the framework will be saved as an artefact and we will use the same
# binary for the entire release process to avoid the SHA to change
make build-xcframework

- uses: actions/upload-artifact@v4
with:
name: xcframeworks.zip
path: |
Carthage/Sentry.xcframework.zip
Carthage/Sentry-Dynamic.xcframework.zip
Carthage/SentrySwiftUI.xcframework.zip
overwrite: true

job_release:
runs-on: ubuntu-latest
name: 'Release a new version'
needs: prepare_framework
steps:
- name: Check out current commit (${{ github.sha }})
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0


- uses: actions/download-artifact@v4
with:
name: xcframeworks.zip
path: Carthage/

# update-package-sha.sh uses this env variable to update Package.swift.
# During release Craft calls bump.sh that uses update-package-sha.sh.
- run: export GITHUB_RUN_ID=${{ github.run_id }}

- name: Prepare release
uses: getsentry/action-prepare-release@v1
env:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Improvements

- Remove SentryPrivate library (#3623)

## 8.21.0

### Features
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ analyze:
# For more info check out: https://github.com/Carthage/Carthage/releases/tag/0.38.0
build-xcframework:
@echo "--> Carthage: creating Sentry xcframework"
carthage build --use-xcframeworks --no-skip-current --verbose > build-xcframework.log
./scripts/build-xcframework.sh > build-xcframework.log
# use ditto here to avoid clobbering symlinks which exist in macOS frameworks
ditto -c -k -X --rsrc --keepParent Carthage Sentry.xcframework.zip
ditto -c -k -X --rsrc --keepParent Carthage/Sentry.xcframework Carthage/Sentry.xcframework.zip
ditto -c -k -X --rsrc --keepParent Carthage/Sentry-Dynamic.xcframework Carthage/Sentry-Dynamic.xcframework.zip
ditto -c -k -X --rsrc --keepParent Carthage/SentrySwiftUI.xcframework Carthage/SentrySwiftUI.xcframework.zip

build-xcframework-sample:
./scripts/create-carthage-json.sh
Expand Down
61 changes: 19 additions & 42 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,34 @@ let package = Package(
platforms: [.iOS(.v11), .macOS(.v10_13), .tvOS(.v11), .watchOS(.v4)],
products: [
.library(name: "Sentry", targets: ["Sentry"]),
.library(name: "Sentry-Dynamic", type: .dynamic, targets: ["Sentry"]),
.library(name: "SentrySwiftUI", targets: ["SentrySwiftUI"])
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI"])
],
targets: [
.target(
name: "Sentry",
dependencies: ["SentryPrivate"],
path: "Sources",
sources: [
"Sentry/",
"SentryCrash/"
],
publicHeadersPath: "Sentry/Public/",
cxxSettings: [
.define("GCC_ENABLE_CPP_EXCEPTIONS", to: "YES"),
.headerSearchPath("Sentry/include"),
.headerSearchPath("Sentry/include/HybridPublic"),
.headerSearchPath("Sentry/Public"),
.headerSearchPath("SentryCrash/Installations"),
.headerSearchPath("SentryCrash/Recording"),
.headerSearchPath("SentryCrash/Recording/Monitors"),
.headerSearchPath("SentryCrash/Recording/Tools"),
.headerSearchPath("SentryCrash/Reporting/Filters"),
.headerSearchPath("SentryCrash/Reporting/Filters/Tools"),
.headerSearchPath("SentryCrash/Reporting/Tools")
]
),
.target( name: "SentryPrivate",
path: "Sources",
sources: [
"Swift"
],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy")
]
),
.binaryTarget(
name: "Sentry",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.22.0-alpha.0/Sentry.xcframework.zip",
checksum: "86156301aee5c8774a8cd5c240286f914f6e7721aaac5a7c9d049ea613a4b730" //Sentry-Static
),
.binaryTarget(
name: "Sentry-Dynamic",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.22.0-alpha.0/Sentry-Dynamic.xcframework.zip",
checksum: "86156301aee5c8774a8cd5c240286f914f6e7721aaac5a7c9d049ea613a4b730" //Sentry-Dynamic
),
brustolin marked this conversation as resolved.
Show resolved Hide resolved
.target ( name: "SentrySwiftUI",
dependencies: ["Sentry", "SentryInternal"],
path: "Sources",
exclude: ["SentrySwiftUI/SentryInternal/"],
sources: [
"SentrySwiftUI"
path: "Sources/SentrySwiftUI",
exclude: ["SentryInternal/", "module.modulemap"],
linkerSettings: [
.linkedFramework("Sentry")
]
),
//SentryInternal is how we expose some internal Sentry SDK classes to SentrySwiftUI.
.target( name: "SentryInternal",
path: "Sources",
path: "Sources/SentrySwiftUI",
sources: [
"SentrySwiftUI/SentryInternal/"
"SentryInternal/"
],
publicHeadersPath: "SentrySwiftUI/SentryInternal/"
publicHeadersPath: "SentryInternal/"
)
],
cxxLanguageStandard: .cxx14
Expand Down
6 changes: 3 additions & 3 deletions Samples/SPM-Dynamic/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ let package = Package(
name: "SPM-Dynamic",
platforms: [.macOS(.v10_13)],
products: [
.library(name: "SPM-Dynamic", type: .dynamic, targets: ["SPM-Dynamic"])
.executable(name: "SPM-Dynamic", targets: ["SPM-Dynamic"])
],
dependencies: [
// branch is replaced in CI to the current sha
.package(name: "Sentry", url: "https://github.com/getsentry/sentry-cocoa", .branch("main") )
.package(name: "Sentry", path: "../../../sentry-cocoa")
brustolin marked this conversation as resolved.
Show resolved Hide resolved
],
targets: [
.target(
name: "SPM-Dynamic",
dependencies: ["Sentry"],
dependencies: [.product(name: "Sentry-Dynamic", package: "Sentry")],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
])
Expand Down
3 changes: 2 additions & 1 deletion Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let appSupport = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).first!
let cache = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first!
for path in [appSupport, cache] {
for item in FileManager.default.enumerator(atPath: path)! {
guard let files = FileManager.default.enumerator(atPath: path) else { return }
for item in files {
try! FileManager.default.removeItem(atPath: (path as NSString).appendingPathComponent((item as! String)))
}
}
Expand Down
3 changes: 1 addition & 2 deletions Samples/macOS-SPM-CommandLine/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import PackageDescription
let package = Package(
name: "macOS-SPM-CommandLine",
dependencies: [
// branch is replaced in CI to the current sha
.package(name: "Sentry", url: "https://github.com/getsentry/sentry-cocoa", .branch("main") )
.package(name: "Sentry", path: "../../../sentry-cocoa")
],
targets: [
.target(
Expand Down
6 changes: 3 additions & 3 deletions Sentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ Pod::Spec.new do |s|
'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
'CLANG_CXX_LIBRARY' => 'libc++',
'APPLICATION_EXTENSION_API_ONLY' => 'YES'
}
s.watchos.pod_target_xcconfig = {
'OTHER_LDFLAGS' => '$(inherited) -framework WatchKit'
}

s.default_subspecs = ['Core']
s.dependency "SentryPrivate", "8.21.0"

s.subspec 'Core' do |sp|
sp.source_files = "Sources/Sentry/**/*.{h,hpp,m,mm,c,cpp}",
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/Swift/Sentry.swift"
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/Swift/**/*.{swift,h,hpp,m,mm,c,cpp}"
sp.public_header_files =
"Sources/Sentry/Public/*.h"
sp.resource_bundles = { "Sentry" => "Sources/Resources/PrivacyInfo.xcprivacy" }
end

s.subspec 'HybridSDK' do |sp|
sp.source_files = "Sources/Sentry/**/*.{h,hpp,m,mm,c,cpp}",
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/Swift/Sentry.swift"
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/Swift/**/*.{swift,h,hpp,m,mm,c,cpp}"

sp.public_header_files =
"Sources/Sentry/Public/*.h", "Sources/Sentry/include/HybridPublic/*.h"
Expand Down
Loading
Loading