You've already forked linux-packaging-mono
81 lines
4.1 KiB
XML
81 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup>
|
|
<AuthenticodeSig Condition="'$(AuthenticodeSig)' == ''">Microsoft</AuthenticodeSig>
|
|
<StrongNameSig Condition="'$(StrongNameSig)' == '' and '$(SignType)' == 'real' and '$(UseOpenKey)' != 'true'">StrongName</StrongNameSig>
|
|
</PropertyGroup>
|
|
|
|
<UsingTask AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" TaskName="OpenSourceSign" />
|
|
<UsingTask AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" TaskName="WriteSigningRequired" />
|
|
|
|
<PropertyGroup Condition="'$(SkipSigning)'!='true'">
|
|
<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>
|
|
|
|
<!-- 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>
|
|
|
|
<!--
|
|
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="'$(RunningOnUnix)' == 'true'">true</DelaySign>
|
|
|
|
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
|
|
<!-- applicable values for SignType are oss, test or real -->
|
|
<SignType Condition="'$(SignType)' == ''">oss</SignType>
|
|
</PropertyGroup>
|
|
|
|
<!-- stub for signing. for official builds this is replaced with the real one -->
|
|
<Target Name="SignFiles" AfterTargets="AfterBuild" />
|
|
|
|
<!-- writes a signing marker file containing the required signatures -->
|
|
<Target Name="WriteSigningRequired"
|
|
AfterTargets="AfterBuild"
|
|
Condition="'$(SkipSigning)' != 'true' and '$(FullPublicPrivateKey)' != 'true' and '$(SignType)' != 'oss'"
|
|
Inputs="$(TargetPath)"
|
|
Outputs="$(TargetPath).requires_signing">
|
|
<WriteSigningRequired AuthenticodeSig="$(AuthenticodeSig)"
|
|
StrongNameSig="$(StrongNameSig)"
|
|
MarkerFile="$(TargetPath).requires_signing" />
|
|
<ItemGroup>
|
|
<FileWrites Include="%(IntermediateAssembly.Identity).requires_signing" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<!--
|
|
NOTE: This mechanism for wiring in the OpenSourceSign target can't be changed to any of the following:
|
|
|
|
* AfterTargets=Compile -> hit by intellisense builds while @(IntermediateAssembly) doesn't exist yet.
|
|
* AfterTargets=PrepareForRun -> hit after @(IntermediateAssembly) has already been copied to output.
|
|
* BeforeTargets=CopyFilesToOutputDirectory -> does not work on Mono.
|
|
-->
|
|
<PropertyGroup>
|
|
<PrepareForRunDependsOn>OpenSourceSign;$(PrepareForRunDependsOn)</PrepareForRunDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="OpenSourceSign"
|
|
Condition="'$(DelaySign)' == 'true' and '@(IntermediateAssembly)' != '' and '$(SkipSigning)' != 'true' and '$(SignType)' == 'oss'"
|
|
Inputs="@(IntermediateAssembly)"
|
|
Outputs="%(IntermediateAssembly.Identity).oss_signed"
|
|
>
|
|
<OpenSourceSign AssemblyPath="%(IntermediateAssembly.Identity)" />
|
|
<Touch Files="%(IntermediateAssembly.Identity).oss_signed" AlwaysCreate="true" />
|
|
<ItemGroup>
|
|
<FileWrites Include="%(IntermediateAssembly.Identity).oss_signed" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project>
|