Xamarin Public Jenkins (auto-signing) e2950ec768 Imported Upstream version 5.10.0.69
Former-commit-id: fc39669a0b707dd3c063977486506b6793da2890
2018-01-29 19:03:06 +00:00

47 lines
1.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
<Import Project="..\dir.targets" />
<PropertyGroup>
<!-- The SignFiles target needs OutDir to be defined -->
<OutDir>$(BinDir)</OutDir>
</PropertyGroup>
<UsingTask AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" TaskName="ReadSigningRequired" />
<ItemGroup>
<WindowsNativeLocation Include="$(NativeBinDir)\clrcompression.dll" />
<WindowsNativeLocation Include="$(NativeBinDir)_aot\clrcompression.dll" />
</ItemGroup>
<Target Name="GenerateSignForWindowsNative">
<WriteSigningRequired AuthenticodeSig="$(AuthenticodeSig)"
MarkerFile="%(WindowsNativeLocation.Identity).requires_signing" />
</Target>
<!-- populates item group FilesToSign with the list of files to sign -->
<Target Name="GetFilesToSignItems"
DependsOnTargets="GenerateSignForWindowsNative">
<!-- read all of the marker files and populate the FilesToSign item group -->
<ItemGroup>
<!-- Note: this also looks for things under bin\obj which require signing like the shims -->
<SignMarkerFile Include="$(OutDir)**\*.requires_signing" />
</ItemGroup>
<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>
<Target Name="Build"
Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'public'"
DependsOnTargets="GetFilesToSignItems;SignFiles">
<!-- now that the files have been signed delete the marker files -->
<Delete Files="@(SignMarkerFile)" />
</Target>
</Project>