|
1 | 1 | <Project Sdk="Microsoft.NET.Sdk"> |
2 | 2 | <PropertyGroup> |
3 | | - <TargetFrameworks>net8.0-android34.0</TargetFrameworks> |
4 | | - <!-- BG8605 and BG8606 happen because there's a missing androidx.lifecycle dependency, but we don't need it here. (The native Android Sentry SDK will use it if it exists.) --> |
5 | | - <NoWarn>$(NoWarn);BG8605;BG8606</NoWarn> |
6 | | - <SentryAndroidSdkVersion>7.20.1</SentryAndroidSdkVersion> |
7 | | - <SentryAndroidSdkDirectory>$(BaseIntermediateOutputPath)sdks\Sentry\Android\$(SentryAndroidSdkVersion)\</SentryAndroidSdkDirectory> |
| 3 | + <TargetFrameworks>net8.0-android34.0;net9.0-android35.0</TargetFrameworks> |
| 4 | + <SentryAndroidSdkVersion>8.6.0</SentryAndroidSdkVersion> |
| 5 | + <SentryAndroidSdkDirectory>$(BaseIntermediateOutputPath)sdks\$(TargetFramework)\Sentry\Android\$(SentryAndroidSdkVersion)\</SentryAndroidSdkDirectory> |
| 6 | + <!-- This gets resolved by the DownloadSentryAndroidSdk target --> |
| 7 | + <SentryNativeNdkVersion></SentryNativeNdkVersion> |
8 | 8 | <Description>.NET Bindings for the Sentry Android SDK</Description> |
9 | 9 | </PropertyGroup> |
10 | 10 |
|
|
29 | 29 | <InternalsVisibleTo Include="Sentry.Maui.Tests" PublicKey="$(SentryPublicKey)" /> |
30 | 30 | </ItemGroup> |
31 | 31 |
|
32 | | - <ItemGroup> |
| 32 | + <!-- Dependencies for AndroidMavenLibrary references |
| 33 | + Note: versions match what was shipped with net8.0-android34.0 in: |
| 34 | + https://www.nuget.org/packages/Microsoft.Maui.Core/8.0.3#dependencies-body-tab |
| 35 | + --> |
| 36 | + <ItemGroup Condition="$(TargetFramework.StartsWith('net8'))"> |
| 37 | + <PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="2.6.1.3" /> |
| 38 | + <PackageReference Include="Xamarin.AndroidX.Lifecycle.Common.Java8" Version="2.6.1.3" /> |
| 39 | + <!-- MAUI 8 references this version indirectly via Xamarin.AndroidX.SwipeRefreshLayout (>= 1.1.0.14) --> |
| 40 | + <PackageReference Include="Xamarin.AndroidX.Core" Version="1.10.1.2" /> |
| 41 | + </ItemGroup> |
| 42 | + |
| 43 | + <!-- Dependencies for AndroidMavenLibrary references |
| 44 | + Note: versions match what was shipped with net9.0-android35.0 in: |
| 45 | + https://www.nuget.org/packages/Microsoft.Maui.Core/9.0.0#dependencies-body-tab |
| 46 | + --> |
| 47 | + <ItemGroup Condition="$(TargetFramework.StartsWith('net9'))"> |
| 48 | + <PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="2.8.5.1" /> |
| 49 | + <PackageReference Include="Xamarin.AndroidX.Lifecycle.Common.Java8" Version="2.8.5.1" /> |
| 50 | + <!-- MAUI 9 references this version indirectly via Xamarin.AndroidX.SwipeRefreshLayout (>= 1.1.0.24) --> |
| 51 | + <PackageReference Include="Xamarin.AndroidX.Core" Version="1.13.1.5" /> |
| 52 | + </ItemGroup> |
| 53 | + |
| 54 | + <ItemGroup Condition="$(TargetFramework.StartsWith('net8'))"> |
33 | 55 | <AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).jar" /> |
34 | 56 | <AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-android-core-$(SentryAndroidSdkVersion).aar" /> |
35 | 57 | <AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).aar" /> |
| 58 | + </ItemGroup> |
| 59 | + |
| 60 | + <!-- Starting with .NET 9 we can detect Java dependencies using POM files and AndroidMavenLibrary references --> |
| 61 | + <ItemGroup Condition="!$(TargetFramework.StartsWith('net8'))"> |
| 62 | + <AndroidLibrary |
| 63 | + Include="$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).jar" |
| 64 | + Manifest="$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).pom" |
| 65 | + JavaArtifact="io.sentry:sentry:$(SentryAndroidSdkVersion)" |
| 66 | + /> |
| 67 | + <AndroidMavenLibrary Include="io.sentry:sentry-android-core" Version="$(SentryAndroidSdkVersion)" /> |
| 68 | + <AndroidMavenLibrary Include="io.sentry:sentry-android-ndk" Version="$(SentryAndroidSdkVersion)" /> |
| 69 | + </ItemGroup> |
| 70 | + |
| 71 | + <ItemGroup> |
36 | 72 | <AndroidLibrary Include="..\..\lib\sentry-android-supplemental\bin\sentry-android-supplemental.jar" /> |
37 | 73 | <AndroidNativeLibrary Include="..\..\lib\sentrysupplemental\bin\arm64-v8a\libsentrysupplemental.so" Abi="arm64-v8a" /> |
38 | 74 | <AndroidNativeLibrary Include="..\..\lib\sentrysupplemental\bin\armeabi-v7a\libsentrysupplemental.so" Abi="armeabi-v7a" /> |
|
44 | 80 | <DownloadFile |
45 | 81 | SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-android-core/$(SentryAndroidSdkVersion)/sentry-android-core-$(SentryAndroidSdkVersion).aar" |
46 | 82 | DestinationFolder="$(SentryAndroidSdkDirectory)" |
47 | | - Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-core-$(SentryAndroidSdkVersion).aar')" |
| 83 | + Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-core-$(SentryAndroidSdkVersion).aar') And $(TargetFramework.StartsWith('net8'))" |
48 | 84 | Retries="3" |
49 | 85 | /> |
50 | 86 | <DownloadFile |
51 | 87 | SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-android-ndk/$(SentryAndroidSdkVersion)/sentry-android-ndk-$(SentryAndroidSdkVersion).aar" |
52 | 88 | DestinationFolder="$(SentryAndroidSdkDirectory)" |
53 | | - Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).aar')" |
| 89 | + Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).aar') And $(TargetFramework.StartsWith('net8'))" |
54 | 90 | Retries="3" |
55 | 91 | /> |
56 | 92 | <DownloadFile |
|
59 | 95 | Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).jar')" |
60 | 96 | Retries="3" |
61 | 97 | /> |
| 98 | + <DownloadFile |
| 99 | + SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry/$(SentryAndroidSdkVersion)/sentry-$(SentryAndroidSdkVersion).pom" |
| 100 | + DestinationFolder="$(SentryAndroidSdkDirectory)" |
| 101 | + Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-$(SentryAndroidSdkVersion).pom') And !$(TargetFramework.StartsWith('net8'))" |
| 102 | + Retries="3" |
| 103 | + /> |
| 104 | + |
| 105 | + <!-- The native-ndk exists outside of the android-ndk now. We're downloading the POM file to get the version of the native-ndk. --> |
| 106 | + <DownloadFile |
| 107 | + SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-android-ndk/$(SentryAndroidSdkVersion)/sentry-android-ndk-$(SentryAndroidSdkVersion).pom" |
| 108 | + DestinationFolder="$(SentryAndroidSdkDirectory)" |
| 109 | + Condition="!Exists('$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).pom')" |
| 110 | + Retries="3" |
| 111 | + /> |
| 112 | + |
| 113 | + <XmlPeek |
| 114 | + XmlInputPath="$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).pom" |
| 115 | + Query="//*[local-name()='dependency' and .//*[local-name()='artifactId' and text()='sentry-native-ndk']]/*[local-name()='version']/text()" |
| 116 | + Condition="Exists('$(SentryAndroidSdkDirectory)sentry-android-ndk-$(SentryAndroidSdkVersion).pom')"> |
| 117 | + <Output TaskParameter="Result" PropertyName="SentryNativeNdkVersion" /> |
| 118 | + </XmlPeek> |
| 119 | + |
| 120 | + <DownloadFile |
| 121 | + SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-native-ndk/$(SentryNativeNdkVersion)/sentry-native-ndk-$(SentryNativeNdkVersion).aar" |
| 122 | + DestinationFolder="$(SentryAndroidSdkDirectory)" |
| 123 | + Condition="'$(SentryNativeNdkVersion)' != '' And !Exists('$(SentryAndroidSdkDirectory)sentry-native-ndk-$(SentryNativeNdkVersion).aar') And $(TargetFramework.StartsWith('net8'))" |
| 124 | + Retries="3" |
| 125 | + /> |
| 126 | + |
| 127 | + <ItemGroup Condition="'$(SentryNativeNdkVersion)' != '' And $(TargetFramework.StartsWith('net8'))"> |
| 128 | + <AndroidLibrary Include="$(SentryAndroidSdkDirectory)sentry-native-ndk-$(SentryNativeNdkVersion).aar" /> |
| 129 | + </ItemGroup> |
| 130 | + <ItemGroup Condition="'$(SentryNativeNdkVersion)' != '' And !$(TargetFramework.StartsWith('net8'))"> |
| 131 | + <AndroidMavenLibrary Include="io.sentry:sentry-native-ndk" Version="$(SentryNativeNdkVersion)" /> |
| 132 | + </ItemGroup> |
62 | 133 | </Target> |
63 | 134 |
|
| 135 | + <UsingTask TaskName="XmlPeek" AssemblyName="Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> |
64 | 136 | </Project> |
0 commit comments