Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…om.Targets to embed SBOM in ICSharpCode.Decompiler NuGet
  • Loading branch information
christophwille committed Dec 4, 2024
1 parent 9986104 commit 2c17f1d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>Copyright 2011-$([System.DateTime]::Now.Year) AlphaSierraPapa</Copyright>
<PackageTags>C# Decompiler ILSpy</PackageTags>
<GenerateSBOM>true</GenerateSBOM>

<NeutralLanguage>en-US</NeutralLanguage>
<GenerateAssemblyVersionAttribute>False</GenerateAssemblyVersionAttribute>
Expand Down Expand Up @@ -74,6 +75,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Sbom.Targets" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Collections.Immutable" Version="6.0.0" />
<PackageReference Include="System.Reflection.Metadata" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
Expand Down Expand Up @@ -701,7 +706,7 @@
<UpdateAssemblyInfoStamp Include="obj\update-assemblyinfo-last-commit-hash.txt" />
</ItemGroup>

<Target Name="ILSpyUpdateAssemblyInfo" BeforeTargets="BeforeBuild">
<Target Name="ILSpyUpdateAssemblyInfo" BeforeTargets="BeforeBuild,GenerateSbomTarget">
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<UpdateAssemblyInfo>powershell -NoProfile -ExecutionPolicy Bypass -File BuildTools/update-assemblyinfo.ps1 $(Configuration)</UpdateAssemblyInfo>
<GitRevParse>git rev-parse HEAD^^{commit}</GitRevParse>
Expand All @@ -720,6 +725,7 @@
<WriteLinesToFile Lines="$(CommitHash)" File="@(UpdateAssemblyInfoStamp)" Overwrite="true" Condition="'$(CommitHash)'!='$(LastCommitHash)'" />
<ReadLinesFromFile ContinueOnError="true" File="..\VERSION">
<Output TaskParameter="Lines" PropertyName="PackageVersion" />
<Output TaskParameter="Lines" PropertyName="SbomGenerationPackageVersion" />
</ReadLinesFromFile>
</Target>

Expand Down

0 comments on commit 2c17f1d

Please sign in to comment.