Automate authenticode code-signing using Roslyn sign tool

* Change project layout to prepare for upcoming Arcade changes
* Add signtool config file to configure OPC, NuGet, and Authenticode signing
* Fix a bug when BaseIntermediateOutputPath is set to an absolute path
This commit is contained in:
Nate McMaster 2018-08-06 18:28:13 -07:00
parent e5ea2526b1
commit 78045b2177
34 changed files with 500 additions and 139 deletions

View File

@ -15,13 +15,13 @@ test: 'off'
deploy: 'off'
os: Visual Studio 2017 Preview
build_script:
- build.cmd /p:SkipTests=true /p:BlazorOutputStatistics=true
- build.cmd -ci /p:SkipTests=true /p:BlazorOutputStatistics=true
before_test:
- choco install googlechrome --ignore-checksum
- npm install -g selenium-standalone@latest
- selenium-standalone install
- ps: $SeleniumProcess = Start-Process "selenium-standalone" -ArgumentList "start" -PassThru
test_script:
- build.cmd /t:Test /p:BlazorAllTests=true /p:BlazorOutputStatistics=true
- build.cmd -ci /t:Test /p:BlazorAllTests=true /p:BlazorOutputStatistics=true
after_test:
- ps: Stop-Process -Id $SeleniumProcess.Id

View File

@ -20,5 +20,8 @@ trim_trailing_whitespace = false
insert_final_newline = true
indent_size = 2
[*.yml]
indent_size = 2
[*.{yml,json}]
indent_size = 2
[*.{xml,csproj,config,*proj,targets,props}]
indent_size = 2

3
.gitignore vendored
View File

@ -6,4 +6,5 @@ launchSettings.json
artifacts/
msbuild.binlog
.vscode/
BenchmarkDotNet.Artifacts/
BenchmarkDotNet.Artifacts/
*.binlog

View File

@ -31,10 +31,9 @@ install:
- npm install -g selenium-standalone
- selenium-standalone install
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export TEST_CHROME_BINARY=`which google-chrome-stable`; fi
- export DOTNET_INSTALL_DIR="$PWD/.dotnetcli"
- curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current --version latest --install-dir "$DOTNET_INSTALL_DIR"
- export DOTNET_INSTALL_DIR="$PWD/.dotnet"
- export PATH="$DOTNET_INSTALL_DIR:$PATH"
script:
- ./build.sh /p:SkipTests=true /p:BlazorOutputStatistics=true
- ./build.sh --ci /p:SkipTests=true /p:BlazorOutputStatistics=true
- selenium-standalone start &
- ./build.sh /t:Test /p:BlazorAllTests=true
- ./build.sh --ci /t:Test /p:BlazorAllTests=true

View File

@ -0,0 +1,22 @@
trigger:
- master
- release/*
phases:
- template: ../templates/blazor-build.yml
parameters:
queueName: VSEng-MicroBuildVS2017
variables:
SignType: real
TeamName: AspNetCore
beforeBuild:
- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
displayName: Install CodeSigning plugin
inputs:
signType: $(SignType)
condition: and(succeeded(), in(variables['SignType'], 'test', 'real'))
afterBuild:
- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
displayName: Perform Cleanup Tasks
condition: succeededOrFailed()

View File

@ -0,0 +1,10 @@
trigger:
- master
- release/*
phases:
- template: ../templates/blazor-build.yml
parameters:
queueName: Hosted VS2017
variables:
SkipCodeSign: true

View File

@ -1,31 +1,51 @@
trigger:
- master
- release/*
phases:
- phase: Windows
queue:
name: Hosted VS2017
parallel: 2
matrix:
Debug:
BuildConfiguration: Debug
Release:
BuildConfiguration: Release
steps:
- checkout: self
clean: true
- script: .\build.cmd -ci /p:Configuration=$(BuildConfiguration)
displayName: Run build.cmd
- task: PublishTestResults@2
displayName: Publish test results
condition: always()
inputs:
testRunner: vstest
testResultsFiles: 'artifacts/logs/**/*.trx'
- task: PublishBuildArtifacts@1
displayName: Upload artifacts
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
inputs:
pathtoPublish: artifacts/
artifactName: artifacts-$(BuildConfiguration)
artifactType: Container
parameters:
queueName: ''
beforeBuild: []
afterBuild: []
variables:
phases:
- phase: Windows
queue:
name: ${{ parameters.queueName }}
parallel: 2
matrix:
Release:
BuildConfiguration: Release
Debug:
BuildConfiguration: Debug
variables:
${{ insert }}: ${{ parameters.variables }}
steps:
- checkout: self
clean: true
- ${{ parameters.beforeBuild }}
- script: .\build.cmd -ci /p:Configuration=$(BuildConfiguration)
displayName: Run build.cmd
- task: PublishTestResults@2
displayName: Publish test results
condition: always()
inputs:
testRunner: vstest
testResultsFiles: 'artifacts/logs/**/*.trx'
- task: PublishBuildArtifacts@1
displayName: Upload artifacts
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
inputs:
pathtoPublish: artifacts/$(BuildConfiguration)/
artifactName: artifacts-$(BuildConfiguration)
artifactType: Container
- task: PublishBuildArtifacts@1
displayName: Upload logs
condition: and(failed(), eq(variables['system.pullrequest.isfork'], false))
inputs:
pathtoPublish: artifacts/logs/
artifactName: logs-$(BuildConfiguration)
artifactType: Container
- ${{ parameters.afterBuild }}

View File

@ -6,7 +6,7 @@
<Import Project="version.props" />
<Import Project="build\dependencies.props" />
<Import Project="build\sources.props" />
<PropertyGroup>
<Product>Microsoft ASP.NET Core Blazor</Product>
<RepositoryUrl>https://github.com/aspnet/blazor</RepositoryUrl>
@ -23,11 +23,14 @@
<PublicSign>false</PublicSign>
</PropertyGroup>
<Import Project="build\arcade.props" />
<PropertyGroup>
<!-- So we can use the tool from source within the repo without having to pack -->
<BlazorToolsDir>$(ArtifactsBinDir)Microsoft.AspNetCore.Blazor.Build\netcoreapp2.1\</BlazorToolsDir>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
</ItemGroup>
<PropertyGroup>
<RazorPackageVersion>2.1.0</RazorPackageVersion>
</PropertyGroup>
</Project>
</Project>

246
build/SignToolData.json Normal file
View File

@ -0,0 +1,246 @@
{
"sign": [
{
"certificate": "Microsoft",
"values": [
"bin/Microsoft.AspNetCore.Blazor.Analyzers/netstandard1.3/Microsoft.AspNetCore.Blazor.Analyzers.dll",
"bin/Microsoft.AspNetCore.Blazor.Browser.JS/netcoreapp2.1/Microsoft.AspNetCore.Blazor.Browser.JS.dll",
"bin/Microsoft.AspNetCore.Blazor.Browser/netstandard2.0/Microsoft.AspNetCore.Blazor.Browser.dll",
"bin/Microsoft.AspNetCore.Blazor.Server/netstandard2.0/Microsoft.AspNetCore.Blazor.Server.dll",
"bin/Microsoft.AspNetCore.Blazor.Build/netcoreapp2.1/Microsoft.AspNetCore.Blazor.Build.dll",
"bin/Microsoft.AspNetCore.Blazor.Cli/netcoreapp2.1/dotnet-blazor.dll",
"bin/Microsoft.AspNetCore.Blazor.Razor.Extensions/net461/Microsoft.AspNetCore.Blazor.Razor.Extensions.dll",
"bin/Microsoft.AspNetCore.Blazor.Razor.Extensions/netstandard2.0/Microsoft.AspNetCore.Blazor.Razor.Extensions.dll",
"bin/Microsoft.AspNetCore.Blazor/netstandard2.0/Microsoft.AspNetCore.Blazor.dll",
"bin/Microsoft.JSInterop/netstandard2.0/Microsoft.JSInterop.dll",
"bin/Microsoft.VisualStudio.BlazorExtension/Microsoft.VisualStudio.BlazorExtension.dll",
"bin/Microsoft.VisualStudio.LanguageServices.Blazor/net461/Microsoft.VisualStudio.LanguageServices.Blazor.dll",
"bin/Mono.WebAssembly.Interop/netstandard2.0/Mono.WebAssembly.Interop.dll"
]
},
{
"certificate": "3PartyDual",
"values": [
"bin/Microsoft.AspNetCore.Blazor.Build/netcoreapp2.1/AngleSharp.dll",
"bin/Microsoft.VisualStudio.BlazorExtension/AngleSharp.dll"
]
},
{
"certificate": "Vsix",
"values": [
"bin/Microsoft.VisualStudio.BlazorExtension/Microsoft.VisualStudio.BlazorExtension.vsix"
]
},
{
"certificate": "NuGet",
"strongName": null,
"values": [
"packages/*.nupkg"
]
}
],
"exclude": [
"illink.dll",
"Microsoft.AspNetCore.Razor.Language.dll",
"Microsoft.CodeAnalysis.dll",
"Microsoft.CodeAnalysis.CSharp.dll",
"Microsoft.CodeAnalysis.Razor.dll",
"Microsoft.Extensions.CommandLineUtils.dll",
"Microsoft.Extensions.FileProviders.Abstractions.dll",
"Microsoft.Extensions.FileProviders.Composite.dll",
"Microsoft.Extensions.FileProviders.Embedded.dll",
"Microsoft.Extensions.FileProviders.Physical.dll",
"Microsoft.Extensions.FileSystemGlobbing.dll",
"Microsoft.Extensions.Primitives.dll",
"Mono.Cecil.dll",
"Mono.Cecil.Mdb.dll",
"Mono.Cecil.Pdb.dll",
"Mono.Cecil.Rocks.dll",
"I18N.CJK.dll",
"I18N.dll",
"I18N.MidEast.dll",
"I18N.Other.dll",
"I18N.Rare.dll",
"I18N.West.dll",
"Microsoft.CSharp.dll",
"Microsoft.Win32.Primitives.dll",
"Microsoft.Win32.Registry.AccessControl.dll",
"Microsoft.Win32.Registry.dll",
"Mono.CSharp.dll",
"Mono.Data.Sqlite.dll",
"Mono.Data.Tds.dll",
"Mono.Security.dll",
"mscorlib.dll",
"netstandard.dll",
"System.AppContext.dll",
"System.CodeDom.dll",
"System.Collections.Concurrent.dll",
"System.Collections.dll",
"System.Collections.NonGeneric.dll",
"System.Collections.Specialized.dll",
"System.ComponentModel.Annotations.dll",
"System.ComponentModel.Composition.dll",
"System.ComponentModel.DataAnnotations.dll",
"System.ComponentModel.dll",
"System.ComponentModel.EventBasedAsync.dll",
"System.ComponentModel.Primitives.dll",
"System.ComponentModel.TypeConverter.dll",
"System.Console.dll",
"System.Core.dll",
"System.Data.Common.dll",
"System.Data.dll",
"System.Data.Services.Client.dll",
"System.Data.SqlClient.dll",
"System.Diagnostics.Contracts.dll",
"System.Diagnostics.Debug.dll",
"System.Diagnostics.FileVersionInfo.dll",
"System.Diagnostics.Process.dll",
"System.Diagnostics.StackTrace.dll",
"System.Diagnostics.TextWriterTraceListener.dll",
"System.Diagnostics.Tools.dll",
"System.Diagnostics.TraceEvent.dll",
"System.Diagnostics.TraceSource.dll",
"System.Diagnostics.Tracing.dll",
"System.dll",
"System.Drawing.Common.dll",
"System.Drawing.dll",
"System.Drawing.Primitives.dll",
"System.Dynamic.Runtime.dll",
"System.Globalization.Calendars.dll",
"System.Globalization.dll",
"System.Globalization.Extensions.dll",
"System.IdentityModel.dll",
"System.IO.Compression.dll",
"System.IO.Compression.FileSystem.dll",
"System.IO.Compression.ZipFile.dll",
"System.IO.dll",
"System.IO.FileSystem.AccessControl.dll",
"System.IO.FileSystem.dll",
"System.IO.FileSystem.DriveInfo.dll",
"System.IO.FileSystem.Primitives.dll",
"System.IO.FileSystem.Watcher.dll",
"System.IO.IsolatedStorage.dll",
"System.IO.MemoryMappedFiles.dll",
"System.IO.Pipes.dll",
"System.IO.UnmanagedMemoryStream.dll",
"System.Json.dll",
"System.Linq.dll",
"System.Linq.Expressions.dll",
"System.Linq.Parallel.dll",
"System.Linq.Queryable.dll",
"System.Memory.dll",
"System.Net.AuthenticationManager.dll",
"System.Net.Cache.dll",
"System.Net.dll",
"System.Net.Http.dll",
"System.Net.Http.WinHttpHandler.dll",
"System.Net.HttpListener.dll",
"System.Net.Mail.dll",
"System.Net.NameResolution.dll",
"System.Net.NetworkInformation.dll",
"System.Net.Ping.dll",
"System.Net.Primitives.dll",
"System.Net.Requests.dll",
"System.Net.Security.dll",
"System.Net.ServicePoint.dll",
"System.Net.Sockets.dll",
"System.Net.Utilities.dll",
"System.Net.WebHeaderCollection.dll",
"System.Net.WebSockets.Client.dll",
"System.Net.WebSockets.dll",
"System.Numerics.dll",
"System.Numerics.Vectors.dll",
"System.ObjectModel.dll",
"System.Reflection.Context.dll",
"System.Reflection.DispatchProxy.dll",
"System.Reflection.dll",
"System.Reflection.Emit.dll",
"System.Reflection.Emit.ILGeneration.dll",
"System.Reflection.Emit.Lightweight.dll",
"System.Reflection.Extensions.dll",
"System.Reflection.Primitives.dll",
"System.Reflection.TypeExtensions.dll",
"System.Resources.Reader.dll",
"System.Resources.ReaderWriter.dll",
"System.Resources.ResourceManager.dll",
"System.Resources.Writer.dll",
"System.Runtime.CompilerServices.Unsafe.dll",
"System.Runtime.CompilerServices.Unsafe.dll",
"System.Runtime.CompilerServices.VisualC.dll",
"System.Runtime.dll",
"System.Runtime.Extensions.dll",
"System.Runtime.Handles.dll",
"System.Runtime.InteropServices.dll",
"System.Runtime.InteropServices.RuntimeInformation.dll",
"System.Runtime.InteropServices.WindowsRuntime.dll",
"System.Runtime.Loader.dll",
"System.Runtime.Numerics.dll",
"System.Runtime.Serialization.dll",
"System.Runtime.Serialization.Formatters.dll",
"System.Runtime.Serialization.Json.dll",
"System.Runtime.Serialization.Primitives.dll",
"System.Runtime.Serialization.Xml.dll",
"System.Security.AccessControl.dll",
"System.Security.Claims.dll",
"System.Security.Cryptography.Algorithms.dll",
"System.Security.Cryptography.Cng.dll",
"System.Security.Cryptography.Csp.dll",
"System.Security.Cryptography.DeriveBytes.dll",
"System.Security.Cryptography.Encoding.dll",
"System.Security.Cryptography.Encryption.Aes.dll",
"System.Security.Cryptography.Encryption.dll",
"System.Security.Cryptography.Encryption.ECDiffieHellman.dll",
"System.Security.Cryptography.Encryption.ECDsa.dll",
"System.Security.Cryptography.Hashing.Algorithms.dll",
"System.Security.Cryptography.Hashing.dll",
"System.Security.Cryptography.OpenSsl.dll",
"System.Security.Cryptography.Pkcs.dll",
"System.Security.Cryptography.Primitives.dll",
"System.Security.Cryptography.ProtectedData.dll",
"System.Security.Cryptography.RandomNumberGenerator.dll",
"System.Security.Cryptography.RSA.dll",
"System.Security.Cryptography.X509Certificates.dll",
"System.Security.dll",
"System.Security.Principal.dll",
"System.Security.Principal.Windows.dll",
"System.Security.SecureString.dll",
"System.ServiceModel.dll",
"System.ServiceModel.Duplex.dll",
"System.ServiceModel.Http.dll",
"System.ServiceModel.Internals.dll",
"System.ServiceModel.NetTcp.dll",
"System.ServiceModel.Primitives.dll",
"System.ServiceModel.Security.dll",
"System.ServiceModel.Web.dll",
"System.ServiceProcess.ServiceController.dll",
"System.Text.Encoding.CodePages.dll",
"System.Text.Encoding.CodePages.dll",
"System.Text.Encoding.CodePages.dll",
"System.Text.Encoding.dll",
"System.Text.Encoding.Extensions.dll",
"System.Text.RegularExpressions.dll",
"System.Threading.AccessControl.dll",
"System.Threading.dll",
"System.Threading.Overlapped.dll",
"System.Threading.Tasks.dll",
"System.Threading.Tasks.Parallel.dll",
"System.Threading.Thread.dll",
"System.Threading.ThreadPool.dll",
"System.Threading.Timer.dll",
"System.Transactions.dll",
"System.ValueTuple.dll",
"System.Web.Services.dll",
"System.Windows.dll",
"System.Xml.dll",
"System.Xml.Linq.dll",
"System.Xml.ReaderWriter.dll",
"System.Xml.Serialization.dll",
"System.Xml.XDocument.dll",
"System.Xml.XmlDocument.dll",
"System.Xml.XmlSerializer.dll",
"System.Xml.XPath.dll",
"System.Xml.XPath.XDocument.dll",
"System.Xml.XPath.XmlDocument.dll",
"System.Xml.Xsl.Primitives.dll"
]
}

View File

@ -3,13 +3,7 @@
<BuildVSIX Condition="'$(BuildVSIX)' ==''">true</BuildVSIX>
<RestoreDependsOn Condition="'$(OS)'=='Windows_NT' AND '$(BuildVSIX)' == 'true'">$(RestoreDependsOn);RestoreVSIX</RestoreDependsOn>
<PackageDependsOn Condition="'$(OS)'=='Windows_NT' AND '$(BuildVSIX)' == 'true'">$(PackageDependsOn);PackageVSIX</PackageDependsOn>
<GetArtifactInfoDependsOn Condition="'$(OS)'=='Windows_NT' AND '$(BuildVSIX)' == 'true'">$(GetArtifactInfoDependsOn);GetVSIXArtifactInfo</GetArtifactInfoDependsOn>
<VSIXName>Microsoft.VisualStudio.BlazorExtension</VSIXName>
<VSIXOutputPath>$(BuildDir)$(VSIXName).vsix</VSIXOutputPath>
<VSIXManifestOutputPath>$(BuildDir)$(VSIXName).json</VSIXManifestOutputPath>
<VSIXProject>$(RepositoryRoot)tooling\$(VSIXName)\$(VSIXName).csproj</VSIXProject>
<VSIXSymbolsOutputPath>$(BuildDir)$(VSIXName).pdb</VSIXSymbolsOutputPath>
<VSIXArtifactCategory>shipoob</VSIXArtifactCategory>
<VSIXProject>$(RepositoryRoot)tooling\Microsoft.VisualStudio.BlazorExtension\Microsoft.VisualStudio.BlazorExtension.csproj</VSIXProject>
</PropertyGroup>
<Target
@ -17,38 +11,6 @@
DependsOnTargets="RestoreVSIX;PackageVSIX"
Condition="'$(OS)'=='Windows_NT'" />
<!-- This target is required so KoreBuild can generate a bill of materials with relevant information about the VSIX. -->
<Target Name="GetVSIXArtifactInfo">
<ItemGroup>
<ArtifactInfo Include="$(VSIXOutputPath)">
<ArtifactType>VsixPackage</ArtifactType>
<Version>$(PackageVersion)</Version>
<Category>$(VSIXArtifactCategory)</Category>
<PackageId>$(VSIXName)</PackageId>
</ArtifactInfo>
<ArtifactInfo Include="$(VSIXSymbolsOutputPath)">
<ArtifactType>SymbolsFile</ArtifactType>
<Category>$(VSIXArtifactCategory)</Category>
<Dependencies>$(VSIXName).vsix</Dependencies>
<DebugType>full</DebugType>
</ArtifactInfo>
<ArtifactInfo Include="$(VSIXManifestOutputPath)" Condition="'$(IsProductComponent)'=='true'">
<ArtifactType>VsixPackageManifestFile</ArtifactType>
<Category>$(VSIXArtifactCategory)</Category>
<Dependencies>$(VSIXName).vsix</Dependencies>
<PackageId>$(VSIXName)</PackageId>
</ArtifactInfo>
<FilesToSign Include="$(VSIXOutputPath)" Certificate="Vsix" />
<FilesToExcludeFromSigning Include="$(VSIXManifestOutputPath)" />
<FilesToExcludeFromSigning Include="$(VSIXSymbolsOutputPath)" />
</ItemGroup>
</Target>
<!--
VisualStudioMSBuildx86Path is set by the GetToolsets target in KoreBuild if a version of VS matching the requirements in korebuild.json is found.
-->
@ -98,8 +60,8 @@
/v:M;
/fl;
&quot;/flp:LogFile=$(VSIXLogFilePath)&quot;;
/p:BuildProjectReferences=false;
/p:DeployExtension=false;
&quot;/p:TargetVSIXContainer=$(VSIXOutputPath)&quot;;
&quot;/p:SymbolsPublishDir=$(BuildDir)&quot;;
&quot;/p:Configuration=$(Configuration)&quot;;" />
</ItemGroup>

37
build/arcade.props Normal file
View File

@ -0,0 +1,37 @@
<!--
These settings align older versions of KoreBuild with the layout expected by arcade tooling.
This files is a temporary while this project transitions to using arcade.
-->
<Project>
<!--
Project output layout.
These properties overrdie the default locations to obj and bin directories.
-->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ArtifactsDir Condition="'$(ArtifactsDir)' == ''">$(RepositoryRoot)artifacts\</ArtifactsDir>
<ArtifactsObjDir>$(ArtifactsDir)obj\</ArtifactsObjDir>
<ArtifactsConfigurationDir>$(ArtifactsDir)$(Configuration)\</ArtifactsConfigurationDir>
<ArtifactsBinDir>$(ArtifactsConfigurationDir)bin\</ArtifactsBinDir>
<PackageOutputPath>$(ArtifactsConfigurationDir)packages\</PackageOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(DisableArcadeProjectLayout)' != 'true'">
<OutDirName Condition="'$(OutDirName)' == ''">$(MSBuildProjectName)</OutDirName>
<BaseOutputPath Condition="'$(BaseOutputPath)' == ''">$([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\'))</BaseOutputPath>
<OutputPath>$(BaseOutputPath)</OutputPath>
<OutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(OutputPath)$(PlatformName)\</OutputPath>
<OutputPath Condition=" ! HasTrailingSlash($(OutputPath)) ">$(OutputPath)\</OutputPath>
<BaseIntermediateOutputPath Condition=" '$(BaseIntermediateOutputPath)' == '' ">$([System.IO.Path]::GetFullPath('$(ArtifactsObjDir)$(MSBuildProjectName)'))</BaseIntermediateOutputPath>
<BaseIntermediateOutputPath Condition=" ! HasTrailingSlash($(BaseIntermediateOutputPath)) ">$(BaseIntermediateOutputPath)\</BaseIntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
</Project>

View File

@ -5,10 +5,11 @@
<PropertyGroup Label="Package Versions"><!-- Used only in development when running the template contents directly from source -->
<AspNetCorePackageVersion>2.1.0</AspNetCorePackageVersion>
<BenchmarkDotNetPackageVersion>0.10.13</BenchmarkDotNetPackageVersion>
<InternalAspNetCoreSdkPackageVersion>2.1.0-rtm-15789</InternalAspNetCoreSdkPackageVersion>
<InternalAspNetCoreSdkPackageVersion>2.1.3-rtm-15811</InternalAspNetCoreSdkPackageVersion>
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>2.2.0-preview1-34576</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
<SignalRPackageVersion>1.0.0</SignalRPackageVersion>
<TemplateBlazorPackageVersion>0.5.0-preview1-10358</TemplateBlazorPackageVersion>
<TemplateBlazorPackageVersion>0.6.0-preview1-20180807.1</TemplateBlazorPackageVersion>
<RazorPackageVersion>2.1.0</RazorPackageVersion>
</PropertyGroup>
<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />

View File

@ -1,6 +1,13 @@
<Project>
<Import Project="dependencies.props" />
<!-- Properties to make KoreBuild more like dotnet/arcade. -->
<PropertyGroup>
<BuildDir>$(ArtifactsDir)$(Configuration)\packages\</BuildDir>
<SkipArtifactVerification>true</SkipArtifactVerification>
<GenerateSignRequest>false</GenerateSignRequest>
</PropertyGroup>
<PropertyGroup>
<EnableBenchmarkValidation>true</EnableBenchmarkValidation>
</PropertyGroup>
@ -14,8 +21,8 @@
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
</PropertyGroup>
<!--
By default, this excludes the end-to-end tests from the repo-level build command.
<!--
By default, this excludes the end-to-end tests from the repo-level build command.
The CI will script these directly by passing BlazorAllTests=true
-->
<ItemGroup Condition="'$(BlazorAllTests)'!='true'">

View File

@ -5,5 +5,11 @@
<!-- the 'DebugNoVSIX' and 'ReleaseNoVSIX' configurations exclude the VSIX project, which doesn't build with Microsoft.NET.Sdk yet. -->
<AdditionalProperties>Configuration=$(Configuration)NoVSIX</AdditionalProperties>
</Solutions>
</ItemGroup>
</ItemGroup>
<Target Name="CodeSign" AfterTargets="Package" DependsOnTargets="GetToolsets" Condition=" '$(OS)' == 'Windows_NT' ">
<MSBuild Projects="$(MSBuildThisFileDirectory)sign.proj"
Targets="Restore;CodeSign"
Properties="VisualStudioMSBuildx86Path=$(VisualStudioMSBuildx86Path);Configuration=$(Configuration)" />
</Target>
</Project>

31
build/sign.proj Normal file
View File

@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--
See https://github.com/dotnet/roslyn-tools/tree/master/src/SignTool for docs on using the sign tool.
-->
<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<RestorePackagesPath>$(MSBuildThisFileDirectory)..\artifacts\obj\tools\</RestorePackagesPath>
<SignToolVersion>1.0.0-beta2-63206-01</SignToolVersion>
<CodeSignToolPath>$(RestorePackagesPath)roslyntools.signtool\$(SignToolVersion)\tools\SignTool.exe</CodeSignToolPath>
<SignToolOptions Condition=" '$(VisualStudioMSBuildx86Path)' != '' " >-msbuildPath "$(VisualStudioMSBuildx86Path)"</SignToolOptions>
<SignToolOptions Condition=" '$(CI)' != 'true' OR '$(SkipCodeSign)' == 'true' ">$(SignToolOptions) -test</SignToolOptions>
<SignToolOptions Condition=" '$(SignType)' == 'test' ">$(SignToolOptions) -testSign</SignToolOptions>
<SignToolOptions>$(SignToolOptions) -nugetPackagesPath $(RestorePackagesPath)</SignToolOptions>
<SignToolOptions>$(SignToolOptions) -config "$(MSBuildThisFileDirectory)SignToolData.json"</SignToolOptions>
<SignToolOptions>$(SignToolOptions) $(ArtifactsConfigurationDir)</SignToolOptions>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MicroBuild.Core" Version="0.2.0" />
<PackageReference Include="RoslynTools.SignTool" Version="$(SignToolVersion)" />
</ItemGroup>
<Target Name="CodeSign">
<Exec Command="&quot;$(CodeSignToolPath)&quot; $(SignToolOptions)" />
</Target>
</Project>

View File

@ -7,7 +7,8 @@
$(RestoreSources);
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json
https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json;
https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json
</RestoreSources>
<RestoreSources Condition="'$(DotNetBuildOffline)' != 'true'">
$(RestoreSources);

View File

@ -1,5 +1,5 @@
{ "sdk": {
"version": "2.1.302" },
"msbuild-sdks": {
"Microsoft.DotNet.GlobalTools.Sdk": "2.1.3-rtm-15810"}
"Microsoft.DotNet.GlobalTools.Sdk": "2.1.3-rtm-15811"}
}

View File

@ -1,2 +1,2 @@
version:2.1.3-rtm-15810
commithash:e00cd3bbf2d68556e422c31cb053dec316e0ab12
version:2.1.3-rtm-15811
commithash:640972bd30677321840c88105030d5f97e13738f

View File

@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!-- Workaround for #261 which requires the bin and obj directory be in the project directory -->
<DisableArcadeProjectLayout>true</DisableArcadeProjectLayout>
</PropertyGroup>
<Import Project="..\Directory.Build.props" />
</Project>

View File

@ -1 +0,0 @@
/tools/

View File

@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<OutDir>tools</OutDir> <!-- So we can use the tool from source within the repo without having to pack -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
@ -11,7 +10,7 @@
<PropertyGroup>
<NoPackageAnalysis>true</NoPackageAnalysis>
<NuspecFile>Microsoft.AspNetCore.Blazor.Build.nuspec</NuspecFile>
<IntermediatePackDir>$(MSBuildProjectDirectory)/bin/$(Configuration)/publish/</IntermediatePackDir>
<IntermediatePackDir>$(OutputPath)publish\</IntermediatePackDir>
<PublishDir>$(IntermediatePackDir)$(TargetFramework)/</PublishDir>
</PropertyGroup>
@ -30,13 +29,9 @@
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" Properties="TargetFramework=%(_TargetFramework.Identity)" />
</Target>
<ItemGroup>
<None Remove="tools\**" />
</ItemGroup>
<ItemGroup>
<!-- This is a newer version than is in the shared framework, so copy it -->
<Content Include="..\Microsoft.AspNetCore.Blazor.Razor.Extensions\bin\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Razor.Language.dll">
<Content Include="$(ArtifactsBinDir)Microsoft.AspNetCore.Blazor.Razor.Extensions\netstandard2.0\Microsoft.AspNetCore.Razor.Language.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</Content>

View File

@ -5,7 +5,7 @@
<PackageDependency Include="Microsoft.AspNetCore.Blazor.Build" />
... except it's much more convenient when working in this repo, because it consumes the
Blazor.Build targets/exe directly without needing this project to be packed into a .nupkg.
This is only intended for use by other projects in this repo.
-->
<PropertyGroup>
@ -29,13 +29,13 @@
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="$(RazorPackageVersion)"/>
</ItemGroup>
<Target
<Target
Name="BuildBlazorBuildBinary"
BeforeTargets="BlazorGenerateDeclaration">
<!-- Ensures this project is built before the consuming project, but without
adding a runtime dependency on the .dll (to be equivalent to a <PackageDependency>
given that the packed version of this project wouldn't add a .dll reference) -->
<MSBuild Projects="$(MSBuildThisFileDirectory)Microsoft.AspNetCore.Blazor.Build.csproj" Targets="Restore;Build" />
<MSBuild Projects="$(MSBuildThisFileDirectory)Microsoft.AspNetCore.Blazor.Build.csproj" Targets="Build" />
</Target>
<PropertyGroup>

View File

@ -6,7 +6,8 @@
</PropertyGroup>
<PropertyGroup>
<BlazorBuildExe>dotnet &quot;$(MSBuildThisFileDirectory)../tools/Microsoft.AspNetCore.Blazor.Build.dll&quot;</BlazorBuildExe>
<BlazorToolsDir Condition="'$(BlazorToolsDir)' == ''">$(MSBuildThisFileDirectory)../tools/</BlazorToolsDir>
<BlazorBuildExe>dotnet &quot;$(BlazorToolsDir)Microsoft.AspNetCore.Blazor.Build.dll&quot;</BlazorBuildExe>
<!-- The Blazor build code can only find your referenced assemblies if they are in the output directory -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
@ -15,7 +16,7 @@
<Import Project="RazorCompilation.targets" />
<Import Project="Blazor.MonoRuntime.targets" />
<Import Project="Publish.targets" />
<Target Name="GenerateBlazorMetadataFile" BeforeTargets="GetCopyToOutputDirectoryItems">
<PropertyGroup>
<BlazorMetadataFileName>$(AssemblyName).blazor.config</BlazorMetadataFileName>

View File

@ -185,7 +185,8 @@
<PropertyGroup Label="Intermediate output paths">
<!-- /obj/<<configuration>>/<<targetframework>>/blazor -->
<BlazorIntermediateOutputPath>$(ProjectDir)$(IntermediateOutputPath)$(BaseBlazorIntermediateOutputPath)</BlazorIntermediateOutputPath>
<BlazorIntermediateOutputPath>$(IntermediateOutputPath)$(BaseBlazorIntermediateOutputPath)</BlazorIntermediateOutputPath>
<BlazorIntermediateOutputPath Condition="! $([System.IO.Path]::IsPathRooted($(BlazorIntermediateOutputPath)))">$([MSBuild]::Escape($([System.IO.Path]::GetFullPath('$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(BlazorIntermediateOutputPath)'))'))))</BlazorIntermediateOutputPath>
<!-- Common marker files paths -->

View File

@ -24,11 +24,11 @@
<ContentWithTargetPath Update="@(ContentWithTargetPath)" Condition="$([System.String]::new(%(TargetPath)).StartsWith('wwwroot\')) OR $([System.String]::new(%(TargetPath)).StartsWith('wwwroot/'))">
<TargetPath>$(BlazorPublishDistDir)$([System.String]::new(%(TargetPath)).Substring(8))</TargetPath>
</ContentWithTargetPath>
<!-- Publish all the 'dist' files -->
<_BlazorGCTPDIDistFiles Include="@(BlazorItemOutput->'%(TargetOutputPath)')" />
<_BlazorGCTPDI Include="@(_BlazorGCTPDIDistFiles)">
<TargetPath>$(BlazorPublishDistDir)$([MSBuild]::MakeRelative('$(ProjectDir)$(OutDir)dist\', %(Identity)))</TargetPath>
<TargetPath>$(BlazorPublishDistDir)$([MSBuild]::MakeRelative('$(OutDir)dist\', %(Identity)))</TargetPath>
</_BlazorGCTPDI>
<ContentWithTargetPath Include="@(_BlazorGCTPDI)">
@ -55,7 +55,7 @@
Condition="!Exists('$(PublishDir)web.config')"
File="$(PublishDir)web.config"
Lines="@(_StandaloneWebConfigContent->Replace('[ServeSubdirectory]','$(BlazorPublishDistDir)'))" />
<!-- Remove the .blazor.config file, since it's irrelevant for standalone publishing -->
<Delete Files="$(PublishDir)$(AssemblyName).blazor.config" />
</Target>

View File

@ -8,15 +8,15 @@
<PropertyGroup>
<!-- Passed to Razor tasks and loaded as a plugin -->
<_AngleSharpAssemblyPath>$(MSBuildThisFileDirectory)../tools/AngleSharp.dll</_AngleSharpAssemblyPath>
<_BlazorExtensionAssemblyPath>$(MSBuildThisFileDirectory)../tools/Microsoft.AspNetCore.Blazor.Razor.Extensions.dll</_BlazorExtensionAssemblyPath>
<_AngleSharpAssemblyPath>$(BlazorToolsDir)AngleSharp.dll</_AngleSharpAssemblyPath>
<_BlazorExtensionAssemblyPath>$(BlazorToolsDir)Microsoft.AspNetCore.Blazor.Razor.Extensions.dll</_BlazorExtensionAssemblyPath>
<!-- Deactivates the Razor SDK's build-time compilation. We do our own -->
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorLangVersion>Experimental</RazorLangVersion>
<!--
<!--
This version is used to build our RazorConfiguration, and is hardcoded into the tools in VS. If you change
This to a value that doesn't match VS, then the Blazor Razor experience won't work for those documents.
-->
@ -24,7 +24,7 @@
<BlazorDefinitionConfiguration>Blazor-$(BlazorLanguageVersion)</BlazorDefinitionConfiguration>
<BlazorDeclarationConfiguration>BlazorDeclaration-$(BlazorLanguageVersion)</BlazorDeclarationConfiguration>
<RazorDefaultConfiguration>$(BlazorDefinitionConfiguration)</RazorDefaultConfiguration>
</PropertyGroup>
<!-- Something quick for input/output tracking - the assumptions here should match what the CLI does -->
@ -37,7 +37,7 @@
<ProjectCapability Include="Blazor" />
<ProjectCapability Include="DotNetCoreRazorConfiguration" />
<RazorConfiguration Include="$(BlazorDefinitionConfiguration)">
<Extensions>Blazor-$(BlazorLanguageVersion);Blazor.AngleSharp-$(BlazorLanguageVersion);$(CustomRazorExtension)</Extensions>
</RazorConfiguration>
@ -81,7 +81,7 @@
<!-- Defining properties that depend on import order in a target for resilience -->
<Target Name="_DefineBlazorPaths">
<PropertyGroup>
<!--
<!--
The Razor tasks require you to pass a tag helper manifest file. We don't need tag helpers for declarations
so that one is just a placeholder.
-->
@ -104,7 +104,7 @@
This step also assigns each item an output path for both stages of code generation.
-->
<Target Name="_AssignBlazorGenerateTargetPaths">
<Target Name="_AssignBlazorGenerateTargetPaths">
<AssignTargetPath Files="@(BlazorGenerate)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="BlazorGenerateWithTargetPath" />
</AssignTargetPath>
@ -118,9 +118,9 @@
</BlazorGenerateWithTargetPath>
</ItemGroup>
<!--
<!--
Instruct VS to re-run the target when input files change. Other IDEs may not honor this
and therefore developers may need to rebuild after changing cshtml files.
and therefore developers may need to rebuild after changing cshtml files.
-->
<ItemGroup>
<BlazorDeclaration Include="@(BlazorGenerateWithTargetPath->'%(GeneratedDeclaration)')">
@ -204,7 +204,7 @@
</ItemGroup>
</Target>
<Target
<Target
Name="BlazorResolveComponents"
Inputs="$(MSBuildAllProjects);$(_BlazorExtensionAssemblyPath);@(ReferencePathWithRefAssemblies);@(_BlazorTempAssembly)"
Outputs="$(_RazorTagHelperInputCache)"
@ -220,7 +220,7 @@
<_BlazorDeclarationConfiguration Include="@(RazorConfiguration->WithMetadataValue('Identity', '$(BlazorDeclarationConfiguration)'))" />
</ItemGroup>
<!--
<!--
We're manipulating our output directly here because we want to separate the actual up-to-date check
of BlazorGenerateDefinition from the output of this target. Many times the set of components doesn't change
so we don't need to regenerate the code.
@ -258,9 +258,9 @@
These files are used in the real build and don't participate in design time builds.
-->
<Target
Name="BlazorGenerateDefinition"
BeforeTargets="CoreCompile"
<Target
Name="BlazorGenerateDefinition"
BeforeTargets="CoreCompile"
DependsOnTargets="$(BlazorGenerateDefinitionDependsOn)"
Inputs="$(MSBuildAllProjects);$(_BlazorExtensionAssemblyPath);$(_BlazorGenerateInputsHashFile);$(_BlazorGenerateDefinitionComponentManifest);@(BlazorGenerate)"
Outputs="@(BlazorDefinition)"
@ -301,7 +301,7 @@
<!--
Taken from the Razor SDK targets
-->
<Target
<Target
Name="_BlazorTempCompile"
DependsOnTargets="BlazorGenerateDeclaration;FindReferenceAssembliesForReferences"
Inputs="

View File

@ -1 +0,0 @@
/tools/

View File

@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
<OutDir>tools</OutDir>
<IsPackable>false</IsPackable>
</PropertyGroup>

View File

@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<BlazorBuildToolsExe>dotnet &quot;$(MSBuildThisFileDirectory)tools/Microsoft.AspNetCore.Blazor.BuildTools.dll&quot;</BlazorBuildToolsExe>
<BlazorBuildToolsExe>dotnet &quot;$(ArtifactsBinDir)Microsoft.AspNetCore.Blazor.BuildTools/netcoreapp2.1/Microsoft.AspNetCore.Blazor.BuildTools.dll&quot;</BlazorBuildToolsExe>
</PropertyGroup>
<ItemGroup>

View File

@ -1,3 +1,3 @@
# We only track the .template.config.src items in source control
# The .template.config files are generated on build
content/**/.template.config/
content/**/.template.config/

View File

@ -0,0 +1,4 @@
<!-- Intentionally does not import parent Directory.Build.props file to isolate templates projects from the rest of the repo -->
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\dependencies.props" />
</Project>

View File

@ -0,0 +1,2 @@
<!-- Intentionally empty to isolate templates projects from the rest of the repo -->
<Project />

View File

@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!-- Workaround for #261 which requires the bin and obj directory be in the project directory -->
<DisableArcadeProjectLayout>true</DisableArcadeProjectLayout>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />
</Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
@ -7,7 +7,9 @@
<!-- Don't import the directory props and targets, they aren't compatible with an old-style csproj -->
<ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
<RepositoryRoot>$(MSBuildThisFileDirectory)..\..\</RepositoryRoot>
</PropertyGroup>
<Import Project="..\..\build\arcade.props" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\..\version.props" />
<!--
@ -136,7 +138,7 @@
<IncludeOutputGroupsInVSIXLocalOnly>
</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<Content Include="..\..\src\Microsoft.AspNetCore.Blazor.Razor.Extensions\bin\$(Configuration)\net461\Microsoft.AspNetCore.Blazor.Razor.Extensions.dll">
<Content Include="$(ArtifactsBinDir)Microsoft.AspNetCore.Blazor.Razor.Extensions\net461\Microsoft.AspNetCore.Blazor.Razor.Extensions.dll">
<Link>Microsoft.AspNetCore.Blazor.Razor.Extensions.dll</Link>
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -151,7 +153,7 @@
<IncludeOutputGroupsInVSIXLocalOnly>
</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<Content Include="..\Microsoft.VisualStudio.LanguageServices.Blazor\bin\$(Configuration)\net461\Microsoft.VisualStudio.LanguageServices.Blazor.dll">
<Content Include="$(ArtifactsBinDir)Microsoft.VisualStudio.LanguageServices.Blazor\net461\Microsoft.VisualStudio.LanguageServices.Blazor.dll">
<Link>Microsoft.VisualStudio.LanguageServices.Blazor.dll</Link>
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -161,7 +163,7 @@
This is built as a P2P by Microsoft.VisualStudio.LanguageServices.Blazor. This is required, adding the P2P
to this project will cause a NU1201 error that doesn't have a workaround.
-->
<Content Include="bin\$(Configuration)\AngleSharp.dll">
<Content Include="$(TargetDir)AngleSharp.dll">
<Link>AngleSharp.dll</Link>
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -204,8 +206,6 @@
-->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{9088E4E4-B855-457F-AE9E-D86709A5E1F4}</ProjectGuid>
@ -220,7 +220,6 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@ -228,7 +227,6 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>