Skip to content

Commit

Permalink
Merge pull request #1336 from microsoft/dev/andarno/fixSigning
Browse files Browse the repository at this point in the history
Sign the `GalleryManifest.xml` file
  • Loading branch information
AArnott authored Jul 9, 2024
2 parents a017ea7 + 31d81eb commit c6d4307
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/SosThreadingTools/SosThreadingTools.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,40 @@

<PropertyGroup>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>
<GenerateNuspecDependsOn>StampAndIncludeGalleryManifest;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
</PropertyGroup>

<ItemGroup>
<GalleryManifest Include="$(IntermediateOutputPath)GalleryManifest.xml" Condition="'$(RuntimeIdentifier)'=='win-x64'" />
</ItemGroup>
<ItemGroup>
<FilesToSign Include="$(TargetDir)$(DnneNativeBinaryName).dll">
<StrongName />
</FilesToSign>
<FilesToSign Include="@(GalleryManifest)">
<Authenticode>MicrosoftXmlSHA2</Authenticode>
<StrongName />
</FilesToSign>
</ItemGroup>
<ItemGroup>
<SignFilesDependsOn Include="StampAndIncludeGalleryManifest" />
</ItemGroup>

<Target Name="PackBuildOutputs" DependsOnTargets="DebugSymbolsProjectOutputGroup">
<Target Name="PackBuildOutputs" DependsOnTargets="DebugSymbolsProjectOutputGroup;StampAndIncludeGalleryManifest">
<ItemGroup>
<TfmSpecificPackageFile Include="$(TargetPath)" PackagePath="tools\$(RuntimeIdentifier)\" />
<TfmSpecificPackageFile Include="$(TargetDir)$(TargetName).runtimeconfig.json" PackagePath="tools\$(RuntimeIdentifier)\" />
<TfmSpecificPackageFile Include="@(DebugSymbolsProjectOutputGroupOutput->'%(FinalOutputPath)')" PackagePath="symbols\$(RuntimeIdentifier)\" />
<TfmSpecificPackageFile Include="$(TargetDir)*.dll" PackagePath="tools\$(RuntimeIdentifier)\" />
</ItemGroup>
</Target>
<Target Name="StampAndIncludeGalleryManifest" DependsOnTargets="GetBuildVersion" BeforeTargets="_GetPackageFiles">
<Target Name="StampAndIncludeGalleryManifest" DependsOnTargets="GetBuildVersion" Condition="'@(GalleryManifest)'!=''">
<ReplaceFileText
InputFilename="GalleryManifest.xml"
OutputFilename="$(IntermediateOutputPath)GalleryManifest.xml"
OutputFilename="@(GalleryManifest)"
MatchExpression="\$Version\$"
ReplacementText="$(BuildVersion)" />
<ItemGroup>
<None Include="$(IntermediateOutputPath)GalleryManifest.xml" Pack="true" PackagePath="" />
<TfmSpecificPackageFile Include="@(GalleryManifest)" PackagePath="" />
</ItemGroup>
</Target>
</Project>

0 comments on commit c6d4307

Please sign in to comment.