Replace Blazor CLI tool with new DevServer package (#9028)

This commit is contained in:
Steve Sanderson 2019-04-04 09:47:56 +01:00 committed by GitHub
parent 57940a23aa
commit 42511e8652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 81 additions and 100 deletions

View File

@ -23,7 +23,7 @@
<FileNamesToSign Include="aspnetcorev2_inprocess.dll" CertificateName="Microsoft400" />
<FileNamesToSign Include="aspnetcorev2_outofprocess.dll" CertificateName="Microsoft400" />
<FileNamesToSign Include="aspnetcorev2.dll" CertificateName="Microsoft400" />
<FileNamesToSign Include="dotnet-blazor.exe" CertificateName="Microsoft400" />
<FileNamesToSign Include="blazor-devserver.exe" CertificateName="Microsoft400" />
<FileNamesToSign Include="dotnet-dev-certs.exe" CertificateName="Microsoft400" />
<FileNamesToSign Include="dotnet-sql-cache.exe" CertificateName="Microsoft400" />
<FileNamesToSign Include="dotnet-user-secrets.exe" CertificateName="Microsoft400" />

View File

@ -5,7 +5,7 @@ using System;
using System.IO;
using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Blazor.Build.Cli.Commands
namespace Microsoft.AspNetCore.Blazor.Build.DevServer.Commands
{
class ResolveRuntimeDependenciesCommand
{

View File

@ -5,7 +5,7 @@ using Microsoft.Extensions.CommandLineUtils;
using System;
using System.IO;
namespace Microsoft.AspNetCore.Blazor.Build.Cli.Commands
namespace Microsoft.AspNetCore.Blazor.Build.DevServer.Commands
{
internal class WriteBootJsonCommand
{

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Blazor.Build.Cli.Commands;
using Microsoft.AspNetCore.Blazor.Build.DevServer.Commands;
using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Blazor.Build

View File

@ -18,16 +18,16 @@
<Import Project="$(MSBuildThisFileDirectory)targets/All.targets" />
<!--
Debugging support using dotnet-blazor serve.
Debugging support using blazor-devserver serve.
A few things to note here:
- We have to use dotnet exec to avoid launching another process and confusing the debugger.
- Since we're doing dotnet exec, it won't automatically rebuild the CLI project.
- Since we're doing dotnet exec, it won't automatically rebuild the DevServer project.
- $(AdditionalRunArguments) needs to be defined before importing this file.
-->
<PropertyGroup>
<RunCommand>dotnet</RunCommand>
<_BlazorCliLocation>$(MSBuildThisFileDirectory)../../Cli/src/bin/$(Configuration)/netcoreapp3.0/dotnet-blazor.dll</_BlazorCliLocation>
<_BlazorCliLocation>$(MSBuildThisFileDirectory)../../DevServer/src/bin/$(Configuration)/netcoreapp3.0/blazor-devserver.dll</_BlazorCliLocation>
<RunArguments>exec &quot;$(_BlazorCliLocation)&quot; serve $(AdditionalRunArguments)</RunArguments>
</PropertyGroup>

View File

@ -1,47 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyName>dotnet-blazor</AssemblyName>
<PackageId>Microsoft.AspNetCore.Blazor.Cli</PackageId>
<IsShippingPackage>true</IsShippingPackage>
<StartupObject>Microsoft.AspNetCore.Blazor.Cli.Program</StartupObject>
<Description>Development server for use when building Blazor applications.</Description>
<!-- Set this to false because assemblies should not reference this assembly directly, (except for tests, of course). -->
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Blazor.Server" />
<Reference Include="Microsoft.AspNetCore.Components.Server" />
<Reference Include="Microsoft.AspNetCore.ResponseCompression" />
<Reference Include="Microsoft.AspNetCore" />
<Reference Include="Microsoft.Extensions.CommandLineUtils.Sources" />
</ItemGroup>
<!--
Temporarily use hand-authored .nuspec file until we can use <FrameworkReference>
The hand-authored .nuspec file is to ensure it *doesn't* reference the shared
framework packages that aren't actually shipping as packages. We can remove this
once the nuspec generation accounts for <FrameworkReference>.
-->
<Target Name="PrepareNuSpecProperties" BeforeTargets="_IntermediatePack">
<PropertyGroup>
<NuspecFile>Microsoft.AspNetCore.Blazor.Cli.nuspec</NuspecFile>
<NuspecProperties>
outdir=$(OutDir);
componentsrootdir=..\..\..\;
blazorversion=$(PackageVersion);
aspnetcoreversion=$(ComponentsPackageVersion);
sharedfxversion=$(SharedFxVersion);
repositorycommit=$(SourceRevisionId);</NuspecProperties>
</PropertyGroup>
<!-- Also temporarily generate the runtimeconfig.json manually until we can use <FrameworkReference> -->
<Sdk_GenerateFileFromTemplate
TemplateFile="temporaryruntimeconfig.json"
Properties="$(NuspecProperties)"
OutputPath="$(OutDir)temporaryruntimeconfig.out.json">
</Sdk_GenerateFileFromTemplate>
</Target>
</Project>

View File

@ -1,9 +0,0 @@
{
"runtimeOptions": {
"tfm": "netcoreapp3.0",
"framework": {
"name": "Microsoft.AspNetCore.App",
"version": "${sharedfxversion}"
}
}
}

View File

@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Blazor.Cli.Commands
namespace Microsoft.AspNetCore.Blazor.DevServer.Commands
{
internal class ServeCommand : CommandLineApplication
{

View File

@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AssemblyName>blazor-devserver</AssemblyName>
<PackageId>Microsoft.AspNetCore.Blazor.DevServer</PackageId>
<IsShippingPackage>true</IsShippingPackage>
<HasReferenceAssembly>false</HasReferenceAssembly>
<StartupObject>Microsoft.AspNetCore.Blazor.DevServer.Program</StartupObject>
<Description>Development server for use when building Blazor applications.</Description>
<!-- Set this to false because assemblies should not reference this assembly directly, (except for tests, of course). -->
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Blazor.Server" />
<Reference Include="Microsoft.AspNetCore.Components.Server" />
<Reference Include="Microsoft.AspNetCore.ResponseCompression" />
<Reference Include="Microsoft.AspNetCore" />
<Reference Include="Microsoft.Extensions.CommandLineUtils.Sources" />
</ItemGroup>
<!-- Pack settings -->
<PropertyGroup>
<NoPackageAnalysis>true</NoPackageAnalysis>
<IntermediatePackDir>obj\publish\</IntermediatePackDir>
<PublishDir>$(IntermediatePackDir)$(TargetFramework)\</PublishDir>
<NuspecFile>Microsoft.AspNetCore.Blazor.DevServer.nuspec</NuspecFile>
</PropertyGroup>
<!-- Executes /t:Publish for all target frameworks before packing-->
<Target Name="PublishAll" BeforeTargets="_IntermediatePack">
<PropertyGroup>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<NuspecProperties>
packageId=$(PackageId);
description=$(Description);
publishDir=$([MSBuild]::NormalizeDirectory($(PublishDir)));
componentsrootdir=..\..\..\;
blazorversion=$(PackageVersion);
repositorycommit=$(SourceRevisionId);</NuspecProperties>
</PropertyGroup>
<ItemGroup>
<_TargetFramework Include="$(TargetFramework)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" Properties="TargetFramework=%(_TargetFramework.Identity)" />
</Target>
</Project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Microsoft.AspNetCore.Blazor.Cli</id>
<id>$packageId$</id>
<version>$blazorversion$</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
@ -9,24 +9,17 @@
<licenseUrl>https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt</licenseUrl>
<projectUrl>https://asp.net/</projectUrl>
<iconUrl>https://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
<description>Development server for use when building Blazor applications.
<description>$description$
This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/$repositorycommit$</description>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>aspnetcore components</tags>
<serviceable>true</serviceable>
<repository type="git" url="https://github.com/aspnet/AspNetCore" commit="$repositorycommit$" />
<dependencies>
<group targetFramework=".NETCoreApp3.0">
<dependency id="Microsoft.AspNetCore.Blazor.Server" version="$blazorversion$" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Components.Server" version="$aspnetcoreversion$" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.SpaServices.Extensions" version="$aspnetcoreversion$" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
<files>
<file src="$outdir$temporaryruntimeconfig.out.json" target="lib\netcoreapp3.0\dotnet-blazor.runtimeconfig.json" />
<file src="$outdir$dotnet-blazor.dll" target="lib\netcoreapp3.0\dotnet-blazor.dll" />
<file src="build\**" target="build" />
<file src="$publishDir$**\*" target="tools" />
<file src="$componentsrootdir$THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
</files>
</package>

View File

@ -1,10 +1,10 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Blazor.Cli.Commands;
using Microsoft.AspNetCore.Blazor.DevServer.Commands;
using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Blazor.Cli
namespace Microsoft.AspNetCore.Blazor.DevServer
{
internal class Program
{
@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Blazor.Cli
{
var app = new CommandLineApplication(throwOnUnexpectedArg: false)
{
Name = "blazor-cli"
Name = "blazor-devserver"
};
app.HelpOption("-?|-h|--help");

View File

@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
namespace Microsoft.AspNetCore.Blazor.Cli.Server
namespace Microsoft.AspNetCore.Blazor.DevServer.Server
{
// This project is a CLI tool, so we don't expect anyone to reference it
// as a runtime library. As such we consider it reasonable to mark the

View File

@ -13,7 +13,7 @@ using System.IO;
using System.Linq;
using System.Net.Mime;
namespace Microsoft.AspNetCore.Blazor.Cli.Server
namespace Microsoft.AspNetCore.Blazor.DevServer.Server
{
internal class Startup
{

View File

@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<_BlazorDevServerDll>$(MSBuildThisFileDirectory)../tools/blazor-devserver.dll</_BlazorDevServerDll>
<RunCommand>dotnet</RunCommand>
<RunArguments>$(_BlazorDevServerDll) serve</RunArguments>
</PropertyGroup>
</Project>

View File

@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Builder
/// </summary>
public static class BlazorApplicationBuilderExtensions
{
const string DevServerApplicationName = "dotnet-blazor";
const string DevServerApplicationName = "blazor-devserver";
/// <summary>
/// Configures the middleware pipeline to work with Blazor.

View File

@ -2,8 +2,6 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RunCommand>dotnet</RunCommand>
<RunArguments>blazor serve</RunArguments>
<RestoreAdditionalProjectSources Condition="'$(IncludeCustomRestoreSourcesSymbol)'=='true'">
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
@ -14,8 +12,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="$(TemplateBlazorPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="$(TemplateBlazorPackageVersion)" PrivateAssets="all" />
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="$(TemplateBlazorPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="$(TemplateBlazorPackageVersion)" PrivateAssets="all" />
</ItemGroup>
</Project>

View File

@ -19,7 +19,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Build.Tests", "Blazor\Build\test\Microsoft.AspNetCore.Blazor.Build.Tests.csproj", "{E38FDBB0-08C1-444E-A449-69C8A59D721B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Cli", "Blazor\Cli\src\Microsoft.AspNetCore.Blazor.Cli.csproj", "{A6C8050D-7C18-4585-ADCF-833AC1765847}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.DevServer", "Blazor\DevServer\src\Microsoft.AspNetCore.Blazor.DevServer.csproj", "{A6C8050D-7C18-4585-ADCF-833AC1765847}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.E2EPerformance", "Blazor\testassets\Microsoft.AspNetCore.Blazor.E2EPerformance\Microsoft.AspNetCore.Blazor.E2EPerformance.csproj", "{08773DD6-6FED-4BF2-BD9F-C19D2CF919BB}"
EndProject

View File

@ -131,16 +131,6 @@
}
}
},
"Microsoft.AspNetCore.Blazor.Cli": {
"Exclusions": {
"SIGN_STRONGNAME": {
"lib/netcoreapp3.0/dotnet-blazor.dll": "See comments in Microsoft.AspNetCore.Blazor.Cli.csproj"
},
"WRONG_PUBLICKEYTOKEN": {
"lib/netcoreapp3.0/dotnet-blazor.dll": "See comments in Microsoft.AspNetCore.Blazor.Cli.csproj"
}
}
},
"Microsoft.AspNetCore.Blazor.Templates": {
"Exclusions": {
"PACKAGE_MISSING_REPO_COMMIT": {

View File

@ -79,7 +79,7 @@ You can browse https://dotnet.myget.org/gallery/blazor-dev to find the current v
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="0.3.0-preview1-10220" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.3.0-preview1-10220" PrivateAssets="all" />
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="0.3.0-preview1-10220" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="0.3.0-preview1-10220" />
</ItemGroup>
```

View File

@ -1,6 +1,6 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Blazor.Cli, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Blazor.DevServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Components.Server.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]

View File

@ -3,7 +3,7 @@
using Microsoft.AspNetCore.Hosting;
using System.Collections.Generic;
using DevHostServerProgram = Microsoft.AspNetCore.Blazor.Cli.Server.Program;
using DevHostServerProgram = Microsoft.AspNetCore.Blazor.DevServer.Server.Program;
namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures
{

View File

@ -32,7 +32,7 @@
<ProjectReference Include="..\..\Blazor\testassets\MonoSanityClient\MonoSanityClient.csproj" />
<ProjectReference Include="..\..\Blazor\testassets\MonoSanity\MonoSanity.csproj" />
<ProjectReference Include="..\..\Blazor\testassets\StandaloneApp\StandaloneApp.csproj" />
<ProjectReference Include="..\..\Blazor\Cli\src\Microsoft.AspNetCore.Blazor.Cli.csproj" />
<ProjectReference Include="..\..\Blazor\DevServer\src\Microsoft.AspNetCore.Blazor.DevServer.csproj" />
<ProjectReference Include="..\testassets\ComponentsApp.App\ComponentsApp.App.csproj" />
<ProjectReference Include="..\testassets\ComponentsApp.Server\ComponentsApp.Server.csproj" />
<ProjectReference Include="..\testassets\BasicTestApp\BasicTestApp.csproj" />