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

Feat: Custom SDK names #725

Merged
merged 8 commits into from
May 31, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
- Automatic user IDs on native crashes & .NET events ([#728](https://github.com/getsentry/sentry-unity/pull/728))
- Use single-threaded HTTP transport on unknown platforms ([#756](https://github.com/getsentry/sentry-unity/pull/756))
- Disable offline caching on unknown platforms ([#770](https://github.com/getsentry/sentry-unity/pull/770))
- Bump Sentry Cocoa SDK to v7.16.0 ([#725](https://github.com/getsentry/sentry-unity/pull/725))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/7.16.0/CHANGELOG.md?plain=1#L3..L38)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/7.13.0...7.16.0)
- Bump Sentry Java SDK to v6.0.0-rc.1 ([#725](https://github.com/getsentry/sentry-unity/pull/725))
- [changelog](https://github.com/getsentry/sentry-java/blob/6.0.0-rc.1/CHANGELOG.md?plain=1#L3..L79)
- [diff](https://github.com/getsentry/sentry-java/compare/6.0.0-alpha.4...6.0.0-rc.1)

## 0.16.0

Expand Down
6 changes: 3 additions & 3 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Expected to exist:
<Error Condition="!Exists('$(SentryAndroidRoot)')" Text="Couldn't find the Android root at $(SentryAndroidRoot)."></Error>
<Message Importance="High" Text="Building Sentry Android SDK."></Message>

<Exec WorkingDirectory="$(SentryAndroidRoot)" Command="./gradlew :sentry-android-core:assembleRelease :sentry-android-ndk:assembleRelease :sentry:jar --no-daemon --stacktrace --warning-mode none"></Exec>
<Exec WorkingDirectory="$(SentryAndroidRoot)" Command="./gradlew -PsentryAndroidSdkName=sentry.native.android.unity :sentry-android-core:assembleRelease :sentry-android-ndk:assembleRelease :sentry:jar --no-daemon --stacktrace --warning-mode none"></Exec>
vaind marked this conversation as resolved.
Show resolved Hide resolved

<ItemGroup>
<!-- building snapshot based on version, i.e: sentry-5.0.0-beta.3-SNAPSHOT.jar -->
Expand All @@ -203,7 +203,7 @@ Expected to exist:

<Message Importance="High" Text="Building artifacts of Sentry Native SDK for Windows." />

<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake -B build -D SENTRY_BACKEND=crashpad -S ."></Exec>
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake -B build -D SENTRY_BACKEND=crashpad -D SENTRY_SDK_NAME=sentry.native.unity -S ."></Exec>
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake --build build --target sentry --config RelWithDebInfo --parallel"></Exec>
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake --build build --target crashpad_handler --config Release --parallel"></Exec>

Expand All @@ -224,7 +224,7 @@ Expected to exist:

<Message Importance="High" Text="Building artifacts of Sentry Native SDK for Linux." />

<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake -B build -D SENTRY_BACKEND=breakpad -D CMAKE_BUILD_TYPE=RelWithDebInfo -S ." />
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake -B build -D SENTRY_BACKEND=breakpad -D SENTRY_SDK_NAME=sentry.native.unity -D CMAKE_BUILD_TYPE=RelWithDebInfo -S ." />
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake --build build --target sentry --parallel" />

<MakeDir Directories="$(SentryLinuxArtifactsDestination)"/>
Expand Down
2 changes: 1 addition & 1 deletion modules/sentry-cocoa
Submodule sentry-cocoa updated 251 files
2 changes: 1 addition & 1 deletion modules/sentry-java
Submodule sentry-java updated 253 files
4 changes: 3 additions & 1 deletion package-dev/Plugins/macOS/SentryNativeBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ int SentryNativeBridgeLoadLibrary()

const void *SentryNativeBridgeOptionsNew()
{
return CFBridgingRetain([[NSMutableDictionary alloc] init]);
NSMutableDictionary *dictOptions = [[NSMutableDictionary alloc] init];
dictOptions[@"sdk"] = @ { @"name" : @"sentry.cocoa.unity" };
return CFBridgingRetain(dictOptions);
}

void SentryNativeBridgeOptionsSetString(const void *options, const char *name, const char *value)
Expand Down
1 change: 1 addition & 0 deletions src/Sentry.Unity.Editor.iOS/NativeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal string Generate(SentryOptions options)
static NSDictionary* getSentryOptions()
{{
NSDictionary* options = @{{
@""sdk"" : @{{ @""name"": @""sentry.cocoa.unity"" }},
@""dsn"" : @""{options.Dsn}"",
@""debug"" : @{ToObjCString(options.Debug)},
@""diagnosticLevel"" : @""{ToNativeDiagnosticLevel(options.DiagnosticLevel)}"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ internal void ModifyManifest(string basePath)
}

logger.LogDebug("Configuring Sentry options on AndroidManifest: {0}", basePath);

androidManifest.SetSDK("sentry.java.android.unity");
vaind marked this conversation as resolved.
Show resolved Hide resolved
logger.LogDebug("Setting DSN: {0}", _options!.Dsn);
androidManifest.SetDsn(_options.Dsn!);
if (_options.Debug)
Expand Down Expand Up @@ -306,6 +306,8 @@ internal void DisableSentryAndSave()
internal void SetRelease(string release) => SetMetaData($"{SentryPrefix}.release", release);
internal void SetEnvironment(string environment) => SetMetaData($"{SentryPrefix}.environment", environment);

internal void SetSDK(string name) => SetMetaData($"{SentryPrefix}.sdk.name", name);

internal void SetAutoSessionTracking(bool enableAutoSessionTracking)
=> SetMetaData($"{SentryPrefix}.auto-session-tracking.enable", enableAutoSessionTracking.ToString());

Expand Down
4 changes: 2 additions & 2 deletions test/Scripts.Tests/package-release.zip.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ Plugins/iOS/Device/Sentry.framework/Headers/SentryUserFeedback.h.meta
Plugins/iOS/Device/Sentry.framework/Modules/module.modulemap
Plugins/iOS/Device/Sentry.framework/Modules/module.modulemap.meta
Plugins/Android/Sentry.meta
Plugins/Android/Sentry/sentry-6.0.0-alpha.4.jar
Plugins/Android/Sentry/sentry-6.0.0-alpha.4.jar.meta
Plugins/Android/Sentry/sentry-6.0.0-rc.1.jar
Plugins/Android/Sentry/sentry-6.0.0-rc.1.jar.meta
Plugins/Android/Sentry/sentry-android-core-release.aar
Plugins/Android/Sentry/sentry-android-core-release.aar.meta
Plugins/Android/Sentry/sentry-android-ndk-release.aar
Expand Down