Skip to content

Commit

Permalink
Auto-generate versions of build task assemblies (#277)
Browse files Browse the repository at this point in the history
* Auto-generate versions of build task assemblies
  • Loading branch information
tmat committed May 7, 2019
1 parent 8508270 commit a7a61ed
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 7 deletions.
83 changes: 83 additions & 0 deletions eng/common/SigningValidation.proj
@@ -0,0 +1,83 @@
<!-- 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. -->
<Project Sdk="Microsoft.NET.Sdk">
<!--
This MSBuild file is intended to be used as the body of the default
publishing release pipeline. The release pipeline will use this file
to invoke the the SignCheck tool to validate that packages about to
be published are correctly signed.
Parameters:
- PackageBasePath : Directory containing all files that need to be validated.
- SignCheckVersion : Version of SignCheck package to be used.
- SignValidationExclusionList : ItemGroup containing exclusion list to be forwarded to SignCheck.
- EnableJarSigningCheck : Whether .jar files should be validated.
- EnableStrongNameCheck : Whether strong name check should be performed.
-->

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<!--
From 'Signing.props' we import $(SignValidationExclusionList)
-->
<Import Project="$(MSBuildThisFileDirectory)Signing.props" Condition="Exists('$(MSBuildThisFileDirectory)Signing.props')" />

<Target Name="ValidateSigning">
<PropertyGroup>
<SignCheckToolPath>$(NuGetPackageRoot)Microsoft.DotNet.SignCheck\$(SignCheckVersion)\tools\Microsoft.DotNet.SignCheck.exe</SignCheckToolPath>

<SignCheckInputDir>$(PackageBasePath)</SignCheckInputDir>
<SignCheckLog>signcheck.log</SignCheckLog>
<SignCheckErrorLog>signcheck.errors.log</SignCheckErrorLog>
<SignCheckExclusionsFile>signcheck.exclusions.txt</SignCheckExclusionsFile>
</PropertyGroup>

<ItemGroup>
<!--
Documentation for these arguments is available here:
https://github.com/dotnet/arcade/tree/master/src/SignCheck
-->
<SignCheckArgs Include="--recursive" />
<SignCheckArgs Include="--traverse-subfolders" />
<SignCheckArgs Include="--file-status AllFiles" />
<SignCheckArgs Include="--log-file $(SignCheckLog)" />
<SignCheckArgs Include="--error-log-file $(SignCheckErrorLog)" />
<SignCheckArgs Include="--input-files $(SignCheckInputDir)" />

<SignCheckArgs Include="--exclusions-file $(SignCheckExclusionsFile)" Condition="'@(SignValidationExclusionList)' != ''" />
<SignCheckArgs Include="--verify-jar" Condition="'$(EnableJarSigningCheck)' == 'true'" />
<SignCheckArgs Include="--verify-strongname" Condition="'$(EnableStrongNameCheck)' == 'true'" />
</ItemGroup>

<WriteLinesToFile
File="$(SignCheckExclusionsFile)"
Lines="@(SignValidationExclusionList)"
Condition="'@(SignValidationExclusionList)' != ''"
Overwrite="true"
Encoding="Unicode"/>

<!--
IgnoreExitCode='true' because the tool doesn't return '0' on success.
-->
<Exec
Command="&quot;$(SignCheckToolPath)&quot; @(SignCheckArgs, ' ')"
IgnoreExitCode='true'
ConsoleToMsBuild="false"
StandardErrorImportance="high" />

<Error
Text="Signing validation failed. Check $(SignCheckErrorLog) for more information."
Condition="Exists($(SignCheckErrorLog)) and '$([System.IO.File]::ReadAllText($(SignCheckErrorLog)))' != ''" />

<Message
Text="##vso[artifact.upload containerfolder=LogFiles;artifactname=LogFiles]{SignCheckErrorLog}"
Condition="Exists($(SignCheckErrorLog)) and '$([System.IO.File]::ReadAllText($(SignCheckErrorLog)))' != ''" />

</Target>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.SignCheck" Version="$(SignCheckVersion)" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions global.json
@@ -1,8 +1,8 @@
{
"tools": {
"dotnet": "2.1.600-preview-009426"
"dotnet": "2.2.203"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19167.10"
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19255.2"
}
}
1 change: 1 addition & 0 deletions src/Directory.Build.props
Expand Up @@ -6,6 +6,7 @@
<LangVersion>Latest</LangVersion>
<Copyright>$(CopyrightMicrosoft)</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GenerateResxSource>true</GenerateResxSource>
</PropertyGroup>

<!--
Expand Down
4 changes: 0 additions & 4 deletions src/Directory.Build.targets
Expand Up @@ -2,10 +2,6 @@
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<ItemGroup>
<EmbeddedResource Update="*.resx" GenerateSource="true" />
</ItemGroup>

<!--
Workaround for https://github.com/NuGet/Home/issues/6754: cyclic dependency.
-->
Expand Down
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>

<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
<PackageId>Microsoft.Build.Tasks.Git</PackageId>
Expand Down
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Common\Names.cs" Link="Common\Names.cs" />
Expand Down
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down
1 change: 1 addition & 0 deletions src/SourceLink.Common/Microsoft.SourceLink.Common.csproj
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down
1 change: 1 addition & 0 deletions src/SourceLink.GitHub/Microsoft.SourceLink.GitHub.csproj
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down
1 change: 1 addition & 0 deletions src/SourceLink.GitLab/Microsoft.SourceLink.GitLab.csproj
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down
1 change: 1 addition & 0 deletions src/SourceLink.Tfs.Git/Microsoft.SourceLink.Tfs.Git.csproj
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>

<!-- Using an explicit nuspec file since NuGet Pack target currently doesn't support including dependencies in tools packages -->
<IsPackable>true</IsPackable>
Expand Down

0 comments on commit a7a61ed

Please sign in to comment.