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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
- Bump Java SDK from v8.57.0 to v8.60.0 ([#2876](https://github.com/getsentry/sentry-unity/pull/2876))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8600)
- [diff](https://github.com/getsentry/sentry-java/compare/8.57.0...8.60.0)
- Bump Cocoa SDK from v9.29.0 to v9.30.1 ([#2875](https://github.com/getsentry/sentry-unity/pull/2875))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#9301)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/9.29.0...9.30.1)

## 4.10.3

Expand Down
13 changes: 3 additions & 10 deletions build/native-sdks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,15 @@
<!--
Build the Cocoa SDK:
dotnet msbuild /t:BuildCocoaSDK src/Sentry.Unity
Always wipes prior outputs (in package-dev/Plugins/iOS, package-dev/Plugins/macOS
and modules/sentry-cocoa/XCFrameworkBuildPath/) and rebuilds from source.
Builds from source into temp/sentry-cocoa/<sentry-cocoa commit>/
-->
<Target Name="BuildCocoaSDK" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'">
<Error Condition="$([MSBuild]::IsOSPlatform('Windows'))" Text="BuildCocoaSDK cannot run on Windows. Use macOS or Linux." />
<Error Condition="!Exists('$(SentryCocoaRoot)Sentry.xcodeproj')" Text="sentry-cocoa submodule not checked out at $(SentryCocoaRoot). Run: git submodule update --init modules/sentry-cocoa" />

<Message Importance="High" Text="Building Cocoa SDK from submodule (clean rebuild)." />
<Message Importance="High" Text="Building Cocoa SDK from submodule." />

<!-- Wipe prior outputs -->
<RemoveDir Directories="$(SentryCocoaRoot)XCFrameworkBuildPath" ContinueOnError="true" />
<RemoveDir Directories="$(SentryiOSArtifactsDestination)" ContinueOnError="true" />
<Delete Files="$(SentrymacOSArtifactsDestination)Sentry.dylib" ContinueOnError="true" />
<Delete Files="$(SentrymacOSArtifactsDestination)Sentry.dylib.dSYM" ContinueOnError="true" />

<Exec Command="pwsh &quot;$(RepoRoot)scripts/build-cocoa-sdk.ps1&quot; -CocoaRoot &quot;$(SentryCocoaRoot)&quot; -iOSDestination &quot;$(SentryiOSArtifactsDestination)&quot; -macOSDestination &quot;$(SentrymacOSArtifactsDestination)Sentry.dylib&quot; -Clean" />
<Exec Command="pwsh &quot;$(RepoRoot)scripts/build-cocoa-sdk.ps1&quot; -CocoaRoot &quot;$(SentryCocoaRoot)&quot; -iOSDestination &quot;$(SentryiOSArtifactsDestination)&quot; -macOSDestination &quot;$(SentrymacOSArtifactsDestination)Sentry.dylib&quot;" />

<Error Condition="!Exists('$(SentryiOSArtifactsDestination)')" Text="Failed to set up the iOS SDK." />
<Error Condition="!Exists('$(SentrymacOSArtifactsDestination)Sentry.dylib') Or !Exists('$(SentrymacOSArtifactsDestination)Sentry.dylib.dSYM')" Text="Failed to set up the macOS SDK." />
Expand Down
2 changes: 1 addition & 1 deletion modules/sentry-cocoa
Submodule sentry-cocoa updated 1463 files
34 changes: 15 additions & 19 deletions scripts/build-cocoa-sdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ if (-not (Test-Path (Join-Path $CocoaRoot "Sentry.xcodeproj"))) {
exit 1
}

# All build artifacts go under XCFrameworkBuildPath/ which is already in sentry-cocoa's .gitignore.
$buildPath = Join-Path $CocoaRoot "XCFrameworkBuildPath"
# Build artifacts must live outside the package root so file writes avoid triggering packager resolving
# Keyed by the sentry-cocoa commit so re-runs reuse the xcframeworks and submodule bumps rebuild.
$cachePath = Join-Path (Split-Path $PSScriptRoot -Parent) "temp/sentry-cocoa"
$cocoaCommit = git -C $CocoaRoot rev-parse HEAD
$buildPath = Join-Path $cachePath $cocoaCommit
$iOSXcframeworkPath = Join-Path $buildPath "SentryObjC-Dynamic-iOS.xcframework"
$macOSXcframeworkPath = Join-Path $buildPath "SentryObjC-Dynamic-macOS.xcframework"

if ($Clean -and (Test-Path $buildPath)) {
Write-Host "Clean build requested — removing $buildPath" -ForegroundColor Yellow
Remove-Item -Path $buildPath -Recurse -Force
if ($Clean -and (Test-Path $cachePath)) {
Write-Host "Clean build requested — removing $cachePath" -ForegroundColor Yellow
Remove-Item -Path $cachePath -Recurse -Force
}

# Prune builds of other sentry-cocoa commits
if (Test-Path $cachePath) {
Get-ChildItem -Path $cachePath -Directory | Where-Object { $_.Name -ne $cocoaCommit } | Remove-Item -Recurse -Force
}

Write-Host "Building Cocoa SDK from source..." -ForegroundColor Yellow
Expand All @@ -44,15 +52,10 @@ try {
# (SentryObjC + SentryObjCCompat + SentryObjCInternal) into a single self-contained framework,
# so Unity links/dlopens only one binary. The dynamic slices are arm64-only (no arm64e), so no
# architecture stripping is needed — unlike the main `Sentry` scheme's Xcode-project build.
& ./scripts/build-xcframework-sentryobjc.sh --sdks "iphoneos,iphonesimulator" --variant dynamic
& ./scripts/build-xcframework-sentryobjc.sh --sdks "iphoneos,iphonesimulator" --variant dynamic --output-dir $buildPath
Comment thread
bitsandfoxes marked this conversation as resolved.
& ./scripts/validate-xcframework-format.sh --xcframework "SentryObjC-Dynamic.xcframework"
# build-xcframework-sentryobjc.sh outputs to the working directory — move into our build cache
Move-Item -Path "SentryObjC-Dynamic.xcframework" -Destination $iOSXcframeworkPath -Force
# Clean up intermediate archives, keep the final xcframework
$archivePath = Join-Path $buildPath "archive"
if (Test-Path $archivePath) {
Remove-Item -Path $archivePath -Recurse -Force
}
}

$privacyManifest = Join-Path $CocoaRoot "Sources/Resources/PrivacyInfo.xcprivacy"
Expand Down Expand Up @@ -99,16 +102,9 @@ try {

if (-not (Test-Path $macOSXcframeworkPath)) {
Write-Host "Building macOS xcframework..." -ForegroundColor Yellow
& ./scripts/build-xcframework-sentryobjc.sh --sdks "macosx" --variant dynamic
& ./scripts/build-xcframework-sentryobjc.sh --sdks "macosx" --variant dynamic --output-dir $buildPath
& ./scripts/validate-xcframework-format.sh --xcframework "SentryObjC-Dynamic.xcframework"
Move-Item -Path "SentryObjC-Dynamic.xcframework" -Destination $macOSXcframeworkPath -Force
# Clean up all remaining build intermediates
foreach ($dir in @("archive", "DerivedData")) {
$dirPath = Join-Path $buildPath $dir
if (Test-Path $dirPath) {
Remove-Item -Path $dirPath -Recurse -Force
}
}
}

Write-Host "Setting up macOS support..." -ForegroundColor Yellow
Expand Down
Loading