Skip to content

Commit

Permalink
Fix cli integration on Windows (#2123)
Browse files Browse the repository at this point in the history
* Fix cli integration on Windows

* Update CHANGELOG.md
  • Loading branch information
mattjohnsonpint authored Jan 24, 2023
1 parent d8decce commit 9747a78
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Fix Sentry CLI integration on Windows ([#2123](https://github.com/getsentry/sentry-dotnet/pull/2123))

## 3.26.1

### Fixes
Expand Down
14 changes: 7 additions & 7 deletions src/Sentry/buildTransitive/Sentry.targets
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<SentryCLIOptions Condition="'$(SentryApiKey)' != ''">$(SentryCLIOptions) --api-key $(SentryApiKey)</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryAuthToken)' != ''">$(SentryCLIOptions) --auth-token $(SentryAuthToken)</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryUrl)' != ''">$(SentryCLIOptions) --url $(SentryUrl)</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryOrg)' != ''">$(SentryCLIOptions) --org '$(SentryOrg)'</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryProject)' != ''">$(SentryCLIOptions) --project '$(SentryProject)'</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryOrg)' != ''">$(SentryCLIOptions) --org &quot;$(SentryOrg)</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryProject)' != ''">$(SentryCLIOptions) --project &quot;$(SentryProject)&quot;</SentryCLIOptions>

<!-- Sentry CLI comes from the Sentry Nuget package when installed. -->
<SentryCLIDirectory Condition="'$(SentryCLIDirectory)' == '' And '$(PkgSentry)' != ''">$(PkgSentry)\tools\</SentryCLIDirectory>
Expand All @@ -67,16 +67,16 @@
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Linux')) And $(_OSArchitecture) == 'Arm64'">$(SentryCLIDirectory)sentry-cli-Linux-aarch64</SentryCLI>
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Linux')) And $(_OSArchitecture) == 'X86'">$(SentryCLIDirectory)sentry-cli-Linux-i686</SentryCLI>
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Linux')) And $(_OSArchitecture) == 'X64'">$(SentryCLIDirectory)sentry-cli-Linux-x86_64</SentryCLI>
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Windows')) And $(_OSArchitecture) == 'Arm64'">$(SentryCLIDirectory)sentry-cli-Windows-x86_64</SentryCLI>
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Windows')) And $(_OSArchitecture) == 'X86'">$(SentryCLIDirectory)sentry-cli-Windows-i686</SentryCLI>
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Windows')) And $(_OSArchitecture) == 'X64'">$(SentryCLIDirectory)sentry-cli-Windows-x86_64</SentryCLI>
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Windows')) And $(_OSArchitecture) == 'Arm64'">$(SentryCLIDirectory)sentry-cli-Windows-x86_64.exe</SentryCLI>
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Windows')) And $(_OSArchitecture) == 'X86'">$(SentryCLIDirectory)sentry-cli-Windows-i686.exe</SentryCLI>
<SentryCLI Condition="$([MSBuild]::IsOSPlatform('Windows')) And $(_OSArchitecture) == 'X64'">$(SentryCLIDirectory)sentry-cli-Windows-x86_64.exe</SentryCLI>
<SentryCLI Condition="!Exists('$(SentryCLI)')"/>
</PropertyGroup>

<PropertyGroup>
<_SentryCLIInfoOptions Condition="'$(SentryOrg)' != '' And '$(SentryProject)' != ''">--no-defaults</_SentryCLIInfoOptions>
</PropertyGroup>
<Exec Command="'$(SentryCLI)' info $(_SentryCLIInfoOptions)" Condition="'$(SentryCLI)' != ''" IgnoreExitCode="true" ConsoleToMsBuild="true" StandardOutputImportance="Low">
<Exec Command="&quot;$(SentryCLI)&quot; info $(_SentryCLIInfoOptions)" Condition="'$(SentryCLI)' != ''" IgnoreExitCode="true" ConsoleToMsBuild="true" StandardOutputImportance="Low">
<Output TaskParameter="ExitCode" PropertyName="SentryCLIExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="SentryCLIOutput" />
</Exec>
Expand All @@ -97,7 +97,7 @@
<!-- Upload symbols (and any other debug information files) to Sentry after the build. -->
<Target Name="UploadSymbolsToSentry" AfterTargets="AfterBuild" DependsOnTargets="PrepareSentryCLI" Condition="'$(SentryUploadSymbols)' == 'true' And '$(SentryCLI)' != ''">
<Message Importance="High" Text="Preparing to upload debug symbols to Sentry for $(MSBuildProjectName) ($(Configuration)/$(TargetFramework))" />
<Exec Command="'$(SentryCLI)' upload-dif $(SentryCLIOptions) '$(IntermediateOutputPath)'" />
<Exec Command="&quot;$(SentryCLI)&quot; upload-dif $(SentryCLIOptions) &quot;$(IntermediateOutputPath)&quot;" />
</Target>

</Project>

0 comments on commit 9747a78

Please sign in to comment.