Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Sentry.Bindings.Android.csproj
  • Loading branch information
jamescrosswell committed Apr 4, 2025
commit c84f27d2549d23c9a3bfa22cc9d51623de8b9642
49 changes: 44 additions & 5 deletions src/Sentry.Bindings.Android/Sentry.Bindings.Android.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- <TargetFrameworks>net8.0-android34.0</TargetFrameworks>-->
<TargetFrameworks>net8.0-android34.0;net9.0-android35.0</TargetFrameworks>
<!-- 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.) -->
<NoWarn>$(NoWarn);BG8605;BG8606</NoWarn>
<SentryAndroidSdkVersion>7.20.1</SentryAndroidSdkVersion>
<SentryAndroidSdkDirectory>$(BaseIntermediateOutputPath)sdks\Sentry\Android\$(SentryAndroidSdkVersion)\</SentryAndroidSdkDirectory>
<SentryAndroidSdkDirectory>$(BaseIntermediateOutputPath)sdks\$(TargetFramework)\Sentry\Android\$(SentryAndroidSdkVersion)\</SentryAndroidSdkDirectory>
<Description>.NET Bindings for the Sentry Android SDK</Description>
</PropertyGroup>

Expand Down Expand Up @@ -47,16 +46,56 @@
<InternalsVisibleTo Include="Sentry.Maui.Tests" PublicKey="$(SentryPublicKey)" />
</ItemGroup>

<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>

<ItemGroup Condition="!$(TargetFramework.StartsWith('net8'))">
<!-- AndroidMavenLibrary include format is {GroupId}:{ArtifactId} -->
<AndroidMavenLibrary Include="io.sentry:sentry" Version="$(SentryAndroidSdkVersion)" />
<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"
/>
</Target>

</Project>
Loading