|
3 | 3 | <TargetFrameworks>$(LatestAndroidTfm);$(PreviousAndroidTfm)</TargetFrameworks> |
4 | 4 | <SentryAndroidSdkVersion>8.29.0</SentryAndroidSdkVersion> |
5 | 5 | <SentryAndroidSdkDirectory>$(BaseIntermediateOutputPath)sdks\$(TargetFramework)\Sentry\Android\$(SentryAndroidSdkVersion)\</SentryAndroidSdkDirectory> |
6 | | - <!-- This gets resolved by the DownloadSentryAndroidSdk target --> |
| 6 | + <!-- This gets resolved by the DownloadSentryAndroidSdk unless using local maven references --> |
7 | 7 | <SentryNativeNdkVersion></SentryNativeNdkVersion> |
8 | 8 | <Description>.NET Bindings for the Sentry Android SDK</Description> |
9 | 9 |
|
| 10 | + <!-- |
| 11 | + Optional dev override: enable to resolve local maven references |
| 12 | + Example: |
| 13 | + dotnet build -p:UseLocalSentryMavenRepo=true |
| 14 | +
|
| 15 | + To populate MavenLocal from your checkout: |
| 16 | + cd $(LocalSentryJavaRepoDir) && ./gradlew publishToMavenLocal |
| 17 | + cd $(LocalSentryNativeRepoDir)/ndk && ./gradlew publishToMavenLocal |
| 18 | +
|
| 19 | + Note: |
| 20 | + 1. Make sure the native-ndk-version you check out and build matches what the android sdk expects (or a fork of it) |
| 21 | + 2. You will need to manually set the `SentryNativeNdkVersion` property as this no longer gets resolved from |
| 22 | + the POM files from the Java SDK when using local maven artifacts. |
| 23 | + --> |
| 24 | + <UseLocalSentryMavenRepo>false</UseLocalSentryMavenRepo> |
| 25 | + <LocalSentryMavenRepoDir Condition="'$(LocalSentryMavenRepoDir)' == ''">$([System.Environment]::GetFolderPath(SpecialFolder.UserProfile))/.m2/repository/</LocalSentryMavenRepoDir> |
| 26 | + <LocalSentryJarPath>$(LocalSentryMavenRepoDir)io/sentry/sentry/$(SentryAndroidSdkVersion)/sentry-$(SentryAndroidSdkVersion).jar</LocalSentryJarPath> |
| 27 | + <LocalSentryAndroidCoreAarPath>$(LocalSentryMavenRepoDir)io/sentry/sentry-android-core/$(SentryAndroidSdkVersion)/sentry-android-core-$(SentryAndroidSdkVersion).aar</LocalSentryAndroidCoreAarPath> |
| 28 | + <LocalSentryAndroidNdkAarPath>$(LocalSentryMavenRepoDir)io/sentry/sentry-android-ndk/$(SentryAndroidSdkVersion)/sentry-android-ndk-$(SentryAndroidSdkVersion).aar</LocalSentryAndroidNdkAarPath> |
| 29 | + <LocalSentryAndroidReplayAarPath>$(LocalSentryMavenRepoDir)io/sentry/sentry-android-replay/$(SentryAndroidSdkVersion)/sentry-android-replay-$(SentryAndroidSdkVersion).aar</LocalSentryAndroidReplayAarPath> |
| 30 | + <LocalSentryPomPath>$([System.String]::Copy($(LocalSentryJarPath)).Replace('.jar', '.pom'))</LocalSentryPomPath> |
| 31 | + <LocalSentryAndroidCorePomPath>$([System.String]::Copy($(LocalSentryAndroidCoreAarPath)).Replace('.aar', '.pom'))</LocalSentryAndroidCorePomPath> |
| 32 | + <LocalSentryAndroidNdkPomPath>$([System.String]::Copy($(LocalSentryAndroidNdkAarPath)).Replace('.aar', '.pom'))</LocalSentryAndroidNdkPomPath> |
| 33 | + <LocalSentryAndroidReplayPomPath>$([System.String]::Copy($(LocalSentryAndroidReplayAarPath)).Replace('.aar', '.pom'))</LocalSentryAndroidReplayPomPath> |
| 34 | + <LocalSentryNativeNdkAarPath>$(LocalSentryMavenRepoDir)io/sentry/sentry-native-ndk/$(SentryNativeNdkVersion)/sentry-native-ndk-$(SentryNativeNdkVersion).aar</LocalSentryNativeNdkAarPath> |
| 35 | + <LocalSentryNativeNdkPomPath>$([System.String]::Copy($(LocalSentryNativeNdkAarPath)).Replace('.aar', '.pom'))</LocalSentryNativeNdkPomPath> |
| 36 | + |
10 | 37 | <!-- Android binding warnings - these are largely unavoidable due to Java interface circular dependencies --> |
11 | 38 | <!-- Only suppress warnings that are confirmed to be expected/unavoidable --> |
12 | 39 | <!-- BG8801: Invalid parameter types - caused by circular interface dependencies in Sentry Java SDK --> |
|
73 | 100 | </ItemGroup> |
74 | 101 |
|
75 | 102 | <!-- Starting with .NET 9 we can detect Java dependencies using POM files and AndroidMavenLibrary references --> |
76 | | - <ItemGroup> |
| 103 | + <ItemGroup Condition="'$(UseLocalSentryMavenRepo)' != 'true'"> |
77 | 104 | <AndroidMavenLibrary Include="io.sentry:sentry" Version="$(SentryAndroidSdkVersion)" /> |
78 | 105 | <AndroidMavenLibrary Include="io.sentry:sentry-android-core" Version="$(SentryAndroidSdkVersion)" /> |
79 | 106 | <AndroidMavenLibrary Include="io.sentry:sentry-android-ndk" Version="$(SentryAndroidSdkVersion)" /> |
80 | 107 | <AndroidMavenLibrary Include="io.sentry:sentry-android-replay" Version="$(SentryAndroidSdkVersion)" /> |
81 | 108 | </ItemGroup> |
82 | 109 |
|
| 110 | + <!-- Resolve Java dependencies from local sentry-java build outputs instead, if appropriate --> |
| 111 | + <ItemGroup Condition="'$(UseLocalSentryMavenRepo)' == 'true'"> |
| 112 | + <AndroidLibrary Include="$(LocalSentryJarPath)" Manifest="$(LocalSentryPomPath)" |
| 113 | + JavaArtifact="io.sentry:sentry:$(SentryAndroidSdkVersion)" /> |
| 114 | + <AndroidLibrary Include="$(LocalSentryAndroidCoreAarPath)" Manifest="$(LocalSentryAndroidCorePomPath)" |
| 115 | + JavaArtifact="io.sentry:sentry-android-core:$(SentryAndroidSdkVersion)" /> |
| 116 | + <AndroidLibrary Include="$(LocalSentryAndroidNdkAarPath)" Manifest="$(LocalSentryAndroidNdkPomPath)" |
| 117 | + JavaArtifact="io.sentry:sentry-android-ndk:$(SentryAndroidSdkVersion)" /> |
| 118 | + <AndroidLibrary Include="$(LocalSentryAndroidReplayAarPath)" Manifest="$(LocalSentryAndroidReplayPomPath)" |
| 119 | + JavaArtifact="io.sentry:sentry-android-replay:$(SentryAndroidSdkVersion)" /> |
| 120 | + <AndroidLibrary Include="$(LocalSentryNativeNdkAarPath)" Manifest="$(LocalSentryNativeNdkPomPath)" |
| 121 | + JavaArtifact="io.sentry:sentry-native-ndk:$(SentryNativeNdkVersion)" /> |
| 122 | + </ItemGroup> |
| 123 | + |
83 | 124 | <ItemGroup> |
84 | 125 | <AndroidLibrary Include="..\..\lib\sentry-android-supplemental\bin\sentry-android-supplemental.jar" /> |
85 | 126 | <AndroidNativeLibrary Include="..\..\lib\sentrysupplemental\bin\arm64-v8a\libsentrysupplemental.so" Abi="arm64-v8a" /> |
|
88 | 129 | <AndroidNativeLibrary Include="..\..\lib\sentrysupplemental\bin\x86_64\libsentrysupplemental.so" Abi="x86_64" /> |
89 | 130 | </ItemGroup> |
90 | 131 |
|
91 | | - <Target Name="DownloadSentryAndroidSdk" BeforeTargets="CollectPackageReferences"> |
| 132 | + <Target Name="DownloadSentryAndroidSdk" BeforeTargets="CollectPackageReferences" Condition="'$(UseLocalSentryMavenRepo)' != 'true'"> |
92 | 133 | <!-- The native-ndk exists outside of the android-ndk now. We're downloading the POM file to get the version of the native-ndk. --> |
93 | 134 | <DownloadFile |
94 | 135 | SourceUrl="https://repo1.maven.org/maven2/io/sentry/sentry-android-ndk/$(SentryAndroidSdkVersion)/sentry-android-ndk-$(SentryAndroidSdkVersion).pom" |
|
0 commit comments