Skip to content

ref: Support Unity as a platfom #4322

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Jul 3, 2025

This comes from getsentry/sentry-unity#2227

The goal is to provide the Unity SDK a way to "internalize" the .NET SDK. This works because the Unity SDK builds the .NET SDK from source. The relevant changes happen in SentrySdk.cs.

We noticed the similarity between Unity and the platforms Android, iOS, and Native. All the Unity specific junk from the Sentry.csproj now goes into its own .props.

To lend the argument "Unity is its own platform" some credibility we dug out some ms docs.

#skip-changelog

@bitsandfoxes bitsandfoxes changed the title Feat/constant unity sdk feat: Add constant to "internalize" SentrySdk Jul 3, 2025
@bitsandfoxes bitsandfoxes changed the title feat: Add constant to "internalize" SentrySdk ref: Support Unity as a platfom Jul 7, 2025
Comment on lines +5 to +18
/// <summary>
/// Internal Sentry SDK entrypoint.
/// </summary>
/// <remarks>
/// This class is now internal. Use <c>Sentry.Unity.SentrySdk</c> instead.
/// <para>
/// To migrate your code:
/// <list type="number">
/// <item>Change <c>using Sentry;</c> to <c>using Sentry.Unity;</c></item>
/// <item>Keep using the <c>SentrySdk</c> API itself - no changes needed to method calls</item>
/// <item>Add <c>using Sentry;</c> if you need access to types like <c>SentryId</c>, <c>SentryLevel</c>, etc.</item>
/// </list>
/// </para>
/// </remarks>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only visible to Unity SDK users. The changes here are part of breaking changes to the Unity SDK and this aims to reduce friction when migrating.

@@ -7,29 +7,19 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(SolutionName)' != 'Sentry.Unity'">
<PropertyGroup>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer need to conditionally set the TF, they get overwritten by the platform .props on line 22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant