Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for Sentry CLI integration #2145

Merged
merged 9 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Features

- Publish `Sentry.Android.AssemblyReader` as a separate nuget package (for reuse by `Sentry.Xamarin`) ([#2127](https://github.com/getsentry/sentry-dotnet/pull/2127))
- Improvements for Sentry CLI integration ([#2145](https://github.com/getsentry/sentry-dotnet/pull/2145))

## 3.26.2

Expand Down
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<!-- Configure Sentry CLI -->
<SentryOrg>sentry-sdks</SentryOrg>
<SentryProject>sentry-dotnet</SentryProject>
<SentryUploadSources>true</SentryUploadSources>
mattjohnsonpint marked this conversation as resolved.
Show resolved Hide resolved

</PropertyGroup>

Expand Down Expand Up @@ -66,7 +67,7 @@

<!-- Set the version and local path for Sentry CLI (downloaded in the restore phase of Sentry.csproj) -->
<PropertyGroup Condition="'$(SolutionName)' != 'Sentry.Unity'">
<SentryCLIVersion>2.11.0</SentryCLIVersion>
<SentryCLIVersion>2.12.0</SentryCLIVersion>
<SentryCLIDirectory>$(MSBuildThisFileDirectory)tools\sentry-cli\$(SentryCLIVersion)\</SentryCLIDirectory>
</PropertyGroup>

Expand Down
14 changes: 7 additions & 7 deletions src/Sentry/Sentry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@
Update with each new version.
-->
<ItemGroup>
<SentryCLIDownload Include="sentry-cli-Darwin-arm64" FileHash="fbefb40a8e5ce29f82e0f7195e84f569dbeaaae07cdc1f983f5f3418fd9a376d" />
<SentryCLIDownload Include="sentry-cli-Darwin-x86_64" FileHash="d55ee5636d12bd193a4f526ab426e6af6273bec5bc2dc22e81dc8357d6e039eb" />
<SentryCLIDownload Include="sentry-cli-Linux-aarch64" FileHash="c62c5c1259307611e78af4f24a4c30162cff8adb0f021d363b307c42cded5c70" />
<SentryCLIDownload Include="sentry-cli-Linux-i686" FileHash="25c5e7e6d978d1e66bc26c9e4282633135a318ed0ac36cb73b4fa58f59fcb089" />
<SentryCLIDownload Include="sentry-cli-Linux-x86_64" FileHash="bc8f5f223fa688b3ad963c60a729f02aa8f5b17525de66fb3abf86800977ff6e" />
<SentryCLIDownload Include="sentry-cli-Windows-i686.exe" FileHash="2bb96fc94ea749e24cd607f48750b121572a3fb4b3f9499f63a996f83c56ef2b" />
<SentryCLIDownload Include="sentry-cli-Windows-x86_64.exe" FileHash="7b70536177419dcd2fdb2c823422290abfe25180ffa3beae000fb3c9b1473c1f"/>
<SentryCLIDownload Include="sentry-cli-Darwin-arm64" FileHash="49f2d51c169ee46b4dcdad4913cac5a72fd7c25a1e55423ef62035ce7d1dec22" />
<SentryCLIDownload Include="sentry-cli-Darwin-x86_64" FileHash="47ae7f2145dc9a50156b815f2db241c44282fcc8173bf7b43897492d1eb3f3d5" />
<SentryCLIDownload Include="sentry-cli-Linux-aarch64" FileHash="4b9e88a1925dd09c706c2263d2d671682bc4b2f146f2ee12670ec7fe6cd51f1d" />
<SentryCLIDownload Include="sentry-cli-Linux-i686" FileHash="624aa49b839d052d95eba156ae465a459f4fb0d9509c7497909eec0bab2171db" />
<SentryCLIDownload Include="sentry-cli-Linux-x86_64" FileHash="ab6723a84675bc7d11bbf4f723511150af0c58e10c1c1dafb8210837d2a97673" />
<SentryCLIDownload Include="sentry-cli-Windows-i686.exe" FileHash="bf90b9a411f9cef7cfce72cfe4a24595b4fbc125e40fb67eaaa702cfc4d347d0" />
<SentryCLIDownload Include="sentry-cli-Windows-x86_64.exe" FileHash="138d3cd500d69a07b0548f15d297139c5f0d6604c4c806b54596abe14895bdf2"/>
</ItemGroup>

<!-- Download the files -->
Expand Down
22 changes: 16 additions & 6 deletions src/Sentry/buildTransitive/Sentry.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
</WriteCodeFragment>
</Target>

<Target Name="CheckSentryCLI" AfterTargets="DispatchToInnerBuilds;AfterBuild">
<Target Name="CheckSentryCLI" AfterTargets="Build" Condition="'$(TargetFramework)' != ''">
<PropertyGroup>
<!-- This property controls whether symbols are to be sent to Sentry. -->
<SentryUploadSymbols Condition="'$(SentryUploadSymbols)' == '' And '$(Configuration)' == 'Release' And '$(DebugType)' != 'embedded'">true</SentryUploadSymbols>
<SentryUploadSymbols Condition="'$(SentryUploadSymbols)' == '' And '$(Configuration)' == 'Release'">true</SentryUploadSymbols>

<!-- This property controls if the Sentry CLI is to be used at all. Setting false will disable all Sentry CLI usage. -->
<UseSentryCLI Condition="'$(UseSentryCLI)' == '' And ('$(SentryUploadSymbols)' == 'true')">true</UseSentryCLI>
Expand Down Expand Up @@ -94,10 +94,20 @@
</PropertyGroup>
</Target>

<!-- 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="&quot;$(SentryCLI)&quot; upload-dif $(SentryCLIOptions) $(IntermediateOutputPath)" />
<!-- Upload debug information files to Sentry after the build. -->
<Target Name="UploadSymbolsToSentry" AfterTargets="Build;Publish" DependsOnTargets="PrepareSentryCLI" Condition="'$(SentryUploadSymbols)' == 'true' And '$(SentryCLI)' != ''">

<Message Importance="High" Condition="'$(SentryUploadSources)' != 'true'"
Text="Preparing to upload debug symbols to Sentry for $(MSBuildProjectName) ($(Configuration)/$(TargetFramework))" />

<Message Importance="High" Condition="'$(SentryUploadSources)' == 'true'"
mattjohnsonpint marked this conversation as resolved.
Show resolved Hide resolved
Text="Preparing to upload debug symbols and sources to Sentry for $(MSBuildProjectName) ($(Configuration)/$(TargetFramework))" />

<PropertyGroup Condition="'$(SentryUploadSources)' == 'true'">
<_SentryUploadOptions>--include-sources</_SentryUploadOptions>
</PropertyGroup>

<Exec Command="&quot;$(SentryCLI)&quot; upload-dif $(_SentryUploadOptions) $(SentryCLIOptions) $(IntermediateOutputPath)" />
</Target>

</Project>