1 <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
2 <Project Sdk="Microsoft.NET.Sdk">
4 This MSBuild file is intended to be used as the body of the default
5 publishing release pipeline. The release pipeline will use this file
6 to invoke the SignCheck tool to validate that packages about to
7 be published are correctly signed.
11 - PackageBasePath : Directory containing all files that need to be validated.
12 - SignCheckVersion : Version of SignCheck package to be used.
13 - SignValidationExclusionList : ItemGroup containing exclusion list to be forwarded to SignCheck.
14 - EnableJarSigningCheck : Whether .jar files should be validated.
15 - EnableStrongNameCheck : Whether strong name check should be performed.
19 <TargetFramework>netcoreapp2.1</TargetFramework>
23 From 'Signing.props' we import $(SignValidationExclusionList)
25 <Import Project="$(MSBuildThisFileDirectory)Signing.props" Condition="Exists('$(MSBuildThisFileDirectory)Signing.props')" />
27 <Target Name="ValidateSigning">
29 <SignCheckToolPath>$(NuGetPackageRoot)Microsoft.DotNet.SignCheck\$(SignCheckVersion)\tools\Microsoft.DotNet.SignCheck.exe</SignCheckToolPath>
31 <SignCheckInputDir>$(PackageBasePath)</SignCheckInputDir>
32 <SignCheckLog>signcheck.log</SignCheckLog>
33 <SignCheckErrorLog>signcheck.errors.log</SignCheckErrorLog>
34 <SignCheckExclusionsFile>signcheck.exclusions.txt</SignCheckExclusionsFile>
39 Documentation for these arguments is available here:
40 https://github.com/dotnet/arcade/tree/master/src/SignCheck
42 <SignCheckArgs Include="--recursive" />
43 <SignCheckArgs Include="--traverse-subfolders" />
44 <SignCheckArgs Include="--file-status AllFiles" />
45 <SignCheckArgs Include="--log-file $(SignCheckLog)" />
46 <SignCheckArgs Include="--error-log-file $(SignCheckErrorLog)" />
47 <SignCheckArgs Include="--input-files $(SignCheckInputDir)" />
49 <SignCheckArgs Include="--exclusions-file $(SignCheckExclusionsFile)" Condition="'@(SignValidationExclusionList)' != ''" />
50 <SignCheckArgs Include="--verify-jar" Condition="'$(EnableJarSigningCheck)' == 'true'" />
51 <SignCheckArgs Include="--verify-strongname" Condition="'$(EnableStrongNameCheck)' == 'true'" />
55 File="$(SignCheckExclusionsFile)"
56 Lines="@(SignValidationExclusionList)"
57 Condition="'@(SignValidationExclusionList)' != ''"
62 IgnoreExitCode='true' because the tool doesn't return '0' on success.
65 Command=""$(SignCheckToolPath)" @(SignCheckArgs, ' ')"
67 ConsoleToMsBuild="false"
68 StandardErrorImportance="high" />
71 Text="Signing validation failed. Check $(SignCheckErrorLog) for more information."
72 Condition="Exists($(SignCheckErrorLog)) and '$([System.IO.File]::ReadAllText($(SignCheckErrorLog)))' != ''" />
75 Text="##vso[artifact.upload containerfolder=LogFiles;artifactname=LogFiles]{SignCheckErrorLog}"
76 Condition="Exists($(SignCheckErrorLog)) and '$([System.IO.File]::ReadAllText($(SignCheckErrorLog)))' != ''" />
81 <PackageReference Include="Microsoft.DotNet.SignCheck" Version="$(SignCheckVersion)" />