-
-
Notifications
You must be signed in to change notification settings - Fork 220
/
Copy pathSentry.Bindings.Android.csproj
134 lines (119 loc) · 7.88 KB
/
Sentry.Bindings.Android.csproj
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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-android34.0;net9.0-android35.0</TargetFrameworks>
<SentryAndroidSdkVersion>8.6.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>
</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
Transitive dependencies from this main nuget which we use will pull in Java8 Common and AndroidX.Core
-->
<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="[2.6.1.3,)" />
</ItemGroup>
<!-- Dependencies for AndroidMavenLibrary references
Note: versions match what was shipped with net9.0-android35.0 in:
https://www.nuget.org/packages/Microsoft.Maui.Core/9.0.0#dependencies-body-tab
Transitive dependencies from this main nuget which we use will pull in Java8 Common and AndroidX.Core
-->
<ItemGroup Condition="$(TargetFramework.StartsWith('net9'))">
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="[2.8.5.1,)" />
</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" />
</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)" />
</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/$(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>