|
18 | 18 |
|
19 | 19 | <PropertyGroup> |
20 | 20 | <SentryAttributesFile>Sentry.Attributes$(MSBuildProjectExtension.Replace('proj', ''))</SentryAttributesFile> |
| 21 | + <SentryProGuardUUID Condition="'$(SentryProGuardUUID)' == ''">$([System.Guid]::NewGuid())</SentryProGuardUUID> |
21 | 22 | </PropertyGroup> |
22 | 23 |
|
23 | 24 | <Target Name="_SentryEnsureAndroidEnableAssemblyCompressionDisabled" |
|
68 | 69 | We're explicitly skipping uploads for Sentry projects because they interfere with CLI integration test asserts. --> |
69 | 70 | <UseSentryCLI Condition=" |
70 | 71 | '$(UseSentryCLI)' == '' |
71 | | - and ('$(SentryUploadSymbols)' == 'true' or '$(SentryUploadSources)' == 'true' or $(SentryUploadAndroidProguardMapping) == 'true' or $(SentryCreateRelease) == 'true' or $(SentrySetCommits) == 'true') |
| 72 | + and ('$(SentryUploadSymbols)' == 'true' or '$(SentryUploadSources)' == 'true' or $(SentryUploadAndroidProGuardMapping) == 'true' or $(SentryCreateRelease) == 'true' or $(SentrySetCommits) == 'true') |
72 | 73 | and '$(MSBuildProjectName)' != 'Sentry' |
73 | 74 | and !$(MSBuildProjectName.StartsWith('Sentry.'))">true</UseSentryCLI> |
74 | 75 | </PropertyGroup> |
|
125 | 126 | <SentrySetCommitReleaseOptions Condition="'$(SentryOrg)' != ''">$(SentrySetCommitReleaseOptions) --org $(SentryOrg)</SentrySetCommitReleaseOptions> |
126 | 127 | <SentrySetCommitReleaseOptions Condition="'$(SentryProject)' != ''">$(SentrySetCommitReleaseOptions) --project $(SentryProject)</SentrySetCommitReleaseOptions> |
127 | 128 |
|
| 129 | + <_SentryCLIProGuardOptions Condition="'$(SentryProGuardUUID)' != ''">$(_SentryCLIProGuardOptions) --uuid "$(SentryProGuardUUID)"</_SentryCLIProGuardOptions> |
| 130 | + <_SentryCLIProGuardOptions Condition="'$(_SentryCLIProGuardOptions.Trim())' != ''">$(_SentryCLIProGuardOptions.Trim())</_SentryCLIProGuardOptions> |
| 131 | + |
128 | 132 | <SentryCLIUploadOptions Condition="'$(SentryOrg)' != ''">$(SentryCLIUploadOptions) --org $(SentryOrg)</SentryCLIUploadOptions> |
129 | 133 | <SentryCLIUploadOptions Condition="'$(SentryProject)' != ''">$(SentryCLIUploadOptions) --project $(SentryProject)</SentryCLIUploadOptions> |
130 | 134 | <SentryCLIDebugFilesUploadCommand>$(SentryCLIBaseCommand) debug-files upload</SentryCLIDebugFilesUploadCommand> |
131 | 135 | <SentryCLIDebugFilesUploadCommand Condition="'$(SentryCLIUploadOptions.Trim())' != ''">$(SentryCLIDebugFilesUploadCommand) $(SentryCLIUploadOptions.Trim())</SentryCLIDebugFilesUploadCommand> |
132 | | - <SentryCLIProGuardMappingUploadCommand>$(SentryCLIBaseCommand) upload-proguard</SentryCLIProGuardMappingUploadCommand> |
| 136 | + <SentryCLIProGuardMappingUploadCommand>$(SentryCLIBaseCommand) upload-proguard $(_SentryCLIProGuardOptions)</SentryCLIProGuardMappingUploadCommand> |
133 | 137 | <SentryCLIProGuardMappingUploadCommand Condition="'$(SentryCLIUploadOptions.Trim())' != ''">$(SentryCLIProGuardMappingUploadCommand) $(SentryCLIUploadOptions.Trim())</SentryCLIProGuardMappingUploadCommand> |
134 | 138 | </PropertyGroup> |
135 | 139 |
|
|
267 | 271 | <Warning Condition="'$(_SentryCLIExitCode)' != '0'" Text="Sentry CLI could not upload debug files." /> |
268 | 272 | </Target> |
269 | 273 |
|
270 | | - <!-- Upload Android Proguard mapping file to Sentry after the build. --> |
271 | | - <Target Name="UploadAndroidProguardMappingFileToSentry" AfterTargets="Build" DependsOnTargets="PrepareSentryCLI" |
272 | | - Condition="'$(SentryCLI)' != '' and '$(SentryUploadAndroidProguardMapping)' == 'true' And '$(AndroidProguardMappingFile)' != ''"> |
| 274 | + <Target Name="UpdateAndroidMetadata" BeforeTargets="GetAssemblyAttributes" |
| 275 | + Condition=" |
| 276 | + $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android' |
| 277 | + and '$(SentryUploadAndroidProGuardMapping)' == 'true'"> |
| 278 | + |
| 279 | + <ItemGroup> |
| 280 | + <AssemblyAttribute Include="Android.App.MetaData"> |
| 281 | + <_Parameter1>io.sentry.proguard-uuid</_Parameter1> |
| 282 | + <Value>$(SentryProGuardUUID)</Value> |
| 283 | + </AssemblyAttribute> |
| 284 | + </ItemGroup> |
| 285 | + </Target> |
| 286 | + |
| 287 | + <!-- Upload Android ProGuard mapping file to Sentry after the build. --> |
| 288 | + <Target Name="UploadAndroidProGuardMappingFileToSentry" AfterTargets="Build" DependsOnTargets="PrepareSentryCLI" |
| 289 | + Condition="'$(SentryCLI)' != '' and '$(SentryUploadAndroidProGuardMapping)' == 'true' And '$(AndroidProguardMappingFile)' != ''"> |
273 | 290 |
|
274 | 291 | <Message Importance="High" Text="Preparing to upload Android Proguard mapping to Sentry for '$(MSBuildProjectName)': $(AndroidProguardMappingFile))" /> |
275 | 292 |
|
|
0 commit comments