|
158 | 158 | <SentryCLIUploadSymbolType Include="portablepdb" /> |
159 | 159 | <SentryCLIUploadSymbolType Include="dsym" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'" /> |
160 | 160 | <SentryCLIUploadSymbolType Include="dsym" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'" /> |
| 161 | + <SentryCLIUploadSymbolType Include="elf" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" /> |
161 | 162 | </ItemGroup> |
162 | 163 |
|
163 | 164 | <!-- Upload symbols to Sentry after the build. --> |
164 | 165 | <Target Name="UploadDebugInfoToSentry" AfterTargets="$(SentryCLIUploadAfterTargets)" DependsOnTargets="PrepareSentryCLI" |
165 | 166 | Condition="'$(SentryCLI)' != '' and ('$(SentryUploadSymbols)' == 'true' or '$(SentryUploadSources)' == 'true')"> |
166 | 167 |
|
| 168 | + <!-- For Android, we need to upload native symbols, but there's no point in uploading the intermediary ".dll.so" which just ended up being combined into the final app. --> |
| 169 | + <ItemGroup Condition="'$(IntermediateOutputPath)' != '' and $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'"> |
| 170 | + <AndroidNativeSymbolFiles Include="$(IntermediateOutputPath)**/*.so" /> |
| 171 | + </ItemGroup> |
| 172 | + <ItemGroup> |
| 173 | + <AndroidNativeSymbolFilesExceptDll Include="@(AndroidNativeSymbolFiles)" |
| 174 | + Condition="!$([System.Text.RegularExpressions.Regex]::Match(%(Identity),'.*.dll.so').Success)"/> |
| 175 | + </ItemGroup> |
| 176 | + |
| 177 | + <PropertyGroup> |
| 178 | + <SentryCLIUploadItems>$(SentryCLIUploadDirectory)</SentryCLIUploadItems> |
| 179 | + <SentryCLIUploadItems Condition="'@(AndroidNativeSymbolFilesExceptDll)' != ''">$(SentryCLIUploadItems) @(AndroidNativeSymbolFilesExceptDll -> '%(Identity)', ' ')</SentryCLIUploadItems> |
| 180 | + </PropertyGroup> |
| 181 | + |
167 | 182 | <!-- if (UploadSymbols && UploadSources) { --> |
168 | 183 | <Message Importance="High" |
169 | 184 | Condition="'$(SentryUploadSymbols)' == 'true' and '$(SentryUploadSources)' == 'true'" |
170 | | - Text="Preparing upload to Sentry for project '$(MSBuildProjectName)' ($(Configuration)/$(TargetFramework)): collecting debug symbols and referenced source code from $(SentryCLIUploadDirectory)" /> |
| 185 | + Text="Preparing upload to Sentry for project '$(MSBuildProjectName)' ($(Configuration)/$(TargetFramework)): collecting debug symbols and referenced source code from $(SentryCLIUploadItems)" /> |
171 | 186 | <Exec |
172 | 187 | Condition="'$(SentryUploadSymbols)' == 'true' and '$(SentryUploadSources)' == 'true'" |
173 | | - Command="$(SentryCLIDebugFilesUploadCommand) @(SentryCLIUploadSymbolType -> '-t %(Identity)', ' ') --include-sources $(SentryCLIUploadDirectory)" |
| 188 | + Command="$(SentryCLIDebugFilesUploadCommand) @(SentryCLIUploadSymbolType -> '-t %(Identity)', ' ') --include-sources $(SentryCLIUploadItems)" |
174 | 189 | IgnoreExitCode="true" ContinueOnError="WarnAndContinue"> |
175 | 190 | <Output TaskParameter="ExitCode" PropertyName="_SentryCLIExitCode" /> |
176 | 191 | </Exec> |
177 | 192 | <!-- } else if (UploadSymbols && !UploadSources) { --> |
178 | 193 | <Message Importance="High" |
179 | 194 | Condition="'$(SentryUploadSymbols)' == 'true' and '$(SentryUploadSources)' != 'true'" |
180 | | - Text="Preparing upload to Sentry for project '$(MSBuildProjectName)' ($(Configuration)/$(TargetFramework)): collecting debug symbols from $(SentryCLIUploadDirectory)" /> |
| 195 | + Text="Preparing upload to Sentry for project '$(MSBuildProjectName)' ($(Configuration)/$(TargetFramework)): collecting debug symbols from $(SentryCLIUploadItems)" /> |
181 | 196 | <Exec |
182 | 197 | Condition="'$(SentryUploadSymbols)' == 'true' and '$(SentryUploadSources)' != 'true'" |
183 | | - Command="$(SentryCLIDebugFilesUploadCommand) @(SentryCLIUploadSymbolType -> '-t %(Identity)', ' ') $(SentryCLIUploadDirectory)" |
| 198 | + Command="$(SentryCLIDebugFilesUploadCommand) @(SentryCLIUploadSymbolType -> '-t %(Identity)', ' ') $(SentryCLIUploadItems)" |
184 | 199 | IgnoreExitCode="true" ContinueOnError="WarnAndContinue"> |
185 | 200 | <Output TaskParameter="ExitCode" PropertyName="_SentryCLIExitCode" /> |
186 | 201 | </Exec> |
|
0 commit comments