Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Update signing.targets to disable full signing on unix
Browse files Browse the repository at this point in the history
Issue dotnet/roslyn#8210 blocks signing
on unix, but we still need to have the assemblies have the correct
identity so we are simply turning on DelaySigning for those assemblies.
  • Loading branch information
weshaggard committed Feb 14, 2017
1 parent c49f4c4 commit 4d47c2d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Tools-Override/sign.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,29 @@

<UsingTask AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" TaskName="OpenSourceSign" />
<UsingTask AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" TaskName="WriteSigningRequired" />

<PropertyGroup Condition="'$(SkipSigning)'!='true'">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile Condition="'$(AssemblyOriginatorKeyFile)' == ''">$(ToolsDir)MSFT.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile Condition="'$(UseECMAKey)' == 'true'">$(ToolsDir)ECMA.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile Condition="'$(UseOpenKey)' == 'true'">$(ToolsDir)Open.snk</AssemblyOriginatorKeyFile>

<!-- Don't sign test assemblies with the Microsoft Key, as this affects APIs checking if the test assembly is an MS Key -->
<AssemblyOriginatorKeyFile Condition="'$(IsTestProject)' == 'true'">$(ToolsDir)Test.snk</AssemblyOriginatorKeyFile>

<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<DelaySign Condition="'$(UseOpenKey)' == 'true'">false</DelaySign>

<!-- For full keys we should disable delay signing -->
<FullPublicPrivateKey Condition="'$(AssemblyOriginatorKeyFile)' == '$(ToolsDir)Open.snk'">true</FullPublicPrivateKey>
<FullPublicPrivateKey Condition="'$(AssemblyOriginatorKeyFile)' == '$(ToolsDir)Test.snk'">true</FullPublicPrivateKey>

<DelaySign Condition="'$(FullPublicPrivateKey)' == 'true'">false</DelaySign>

<!--
We enable the signing for the test projects only on Windows because Roslyn not supporting full signing on non-Windows platforms.
Issue: https://github.com/dotnet/roslyn/issues/8210
Setting DelaySign to true when running build on unix because of Roslyn doesn't support full signing on non-windows.
See issue https://github.com/dotnet/roslyn/issues/8210.
-->
<DelaySign Condition="'$(OSEnvironment)' == 'Windows_NT' And '$(IsTestProject)' == 'true'">false</DelaySign>

<SignType Condition="'$(SignType)'=='' And '$(UseOpenKey)' == 'true'">real</SignType>
<SignType Condition="'$(SignType)'=='' And '$(IsTestProject)' == 'true'">real</SignType>
<DelaySign Condition="'$(RunningOnUnix)' == 'true'">true</DelaySign>

<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
<!-- applicable values for SignType are oss, test or real -->
Expand All @@ -40,7 +43,7 @@
<!-- writes a signing marker file containing the required signatures -->
<Target Name="WriteSigningRequired"
AfterTargets="AfterBuild"
Condition="'$(SkipSigning)' != 'true' and '$(IsTestProject)' != 'true' and '$(SignType)' != 'oss'"
Condition="'$(SkipSigning)' != 'true' and '$(FullPublicPrivateKey)' != 'true' and '$(SignType)' != 'oss'"
Inputs="$(TargetPath)"
Outputs="$(TargetPath).requires_signing">
<WriteSigningRequired AuthenticodeSig="$(AuthenticodeSig)"
Expand Down

0 comments on commit 4d47c2d

Please sign in to comment.