David McFarland 289fe2c0aa dotnet-sdk: limit code signing to osx targets
This stops the SDK from trying to sign executables for other platforms.

Fixes: #400862
2025-04-27 10:58:15 -03:00

18 lines
1.1 KiB
XML

<Project>
<Target Name="SignAppHost" AfterTargets="_CreateAppHost"
Condition="'$(AppHostIntermediatePath)' != ''
and ($(RuntimeIdentifier.StartsWith('osx')) or $(AppHostRuntimeIdentifier.StartsWith('osx')))">
<Exec Command='@codesign@ -f -s - "$(AppHostIntermediatePath)" 2>&amp;1'/>
</Target>
<Target Name="UnsignBundle" BeforeTargets="GenerateSingleFileBundle"
Condition="'$(PublishedSingleFileName)' != ''
and ($(RuntimeIdentifier.StartsWith('osx')) or $(AppHostRuntimeIdentifier.StartsWith('osx')))">
<Exec Command='@codesign@ --remove-signature "@(FilesToBundle)" 2>&amp;1' Condition="'%(FilesToBundle.RelativePath)' == '$(PublishedSingleFileName)'"/>
</Target>
<Target Name="SignBundle" AfterTargets="GenerateSingleFileBundle"
Condition="'$(PublishedSingleFilePath)' != ''
and ($(RuntimeIdentifier.StartsWith('osx')) or $(AppHostRuntimeIdentifier.StartsWith('osx')))">
<Exec Command='@codesign@ -f -s - "$(PublishedSingleFilePath)" 2>&amp;1'/>
</Target>
</Project>