-
-
Notifications
You must be signed in to change notification settings - Fork 230
Expand file tree
/
Copy pathSentry.Bindings.Android.csproj
More file actions
160 lines (146 loc) · 10.2 KB
/
Sentry.Bindings.Android.csproj
File metadata and controls
160 lines (146 loc) · 10.2 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-android34.0;net9.0-android35.0</TargetFrameworks>
<SentryAndroidSdkVersion>8.20.0</SentryAndroidSdkVersion>
<SentryAndroidSdkDirectory>$(BaseIntermediateOutputPath)sdks\$(TargetFramework)\Sentry\Android\$(SentryAndroidSdkVersion)\</SentryAndroidSdkDirectory>
<!-- This gets resolved by the DownloadSentryAndroidSdk target -->
<SentryNativeNdkVersion></SentryNativeNdkVersion>
<Description>.NET Bindings for the Sentry Android SDK</Description>
<!-- Android binding warnings - these are largely unavoidable due to Java interface circular dependencies -->
<!-- Only suppress warnings that are confirmed to be expected/unavoidable -->
<!-- BG8801: Invalid parameter types - caused by circular interface dependencies in Sentry Java SDK -->
<!-- BG8C01: Invalid base interface - interfaces reference types removed by Metadata.xml -->
<!-- BG8701: Invalid return types - return types reference unresolvable interfaces -->
<!-- BG8800/BG8700: Unknown/Invalid types - types intentionally removed by Metadata.xml -->
<!-- BG8605/BG8606: Missing Java types - Compose UI types not available in our binding context -->
<!-- BG8604: Missing ancestor types - nested types whose parents are removed -->
<!-- BG8502/BG8503: Interface invalidation - cascade effect from other binding issues -->
<!-- BG8401/BG8400: Field/property conflicts - resolved individually in Metadata.xml where needed -->
<!-- BG8C00: Base interface not found -->
<NoWarn>$(NoWarn);BG8801;BG8C01;BG8701;BG8800;BG8700;BG8605;BG8606;BG8604;BG8502;BG8401;BG8400;BG8503;BG8C00</NoWarn>
</PropertyGroup>
<!-- Use a separate readme, and don't add the changelog to the nuget. -->
<ItemGroup>
<None Remove="$(MSBuildThisFileDirectory)..\..\README.md" />
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="" />
<!--
Normally we'd put this in a TFM specific directory, however this package only targets one TFM:
https://learn.microsoft.com/en-us/nuget/concepts/msbuild-props-and-targets
-->
<None Include="$(MSBuildThisFileDirectory)build/Sentry.Bindings.Android.targets" Pack="true" PackagePath="build/Sentry.Bindings.Android.targets" />
<None Include="$(MSBuildThisFileDirectory)sentry-proguard.cfg" Pack="true" PackagePath="" />
<PackageReference Remove="SIL.ReleaseTasks" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Sentry" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.Testing" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.Tests" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.Extensions.Logging.Tests" PublicKey="$(SentryPublicKey)" />
<InternalsVisibleTo Include="Sentry.Maui.Tests" PublicKey="$(SentryPublicKey)" />
</ItemGroup>
<!-- Dependencies for AndroidMavenLibrary references
Note: versions match what was shipped with net8.0-android34.0 in:
https://www.nuget.org/packages/Microsoft.Maui.Core/8.0.3#dependencies-body-tab
-->
<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="2.6.1.3" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Common.Java8" Version="2.6.1.3" />
<!-- MAUI 8 references this version indirectly via Xamarin.AndroidX.SwipeRefreshLayout (>= 1.1.0.14) -->
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.10.1.2" />
<!-- We need 1.9.24 but there's no NuGet package for that version... the lowest version we can use is 2.0.0 -->
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="2.0.0" />
</ItemGroup>
<!-- Dependencies for AndroidMavenLibrary references
Matching what was shipped in the 9.0.300 workloads to avoid NU1608 warnings
-->
<ItemGroup Condition="$(TargetFramework.StartsWith('net9'))">
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="2.8.7.2" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Common.Java8" Version="2.8.7.2" />
<!-- MAUI 9 references this version indirectly via Xamarin.AndroidX.SwipeRefreshLayout -->
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.15.0.2" />
<!-- We need 1.9.24 but there's no NuGet package for that version... the lowest version we can use is 2.0.0 -->
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="2.0.0" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
<AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).jar" />
<AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-android-core-$(SentryAndroidSdkVersion).aar" />
<AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).aar" />
<AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-android-replay-$(SentryAndroidSdkVersion).aar" />
</ItemGroup>
<!-- Starting with .NET 9 we can detect Java dependencies using POM files and AndroidMavenLibrary references -->
<ItemGroup Condition="!$(TargetFramework.StartsWith('net8'))">
<AndroidLibrary
Include="$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).jar"
Manifest="$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).pom"
JavaArtifact="io.sentry:sentry:$(SentryAndroidSdkVersion)"
/>
<AndroidMavenLibrary Include="io.sentry:sentry-android-core" Version="$(SentryAndroidSdkVersion)" />
<AndroidMavenLibrary Include="io.sentry:sentry-android-ndk" Version="$(SentryAndroidSdkVersion)" />
<AndroidMavenLibrary Include="io.sentry:sentry-android-replay" Version="$(SentryAndroidSdkVersion)" />
</ItemGroup>
<ItemGroup>
<AndroidLibrary Include="..\..\lib\sentry-android-supplemental\bin\sentry-android-supplemental.jar" />
<AndroidNativeLibrary Include="..\..\lib\sentrysupplemental\bin\arm64-v8a\libsentrysupplemental.so" Abi="arm64-v8a" />
<AndroidNativeLibrary Include="..\..\lib\sentrysupplemental\bin\armeabi-v7a\libsentrysupplemental.so" Abi="armeabi-v7a" />
<AndroidNativeLibrary Include="..\..\lib\sentrysupplemental\bin\x86\libsentrysupplemental.so" Abi="x86" />
<AndroidNativeLibrary Include="..\..\lib\sentrysupplemental\bin\x86_64\libsentrysupplemental.so" Abi="x86_64" />
</ItemGroup>
<Target Name="DownloadSentryAndroidSdk" BeforeTargets="CollectPackageReferences">
<DownloadFile
SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-android-core/$(SentryAndroidSdkVersion)/sentry-android-core-$(SentryAndroidSdkVersion).aar"
DestinationFolder="$(SentryAndroidSdkDirectory)"
Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-core-$(SentryAndroidSdkVersion).aar') And $(TargetFramework.StartsWith('net8'))"
Retries="3"
/>
<DownloadFile
SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-android-ndk/$(SentryAndroidSdkVersion)/sentry-android-ndk-$(SentryAndroidSdkVersion).aar"
DestinationFolder="$(SentryAndroidSdkDirectory)"
Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).aar') And $(TargetFramework.StartsWith('net8'))"
Retries="3"
/>
<DownloadFile
SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-android-replay/$(SentryAndroidSdkVersion)/sentry-android-replay-$(SentryAndroidSdkVersion).aar"
DestinationFolder="$(SentryAndroidSdkDirectory)"
Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-replay-$(SentryAndroidSdkVersion).aar') And $(TargetFramework.StartsWith('net8'))"
Retries="3"
/>
<DownloadFile
SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry/$(SentryAndroidSdkVersion)/sentry-$(SentryAndroidSdkVersion).jar"
DestinationFolder="$(SentryAndroidSdkDirectory)"
Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).jar')"
Retries="3"
/>
<DownloadFile
SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry/$(SentryAndroidSdkVersion)/sentry-$(SentryAndroidSdkVersion).pom"
DestinationFolder="$(SentryAndroidSdkDirectory)"
Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).pom') And !$(TargetFramework.StartsWith('net8'))"
Retries="3"
/>
<!-- The native-ndk exists outside of the android-ndk now. We're downloading the POM file to get the version of the native-ndk. -->
<DownloadFile
SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-android-ndk/$(SentryAndroidSdkVersion)/sentry-android-ndk-$(SentryAndroidSdkVersion).pom"
DestinationFolder="$(SentryAndroidSdkDirectory)"
Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).pom')"
Retries="3"
/>
<XmlPeek
XmlInputPath="$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).pom"
Query="//*[local-name()='dependency' and .//*[local-name()='artifactId' and text()='sentry-native-ndk']]/*[local-name()='version']/text()"
Condition="Exists('$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).pom')">
<Output TaskParameter="Result" PropertyName="SentryNativeNdkVersion" />
</XmlPeek>
<DownloadFile
SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-native-ndk/$(SentryNativeNdkVersion)/sentry-native-ndk-$(SentryNativeNdkVersion).aar"
DestinationFolder="$(SentryAndroidSdkDirectory)"
Condition="'$(SentryNativeNdkVersion)' != '' And !Exists('$(SentryAndroidSdkDirectory)sentry-native-ndk-$(SentryNativeNdkVersion).aar') And $(TargetFramework.StartsWith('net8'))"
Retries="3"
/>
<ItemGroup Condition="'$(SentryNativeNdkVersion)' != '' And $(TargetFramework.StartsWith('net8'))">
<AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-native-ndk-$(SentryNativeNdkVersion).aar" />
</ItemGroup>
<ItemGroup Condition="'$(SentryNativeNdkVersion)' != '' And !$(TargetFramework.StartsWith('net8'))">
<AndroidMavenLibrary Include="io.sentry:sentry-native-ndk" Version="$(SentryNativeNdkVersion)" />
</ItemGroup>
</Target>
<UsingTask TaskName="XmlPeek" AssemblyName="Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</Project>