File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,13 @@ BeforeDiscovery {
1818}
1919
2020$cases = @ (
21- @ { configuration = ' Release' }
22- @ { configuration = ' Debug' }
21+ # TODO: uncomment mono tests (#4676)
22+ # @{ configuration = 'Release'; runtime = 'mono' }
23+ @ { configuration = ' Release' ; runtime = ' coreclr' }
24+ # @{ configuration = 'Debug'; runtime = 'mono' }
25+ @ { configuration = ' Debug' ; runtime = ' coreclr' }
2326)
24- Describe ' MAUI app (<dotnet_version>, <configuration>)' - ForEach $cases - Skip:(-not $script :emulator ) {
27+ Describe ' MAUI app (<dotnet_version>, <configuration>, <runtime> )' - ForEach $cases - Skip:(-not $script :emulator ) {
2528 BeforeAll {
2629 $tfm = " $dotnet_version -android$ ( GetAndroidTpv $dotnet_version ) "
2730
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ namespace Sentry;
2222public static partial class SentrySdk
2323{
2424 private static AndroidContext AppContext { get ; set ; } = Application . Context ;
25+ private static bool IsMonoRuntime => Type . GetType ( "Mono.RuntimeStructs" ) != null ;
2526
2627 private static void InitSentryAndroidSdk ( SentryOptions options )
2728 {
@@ -64,7 +65,11 @@ private static void InitSentryAndroidSdk(SentryOptions options)
6465 o . ServerName = options . ServerName ;
6566 o . SessionTrackingIntervalMillis = ( long ) options . AutoSessionTrackingInterval . TotalMilliseconds ;
6667 o . ShutdownTimeoutMillis = ( long ) options . ShutdownTimeout . TotalMilliseconds ;
67- o . SetNativeHandlerStrategy ( JavaSdk . Android . Core . NdkHandlerStrategy . SentryHandlerStrategyDefault ) ;
68+ if ( ! IsMonoRuntime )
69+ {
70+ // TODO: exclude ChainAtStart when running on CoreCLR (#4676)
71+ o . SetNativeHandlerStrategy ( JavaSdk . Android . Core . NdkHandlerStrategy . SentryHandlerStrategyDefault ) ;
72+ }
6873
6974 if ( options . CacheDirectoryPath is { } cacheDirectoryPath )
7075 {
Original file line number Diff line number Diff line change 281281 </ItemGroup >
282282 </Target >
283283
284+ <!-- Preload NDK to ensure sentry-native's signal handlers are installed before .NET runtime's.
285+ Disabled on Mono until: https://github.com/dotnet/runtime/pull/125835 -->
286+ <Target Name =" SetAndroidNdkPreload"
287+ BeforeTargets =" GetAssemblyAttributes"
288+ Condition =" '$(AndroidApplication)' == 'True'
289+ and $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'
290+ and '$(UseMonoRuntime)' != 'true'" >
291+ <ItemGroup >
292+ <AssemblyAttribute Include =" Android.App.MetaData" >
293+ <_Parameter1 >io.sentry.ndk.preload</_Parameter1 >
294+ <Value >true</Value >
295+ </AssemblyAttribute >
296+ </ItemGroup >
297+ </Target >
298+
284299 <!-- Upload Android ProGuard mapping file to Sentry after the build. -->
285300 <Target Name =" UploadAndroidProGuardMappingFileToSentry" AfterTargets =" Build" DependsOnTargets =" PrepareSentryCLI"
286301 Condition =" '$(SentryCLI)' != '' and '$(SentryUploadAndroidProGuardMapping)' == 'true' And '$(AndroidProguardMappingFile)' != ''" >
You can’t perform that action at this time.
0 commit comments