Skip to content

Commit 6872adf

Browse files
Remove unnecessary files from SentryCocoaFramework before packing
Workaround for #4292: - #4292 (comment) Replaces #4533 (targets version6 branch instead of main so that we can get adequate feedback from users before releasing this).
1 parent d027543 commit 6872adf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102

103103
<!-- Choose between download and build -->
104104
<Target Name="_SetupCocoaSDK"
105-
DependsOnTargets="_DownloadCocoaSDK;_BuildCocoaSDK"
105+
DependsOnTargets="_DownloadCocoaSDK;_BuildCocoaSDK;_GenerateSentryCocoaBindings;SanitizeSentryCocoaFramework"
106106
Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
107107

108108
<!-- Setup exactly once: https://learn.microsoft.com/visualstudio/msbuild/run-target-exactly-once -->
@@ -122,7 +122,7 @@
122122
</Target>
123123

124124
<!-- Generate bindings -->
125-
<Target Name="_GenerateSentryCocoaBindings" AfterTargets="SetupCocoaSDK"
125+
<Target Name="_GenerateSentryCocoaBindings"
126126
Condition="$([MSBuild]::IsOSPlatform('OSX'))"
127127
Inputs="$(SentryCocoaBindingInputs)"
128128
Outputs="ApiDefinitions.cs;StructsAndEnums.cs">
@@ -134,6 +134,13 @@
134134
<Exec Condition="'$(GITHUB_ACTIONS)' == 'true'" Command="pwsh ../../scripts/dirty-check.ps1 -PathToCheck $(MSBuildThisFileDirectory)" />
135135
</Target>
136136

137+
<!-- Sanitize the xcframework before NativeReference resolution and packing -->
138+
<Target Name="SanitizeSentryCocoaFramework"
139+
Condition="$([MSBuild]::IsOSPlatform('OSX')) and Exists('$(SentryCocoaFramework)')">
140+
<Message Importance="High" Text="Sanitizing $(SentryCocoaFramework): removing dSYMs, Headers, Modules, PrivateHeaders (including symlinks)." />
141+
<Exec Command="find &quot;$(SentryCocoaFramework)&quot; -depth \( -name dSYMs -o -name Headers -o -name Modules -o -name PrivateHeaders \) -exec echo Removing {} \; -exec rm -rf {} + 2&gt;/dev/null || true" />
142+
</Target>
143+
137144
<!-- Workaround for https://github.com/xamarin/xamarin-macios/issues/15299 -->
138145
<Target Name="_SetGeneratedSupportDelegatesInternal" BeforeTargets="CoreCompile" Condition="$([MSBuild]::IsOSPlatform('OSX'))"
139146
Inputs="$(GeneratedSourcesDir)SupportDelegates.g.cs" Outputs="$(GeneratedSourcesDir)SupportDelegates.g.cs.stamp">

0 commit comments

Comments
 (0)