Skip to content

Experiment: Multi project maui test #4359

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

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d97b4cb
fix: Source context for class libraries when running on Android in Re…
jamescrosswell Jun 19, 2025
99ecda7
Update CHANGELOG.md
jamescrosswell Jun 19, 2025
eaf4382
Merge branch 'main' into multi-project-maui
jamescrosswell Jun 19, 2025
77a3836
Merge branch 'main' into multi-project-maui
jamescrosswell Jul 8, 2025
0fae5db
Update CHANGELOG.md
jamescrosswell Jul 8, 2025
d6366f6
Merge branch 'main' into multi-project-maui
jamescrosswell Jul 8, 2025
68674b6
Merge branch 'main' into multi-project-maui
jamescrosswell Jul 8, 2025
be7ea6e
Update AndroidAssemblyStoreReaderV2.cs
jamescrosswell Jul 8, 2025
057489f
Update AndroidAssemblyStoreReaderV2.cs
jamescrosswell Jul 8, 2025
19f22ec
Update CachingTransportTests.cs
jamescrosswell Jul 9, 2025
50ab8f4
Merge branch 'main' into multi-project-maui
jamescrosswell Jul 12, 2025
e322bef
Merge branch 'main' into multi-project-maui
jamescrosswell Jul 13, 2025
544b354
Update Sentry.Maui.Device.TestApp.csproj
jamescrosswell Jul 13, 2025
6dd5218
Update device-tests-android.yml
jamescrosswell Jul 14, 2025
6393182
Try disabling AndroidAssemblyReaderTests
jamescrosswell Jul 17, 2025
ed3c685
Disable MauiCommunityToolkitMvvmEventsBinderTests
jamescrosswell Jul 17, 2025
82b0cba
Disabled SentryMauiOptionsTests
jamescrosswell Jul 17, 2025
6343283
Disable LogLevelExtensionsTests
jamescrosswell Jul 17, 2025
4993fe5
Restore SentryMauiOptionsTests
jamescrosswell Jul 17, 2025
90b327c
Remove SentryMauiOptionsTests again
jamescrosswell Jul 17, 2025
015044f
Added AndroidAssemblyReaderTests back again
jamescrosswell Jul 17, 2025
5146c17
Added MauiCommunityToolkitMvvmEventsBinderTests back again
jamescrosswell Jul 17, 2025
62527ca
Added LogLevelExtensionsTests back again
jamescrosswell Jul 17, 2025
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: 2 additions & 1 deletion .github/workflows/device-tests-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:
matrix:
tfm: [net9.0]
# We run against both an older and a newer API
api-level: [27, 33]
# targetSdk must be 34+ for new apps and app updates as of August 31, 2024.
api-level: [34, 36]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Sentry now decompresses Request bodies in ASP.NET Core when RequestDecompression middleware is enabled ([#4315](https://github.com/getsentry/sentry-dotnet/pull/4315))
- Custom ISentryEventProcessors are now run for native iOS events ([#4318](https://github.com/getsentry/sentry-dotnet/pull/4318))
- Crontab validation when capturing checkins ([#4314](https://github.com/getsentry/sentry-dotnet/pull/4314))
- Source context for class libraries when running on Android in Release mode ([#4294](https://github.com/getsentry/sentry-dotnet/pull/4294))
- Fixed an issue with the way Sentry detects build settings. This was causing Sentry to produce code that could fail at runtime in AOT compiled applications. ([#4333](https://github.com/getsentry/sentry-dotnet/pull/4333))
- Native AOT: link to static `lzma` on Linux/MUSL ([#4326](https://github.com/getsentry/sentry-dotnet/pull/4326))
- AppDomain.CurrentDomain.ProcessExit hook is now removed on shutdown ([#4323](https://github.com/getsentry/sentry-dotnet/pull/4323))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,19 @@ public static bool TryReadStore(string inputFile, IList<string> supportedAbis, D
return assembly;
}

// If the assembly name ends with .dll or .exe, try to find it without the extension.
if ((IsFileType(".dll") || IsFileType(".exe")) && FindBestAssembly(name[..^4], out assembly))
{
return assembly;
}

// Conversely, if there is no extension, try with the dll extension (sometimes required for class libraries).
// See: https://github.com/getsentry/sentry-dotnet/issues/4278#issuecomment-2986009125
if (!IsFileType(".dll") && !IsFileType(".exe") && FindBestAssembly(name + ".dll", out assembly))
{
return assembly;
}

return null;

bool IsFileType(string extension)
Expand All @@ -119,10 +127,12 @@ private bool FindBestAssembly(string name, out ExplorerStoreItem? explorerAssemb
{
if (explorer.AssembliesByName?.TryGetValue(name, out var assembly) is true)
{
_logger?.Invoke("Found best assembly {0} in APK AssemblyStore for target arch {1}", name, explorer.TargetArch);
explorerAssembly = new(explorer, assembly);
return true;
}
}
_logger?.Invoke("No best assembly for {0} in APK AssemblyStore", name);
explorerAssembly = null;
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ private AssemblyStoreExplorer(Stream storeStream, string path, DebugLogger? logg
{
foreach (var item in Assemblies)
{
logger?.Invoke("Assembly {0} indexed from AssemblyStore {1}", item.Name, path);
dict.Add(item.Name, item);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
<ProjectReference Include="..\Sentry.Extensions.Logging.Tests\Sentry.Extensions.Logging.Tests.csproj"/>
<ProjectReference Include="..\Sentry.Maui.Tests\Sentry.Maui.Tests.csproj"/>
<ProjectReference Include="..\Sentry.Maui.CommunityToolkit.Mvvm.Tests\Sentry.Maui.CommunityToolkit.Mvvm.Tests.csproj" Condition="'$(_SentryIsNet9OrGreater)' == 'true'"/>
<ProjectReference Include="..\..\src\Sentry.SourceGenerators\Sentry.SourceGenerators.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"/>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion test/Sentry.Maui.Device.TestApp/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static MauiApp CreateMauiApp()
[
typeof(Sentry.Tests.SentrySdkTests).Assembly,
typeof(Sentry.Extensions.Logging.Tests.LogLevelExtensionsTests).Assembly,
typeof(Sentry.Maui.Tests.SentryMauiOptionsTests).Assembly,
// typeof(Sentry.Maui.Tests.SentryMauiOptionsTests).Assembly,
#if NET9_0_OR_GREATER
typeof(Sentry.Maui.CommunityToolkit.Mvvm.Tests.MauiCommunityToolkitMvvmEventsBinderTests).Assembly,
#endif
Expand Down
Loading
Loading