Include "serve" command in dotnet-blazor tool
This commit is contained in:
parent
c255e77ab5
commit
9d21eda9c4
|
|
@ -0,0 +1,22 @@
|
|||
// 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 System.Linq;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor.Build.Cli.Commands
|
||||
{
|
||||
internal class ServeDevHost
|
||||
{
|
||||
public static void Command(CommandLineApplication command, string[] args)
|
||||
{
|
||||
command.OnExecute(() =>
|
||||
{
|
||||
var remainingArgs = args.Skip(1).ToArray();
|
||||
DevHost.Server.Program.BuildWebHost(remainingArgs).Run();
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -12,12 +12,13 @@ namespace Microsoft.AspNetCore.Blazor.Build
|
|||
{
|
||||
var app = new CommandLineApplication
|
||||
{
|
||||
Name = "dotnet-blazorbuild"
|
||||
Name = "dotnet-blazor"
|
||||
};
|
||||
app.HelpOption("-?|-h|--help");
|
||||
|
||||
app.Command("build", BuildCommand.Command);
|
||||
app.Command("buildrazor", BuildRazorCommand.Command);
|
||||
app.Command("serve", command => ServeDevHost.Command(command, args));
|
||||
|
||||
if (args.Length > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<OutDir>tools</OutDir>
|
||||
<AssemblyName>dotnet-blazor</AssemblyName>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.AspNetCore.Blazor.Browser.JS\Microsoft.AspNetCore.Blazor.Browser.JS.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.AspNetCore.Blazor.DevHost\Microsoft.AspNetCore.Blazor.DevHost.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.AspNetCore.Blazor.Mono\Microsoft.AspNetCore.Blazor.Mono.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.AspNetCore.Blazor.Razor.Extensions\Microsoft.AspNetCore.Blazor.Razor.Extensions.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.AspNetCore.Blazor\Microsoft.AspNetCore.Blazor.csproj" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<BlazorBuildExe>dotnet "$(MSBuildThisFileDirectory)../tools/Microsoft.AspNetCore.Blazor.Build.dll"</BlazorBuildExe>
|
||||
<BlazorBuildExe>dotnet "$(MSBuildThisFileDirectory)../tools/dotnet-blazor.dll"</BlazorBuildExe>
|
||||
|
||||
<!-- The Blazor build code can only find your referenced assemblies if they are in the output directory -->
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
// 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;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor.DevHost.Server
|
||||
{
|
||||
internal class Program
|
||||
public class Program
|
||||
{
|
||||
internal static IWebHost BuildWebHost(string[] args) =>
|
||||
public static IWebHost BuildWebHost(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseConfiguration(new ConfigurationBuilder()
|
||||
.AddCommandLine(args)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace AngleSharpBuilder
|
|||
var assemblyLocation = assembly.Location;
|
||||
var moduleDefinition = ModuleDefinition.ReadModule(assemblyLocation);
|
||||
|
||||
AddInternalsVisibleTo(moduleDefinition, "Microsoft.AspNetCore.Blazor.Build");
|
||||
AddInternalsVisibleTo(moduleDefinition, "dotnet-blazor");
|
||||
AddInternalsVisibleTo(moduleDefinition, "Microsoft.AspNetCore.Blazor.Razor.Extensions");
|
||||
RemoveStrongName(moduleDefinition);
|
||||
SetAssemblyName(moduleDefinition, "Microsoft.AspNetCore.Blazor.AngleSharp");
|
||||
|
|
|
|||
Loading…
Reference in New Issue