-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix: Consume Cocoa SDK as .xcframework
#1002
Conversation
…entry-unity into feat/ios/xcframework
<Message Importance="High" Text="Creating xcconfig file to enable Bitcode." /> | ||
<WriteLinesToFile File="$(SentryCocoaRoot)unity.xcconfig" Lines="ENABLE_BITCODE = YES" Overwrite="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Cocoa builds with Bitcode disabled
by default. Unity Xcode projects have Bitcode enabled
by default. Bitcode has been deprecated but while we wait for Unity to update the generation we build the Cocoa SDK with a temporary config file to enable it.
# Override the generated GUID as part of the .bcsymbolmap | ||
$snapshotContent = $snapshotContent -replace "BCSymbolMaps\/.+?(\.)","BCSymbolMaps/*." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filtering here, since Bitcode is now part of the .xcframework
and the Guid changes with every build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
<Exec WorkingDirectory="$(SentryCocoaRoot)" Command="carthage build --use-xcframeworks --no-skip-current --platform iOS"></Exec> | ||
<!-- Workaround to enable building the Cocoa SDK with Bitcode enabled --> | ||
<Message Importance="High" Text="Creating xcconfig file to enable Bitcode." /> | ||
<WriteLinesToFile File="$(SentryCocoaRoot)unity.xcconfig" Lines="ENABLE_BITCODE = YES" Overwrite="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if we have it enabled here and users want to disable it (in Unity) - would everything work normally? Just checking because nothing coming from xcode would surprise me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I did test that and Xcode just rolls with it.
Currently, we build the Cocoa SDK and then copy the device and simulator
.framework
directories into the Plugins/iOS folder. They get excluded from Unity through the.meta
files because, for the generated XCode project, we set the SDK up ourselves.On the M1 the Carthage build artifacts are named slightly different which breaks our hardcoded paths within the
.xcframework
.Since we're currently setting the
.frameworks
up to be ignored anyway and we manually copy them to the generated Xcode project, the idea here is:.xcframework
instead of the individual.framework
into the plugins folder~
to it so Unity ignores it (and does not copy the frameworks from within during XCode generation)