Skip to content

Commit

Permalink
Bundle dotnet-gcdump in the Sentry nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell committed Oct 10, 2024
1 parent 5ceff11 commit ae55ae9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ mono_crash.*.json
test_output/
test/**/*.apk
/tools/
src/Sentry/tools/
*.log
.sentry-native
10 changes: 10 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@
<SentryCLIDirectory>$(MSBuildThisFileDirectory)tools\sentry-cli\$(SentryCLIVersion)\</SentryCLIDirectory>
</PropertyGroup>

<!-- Set the version and local path for dotnet-gcdump (downloaded in the restore phase of Sentry.csproj). -->
<PropertyGroup>
<GCDumpVersion>8.0.547301</GCDumpVersion>
<GCDumpDirectory>$(MSBuildThisFileDirectory)tools\gcdump\</GCDumpDirectory>
<GCDumpTempDirectory>$(GCDumpDirectory)\$(GCDumpVersion)\</GCDumpTempDirectory>
<!-- Where the relevant files are stored in the dotnet-gcdump Nuget package -->
<GCDumpIncludeFiles>$(GCDumpTempDirectory).store\dotnet-gcdump\$(GCDumpVersion)\dotnet-gcdump\$(GCDumpVersion)\tools\net6.0\any\</GCDumpIncludeFiles>
<GCDumpZip>$(GCDumpDirectory)dotnet-gcdump-$(GCDumpVersion).zip</GCDumpZip>
</PropertyGroup>

<!-- Public key of .assets/Sentry.snk - not a secret. Used by other InternalsVisibleTo entries throughout the solution. -->
<PropertyGroup>
<SentryPublicKey>002400000480000094000000060200000024000052534131000400000100010059964a931488bcdbd14657f1ee0df32df61b57b3d14d7290c262c2cc9ddaad6ec984044f761f778e1823049d2cb996a4f58c8ea5b46c37891414cb34b4036b1c178d7b582289d2eef3c0f1e9b692c229a306831ee3d371d9e883f0eb0f74aeac6c6ab8c85fd1ec04b267e15a31532c4b4e2191f5980459db4dce0081f1050fb8</SentryPublicKey>
Expand Down
8 changes: 4 additions & 4 deletions src/Sentry/Sentry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@
<!-- NuGet doesn't have any "download" functionality, so we'll install it locally to a temporary folder -->
<Exec Command="dotnet tool install dotnet-gcdump --version $(GCDumpVersion) --tool-path $(GCDumpTempDirectory)" />
<!-- Compress the tool files -->
<Exec Command="zip -r $(GCDumpZip) $(GCDumpIncludeFiles)" />
<ZipDirectory SourceDirectory="$(GCDumpIncludeFiles)" DestinationFile="$(GCDumpZip)" />
<!-- Clean up tool files after zipping -->
<Exec Command="dotnet tool uninstall dotnet-gcdump --tool-path $(GCDumpTempDirectory)" />
<RemoveDir Directories="$(GCDumpTempDirectory)\" />
<RemoveDir Directories="$(GCDumpTempDirectory)" />
</Target>

<!-- Bundle the Sentry CLI into the Sentry Nuget package. -->
<ItemGroup Condition="'$(GCDumpDirectory)' != ''">
<None Include="$(GCDumpDirectory)**" Pack="true" PackagePath="tools\" />
<ItemGroup Condition="Exists('$(GCDumpZip)')">
<None Include="$(GCDumpZip)" Pack="true" PackagePath="tools\dotnet-gcdump.zip" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ae55ae9

Please sign in to comment.