summaryrefslogtreecommitdiff
path: root/src/sign.builds
diff options
context:
space:
mode:
Diffstat (limited to 'src/sign.builds')
-rw-r--r--src/sign.builds53
1 files changed, 22 insertions, 31 deletions
diff --git a/src/sign.builds b/src/sign.builds
index a8652b3ff4..831fe668c7 100644
--- a/src/sign.builds
+++ b/src/sign.builds
@@ -1,48 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
- <!-- must set the default before importing targets -->
- <PropertyGroup>
- <SignType Condition="'$(SignType)' == ''">test</SignType>
- <StrongNameSig>Silverlight</StrongNameSig>
- </PropertyGroup>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props"/>
<Import Project="..\dir.targets" />
- <!-- OutDir is used by the MicroBuild signing target -->
<PropertyGroup>
+ <!-- The SignFiles target needs OutDir to be defined -->
<OutDir>$(BinDir)</OutDir>
</PropertyGroup>
<UsingTask AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" TaskName="ReadSigningRequired" />
- <!-- apply the default signing certificates (defined in sign.targets) -->
- <ItemDefinitionGroup>
- <FilesToSign>
- <Authenticode>$(AuthenticodeSig)</Authenticode>
- <StrongName>$(StrongNameSig)</StrongName>
- </FilesToSign>
- </ItemDefinitionGroup>
-
- <!-- gather the list of binaries to sign with the default certificates -->
<ItemGroup>
- <FilesToSign Include="$(BinDir)*.dll" Exclude="$(BinDir)*.ni.dll" />
- <FilesToSign Include="$(BinDir)*.exe" />
+ <WindowsNativeLocation Include="$(BinDir)*.dll" />
+ <WindowsNativeLocation Include="$(BinDir)*.exe" />
</ItemGroup>
- <!--
- for some reason the signing task incorrectly attemps to strong-name sign
- native images which causes the signing step to fail for obvious reasons.
- -->
- <ItemGroup>
- <FilesToSign Include="$(BinDir)*.ni.dll">
- <StrongName>None</StrongName>
- </FilesToSign>
- </ItemGroup>
+ <Target Name="GenerateSignForWindowsNative">
+ <!--
+ Managed assemblies should already have a requires_signing file dropped so only generate
+ a requires_signing file for ones that don't exist which should leave just native assembies
+ -->
+ <WriteSigningRequired AuthenticodeSig="$(AuthenticodeSig)"
+ MarkerFile="%(WindowsNativeLocation.Identity).requires_signing"
+ Condition="!Exists('%(WindowsNativeLocation.Identity).requires_signing')" />
+ </Target>
<!-- populates item group FilesToSign with the list of files to sign -->
- <Target Name="GetFilesToSignItems" BeforeTargets="SignFiles">
+ <Target Name="GetFilesToSignItems"
+ DependsOnTargets="GenerateSignForWindowsNative">
<!-- read all of the marker files and populate the FilesToSign item group -->
<ItemGroup>
<SignMarkerFile Include="$(OutDir)**\*.requires_signing" />
@@ -50,10 +36,15 @@
<ReadSigningRequired MarkerFiles="@(SignMarkerFile)">
<Output TaskParameter="SigningMetadata" ItemName="FilesToSign" />
</ReadSigningRequired>
+
+ <Message Importance="High" Text="Attempting to sign %(FilesToSign.Identity) with authenticode='%(FilesToSign.Authenticode)' and strongname='%(FilesToSign.StrongName)'" />
+
</Target>
- <!-- now that signing is done clean up any marker files -->
- <Target Name="CleanUpMarkerFiles" AfterTargets="SignFiles">
+ <Target Name="Build"
+ Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'oss'"
+ DependsOnTargets="GetFilesToSignItems;SignFiles">
+
<!-- now that the files have been signed delete the marker files -->
<Delete Files="@(SignMarkerFile)" />
</Target>