-
-
Notifications
You must be signed in to change notification settings - Fork 213
/
Copy pathSentry.Bindings.Cocoa.targets
65 lines (53 loc) · 3.58 KB
/
Sentry.Bindings.Cocoa.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<Project>
<!--
Workaround to ensure the Sentry Cocoa SDK is present when using iOS "Hot Restart" deployments on Windows
Based on https://github.com/xamarin/xamarin-macios/pull/16605
The only differences are:
- We test that $(HotRestartPackageResourcesDir) is undefined, because if it exists that means the PR has been merged and this target is no longer required.
- We filter to only the framework bundled with Sentry.Bindings.Cocoa
-->
<Target Name="_SentryCollectHotRestartFrameworksFromPackages" BeforeTargets="_CollectHotRestartFrameworks"
Condition="'$(HotRestartPackageResourcesDir)' == '' And '$(_CanOutputAppBundle)' == 'true' And '$(IsHotRestartBuild)' == 'true' And '$(UnpackHotRestartFrameworks)' == 'true'">
<PropertyGroup>
<HotRestartPackageResourcesDir>$(TEMP)\Xamarin\HotRestart\Resources\</HotRestartPackageResourcesDir>
</PropertyGroup>
<ItemGroup>
<_PackageResourcesDirs Include="@(AssembliesWithFrameworks -> '%(RootDir)%(Directory)%(FileName).resources')"
Condition="Exists('%(RootDir)%(Directory)%(FileName).resources') And '%(FileName)' == 'Sentry.Bindings.Cocoa'" />
<_PackageResourcesZips Include="@(AssembliesWithFrameworks -> '%(RootDir)%(Directory)%(FileName).resources.zip')"
Condition="Exists('%(RootDir)%(Directory)%(FileName).resources.zip') And '%(FileName)' == 'Sentry.Bindings.Cocoa'" />
</ItemGroup>
<Unzip ZipFilePath="@(_PackageResourcesZips)"
ExtractionPath="$(HotRestartPackageResourcesDir)%(NuGetPackageId)\%(NuGetPackageVersion)"
Condition="'@(_PackageResourcesZips)' != '' And !Exists('$(HotRestartPackageResourcesDir)%(NuGetPackageId)\%(NuGetPackageVersion)')" />
<ItemGroup Condition="'@(_PackageResourcesZips)' != ''">
<_PackageResourcesDirs Include="@(_PackageResourcesZips -> '$(HotRestartPackageResourcesDir)%(NuGetPackageId)\%(NuGetPackageVersion)')" />
</ItemGroup>
<ItemGroup Condition="'@(_PackageResourcesDirs)' != ''">
<_PackageResourcesFrameworkFiles Include="%(_PackageResourcesDirs.Identity)\*.framework\*" />
<_PackageResourcesFrameworkFiles Include="%(_PackageResourcesDirs.Identity)\**\*.xcframework\ios-arm64\*.framework\*" />
<_HotRestartFrameworksFromPackages Include="@(_PackageResourcesFrameworkFiles -> '%(RootDir)%(Directory)')" KeepDuplicates="false" />
<_HotRestartFrameworks Include="@(_HotRestartFrameworksFromPackages -> TrimEnd('\'))" />
</ItemGroup>
</Target>
<!--
Remove simulator resources when building for Hot Restart.
Effectively works around https://github.com/getsentry/sentry-dotnet/issues/2363
-->
<Target Name="_SentryRemoveSimulatorResourcesForHotRestartBuilds" AfterTargets="_CopyLocalBindingResources" Condition="'$(IsHotRestartBuild)' == 'true'">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="$([System.String]::new('%(Identity)').Contains('Sentry.xcframework\ios-arm64_x86_64-simulator'))" />
</ItemGroup>
</Target>
<!--
Ensure the AppDomain.CurrentDomain.UnhandledException gets triggered - see:
https://github.com/xamarin/xamarin-macios/issues/15252
Not supported on the CoreCLR - see:
https://github.com/xamarin/xamarin-macios/blob/0a81da28e4217624a54ccb83541e1eb8ba651fca/runtime/runtime.m#L2480-L2491
The condition is a bit hacky - it relies on:
https://github.com/xamarin/xamarin-macios/blob/0ab074390689880fe9269804a0156341d30251f6/dotnet/targets/Xamarin.Shared.Sdk.targets#L1004-L1006
-->
<PropertyGroup Condition="'$(_XamarinRuntime)' != 'CoreCLR'">
<MtouchExtraArgs>--marshal-managed-exceptions=unwindnativecode</MtouchExtraArgs>
</PropertyGroup>
</Project>