diff --git a/.appveyor.yml b/.appveyor.yml
index 73071d19bd..7f621f2e90 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -16,13 +16,13 @@ test: 'off'
deploy: 'off'
os: Visual Studio 2017 Preview
build_script:
- - build.cmd /p:SkipTests=true
+ - build.cmd /p:SkipTests=true /p:BlazorOutputStatistics=true
before_test:
- choco install googlechrome --ignore-checksum
- npm install -g selenium-standalone
- selenium-standalone install
- ps: $SeleniumProcess = Start-Process "selenium-standalone" -ArgumentList "start" -PassThru
test_script:
- - build.cmd /t:Test /p:BlazorAllTests=true
+ - build.cmd /t:Test /p:BlazorAllTests=true /p:BlazorOutputStatistics=true
after_test:
- ps: Stop-Process -Id $SeleniumProcess.Id
diff --git a/.gitignore b/.gitignore
index 23cf891bc7..9b152674da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ obj/
launchSettings.json
artifacts/
msbuild.binlog
+.vscode/
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index c116645850..69592e6a5a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -36,6 +36,6 @@ install:
- curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current --version latest --install-dir "$DOTNET_INSTALL_DIR"
- export PATH="$DOTNET_INSTALL_DIR:$PATH"
script:
- - ./build.sh /p:SkipTests=true
+ - ./build.sh /p:SkipTests=true /p:BlazorOutputStatistics=true
- selenium-standalone start &
- ./build.sh /t:Test /p:BlazorAllTests=true
diff --git a/Blazor.sln b/Blazor.sln
index 25459a67fa..c1c5691370 100644
--- a/Blazor.sln
+++ b/Blazor.sln
@@ -12,16 +12,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mono", "mono", "{7B5CAAB1-A
src\mono\mono.targets = src\mono\mono.targets
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Mono", "src\Microsoft.AspNetCore.Blazor.Mono\Microsoft.AspNetCore.Blazor.Mono.csproj", "{39FEC72D-AF52-47A3-B63D-7BF0E4335248}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonoSanity", "samples\MonoSanity\MonoSanity.csproj", "{7C53BB6B-5906-4753-B507-C9FCC2F7E5B7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Server", "src\Microsoft.AspNetCore.Blazor.Server\Microsoft.AspNetCore.Blazor.Server.csproj", "{5A694793-3257-4D37-BB74-4A41B3894685}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{ADA3AE29-F6DE-49F6-8C7C-B321508CAE8E}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Mono.Test", "test\Microsoft.AspNetCore.Blazor.Mono.Test\Microsoft.AspNetCore.Blazor.Mono.Test.csproj", "{118484D3-3993-45CE-97C1-6F28A517529B}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.E2ETest", "test\Microsoft.AspNetCore.Blazor.E2ETest\Microsoft.AspNetCore.Blazor.E2ETest.csproj", "{5BC2A10D-B6CA-43AE-B73C-2A41AE1039F9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonoSanityClient", "samples\MonoSanityClient\MonoSanityClient.csproj", "{06AAAE9E-96DE-4574-97DA-9C4C7D9FE990}"
@@ -40,10 +36,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StandaloneApp", "samples\St
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MonoSanity", "MonoSanity", "{2A076721-6081-4517-8329-B9E5110D6DAC}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Common", "src\Microsoft.AspNetCore.Blazor.Common\Microsoft.AspNetCore.Blazor.Common.csproj", "{21EF76A4-63CC-455D-907C-F86C9E442CEC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Common.Test", "test\Microsoft.AspNetCore.Blazor.Common.Test\Microsoft.AspNetCore.Blazor.Common.Test.csproj", "{7F0BF3EA-6985-49F6-8070-0BBA41448BB0}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Build.Test", "test\Microsoft.AspNetCore.Blazor.Build.Test\Microsoft.AspNetCore.Blazor.Build.Test.csproj", "{709C7EBE-EB93-4F6D-9491-D714B0D2E898}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Build", "src\Microsoft.AspNetCore.Blazor.Build\Microsoft.AspNetCore.Blazor.Build.csproj", "{8B3D0F1C-0E38-4E6D-BFF1-C4FDA0CD9815}"
@@ -103,14 +95,6 @@ Global
ReleaseNoVSIX|Any CPU = ReleaseNoVSIX|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248}.Release|Any CPU.Build.0 = Release|Any CPU
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{7C53BB6B-5906-4753-B507-C9FCC2F7E5B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C53BB6B-5906-4753-B507-C9FCC2F7E5B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C53BB6B-5906-4753-B507-C9FCC2F7E5B7}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
@@ -127,14 +111,6 @@ Global
{5A694793-3257-4D37-BB74-4A41B3894685}.Release|Any CPU.Build.0 = Release|Any CPU
{5A694793-3257-4D37-BB74-4A41B3894685}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{5A694793-3257-4D37-BB74-4A41B3894685}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {118484D3-3993-45CE-97C1-6F28A517529B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {118484D3-3993-45CE-97C1-6F28A517529B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {118484D3-3993-45CE-97C1-6F28A517529B}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {118484D3-3993-45CE-97C1-6F28A517529B}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {118484D3-3993-45CE-97C1-6F28A517529B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {118484D3-3993-45CE-97C1-6F28A517529B}.Release|Any CPU.Build.0 = Release|Any CPU
- {118484D3-3993-45CE-97C1-6F28A517529B}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {118484D3-3993-45CE-97C1-6F28A517529B}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{5BC2A10D-B6CA-43AE-B73C-2A41AE1039F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BC2A10D-B6CA-43AE-B73C-2A41AE1039F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BC2A10D-B6CA-43AE-B73C-2A41AE1039F9}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
@@ -191,22 +167,6 @@ Global
{B241434A-1642-44CC-AE9A-2012B5C5BD02}.Release|Any CPU.Build.0 = Release|Any CPU
{B241434A-1642-44CC-AE9A-2012B5C5BD02}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{B241434A-1642-44CC-AE9A-2012B5C5BD02}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {21EF76A4-63CC-455D-907C-F86C9E442CEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {21EF76A4-63CC-455D-907C-F86C9E442CEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {21EF76A4-63CC-455D-907C-F86C9E442CEC}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {21EF76A4-63CC-455D-907C-F86C9E442CEC}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {21EF76A4-63CC-455D-907C-F86C9E442CEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {21EF76A4-63CC-455D-907C-F86C9E442CEC}.Release|Any CPU.Build.0 = Release|Any CPU
- {21EF76A4-63CC-455D-907C-F86C9E442CEC}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {21EF76A4-63CC-455D-907C-F86C9E442CEC}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0}.Release|Any CPU.Build.0 = Release|Any CPU
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{709C7EBE-EB93-4F6D-9491-D714B0D2E898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{709C7EBE-EB93-4F6D-9491-D714B0D2E898}.Debug|Any CPU.Build.0 = Debug|Any CPU
{709C7EBE-EB93-4F6D-9491-D714B0D2E898}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
@@ -347,10 +307,8 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7B5CAAB1-A3EB-44F7-87E3-A13ED89FC17D} = {B867E038-B3CE-43E3-9292-61568C46CDEB}
- {39FEC72D-AF52-47A3-B63D-7BF0E4335248} = {B867E038-B3CE-43E3-9292-61568C46CDEB}
{7C53BB6B-5906-4753-B507-C9FCC2F7E5B7} = {2A076721-6081-4517-8329-B9E5110D6DAC}
{5A694793-3257-4D37-BB74-4A41B3894685} = {B867E038-B3CE-43E3-9292-61568C46CDEB}
- {118484D3-3993-45CE-97C1-6F28A517529B} = {ADA3AE29-F6DE-49F6-8C7C-B321508CAE8E}
{5BC2A10D-B6CA-43AE-B73C-2A41AE1039F9} = {ADA3AE29-F6DE-49F6-8C7C-B321508CAE8E}
{06AAAE9E-96DE-4574-97DA-9C4C7D9FE990} = {2A076721-6081-4517-8329-B9E5110D6DAC}
{BB34336F-E68E-4411-9805-CAAA919F5EA1} = {B867E038-B3CE-43E3-9292-61568C46CDEB}
@@ -360,8 +318,6 @@ Global
{7FD8C650-74B3-4153-AEA1-00F4F6AF393D} = {B867E038-B3CE-43E3-9292-61568C46CDEB}
{B241434A-1642-44CC-AE9A-2012B5C5BD02} = {F5FDD4E5-6A52-4A86-BE5E-5E42CB1DC8DA}
{2A076721-6081-4517-8329-B9E5110D6DAC} = {F5FDD4E5-6A52-4A86-BE5E-5E42CB1DC8DA}
- {21EF76A4-63CC-455D-907C-F86C9E442CEC} = {B867E038-B3CE-43E3-9292-61568C46CDEB}
- {7F0BF3EA-6985-49F6-8070-0BBA41448BB0} = {ADA3AE29-F6DE-49F6-8C7C-B321508CAE8E}
{709C7EBE-EB93-4F6D-9491-D714B0D2E898} = {ADA3AE29-F6DE-49F6-8C7C-B321508CAE8E}
{8B3D0F1C-0E38-4E6D-BFF1-C4FDA0CD9815} = {B867E038-B3CE-43E3-9292-61568C46CDEB}
{8A19B1CE-9B62-4440-93B3-152DDBB39D0A} = {B867E038-B3CE-43E3-9292-61568C46CDEB}
diff --git a/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj b/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj
index 6e1a1b5904..736c817a6f 100644
--- a/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj
+++ b/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj
@@ -3,6 +3,7 @@
netstandard2.0
Exe
+ true
diff --git a/samples/MonoSanityClient/MonoSanityClient.csproj b/samples/MonoSanityClient/MonoSanityClient.csproj
index dce14f8fe8..e111ca166b 100644
--- a/samples/MonoSanityClient/MonoSanityClient.csproj
+++ b/samples/MonoSanityClient/MonoSanityClient.csproj
@@ -1,8 +1,9 @@
-
+
netstandard2.0
false
+ false
diff --git a/samples/StandaloneApp/StandaloneApp.csproj b/samples/StandaloneApp/StandaloneApp.csproj
index 253651db56..8e6c89d340 100644
--- a/samples/StandaloneApp/StandaloneApp.csproj
+++ b/samples/StandaloneApp/StandaloneApp.csproj
@@ -2,7 +2,7 @@
netstandard2.0
-
+ true
dotnet
run --project ../../src/Microsoft.AspNetCore.Blazor.Cli serve
diff --git a/src/Microsoft.AspNetCore.Blazor.Browser.JS/BlazorBrowserFileProvider.cs b/src/Microsoft.AspNetCore.Blazor.Browser.JS/BlazorBrowserFileProvider.cs
deleted file mode 100644
index b14d18d5c9..0000000000
--- a/src/Microsoft.AspNetCore.Blazor.Browser.JS/BlazorBrowserFileProvider.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.Internal.Common.FileProviders;
-using Microsoft.Extensions.FileProviders;
-
-namespace Microsoft.AspNetCore.Blazor.Browser.JS
-{
- public static class BlazorBrowserFileProvider
- {
- public static IFileProvider Instance = new EmbeddedResourceFileProvider(
- typeof(BlazorBrowserFileProvider).Assembly,
- "blazor.");
- }
-}
diff --git a/src/Microsoft.AspNetCore.Blazor.Browser.JS/Microsoft.AspNetCore.Blazor.Browser.JS.csproj b/src/Microsoft.AspNetCore.Blazor.Browser.JS/Microsoft.AspNetCore.Blazor.Browser.JS.csproj
index b475b5b7d7..eeef6cbf15 100644
--- a/src/Microsoft.AspNetCore.Blazor.Browser.JS/Microsoft.AspNetCore.Blazor.Browser.JS.csproj
+++ b/src/Microsoft.AspNetCore.Blazor.Browser.JS/Microsoft.AspNetCore.Blazor.Browser.JS.csproj
@@ -15,10 +15,6 @@
-
-
-
-
diff --git a/src/Microsoft.AspNetCore.Blazor.Browser.JS/package-lock.json b/src/Microsoft.AspNetCore.Blazor.Browser.JS/package-lock.json
index cf7f6a5473..b74213bea2 100644
--- a/src/Microsoft.AspNetCore.Blazor.Browser.JS/package-lock.json
+++ b/src/Microsoft.AspNetCore.Blazor.Browser.JS/package-lock.json
@@ -1830,15 +1830,6 @@
"xtend": "4.0.1"
}
},
- "string_decoder": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
- "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
- "dev": true,
- "requires": {
- "safe-buffer": "5.1.1"
- }
- },
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
@@ -1872,6 +1863,15 @@
}
}
},
+ "string_decoder": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
+ "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "5.1.1"
+ }
+ },
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
diff --git a/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/BuildCommand.cs b/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/BuildCommand.cs
deleted file mode 100644
index 771611e332..0000000000
--- a/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/BuildCommand.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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.Core;
-using Microsoft.Extensions.CommandLineUtils;
-using System;
-
-namespace Microsoft.AspNetCore.Blazor.Build.Cli.Commands
-{
- internal class BuildCommand
- {
- public static void Command(CommandLineApplication command)
- {
- var clientAssemblyPath = command.Argument("assembly",
- "Specifies the assembly for the Blazor application.");
- var webRootPath = command.Option("--webroot",
- "Specifies the path to the directory containing static files to be served",
- CommandOptionType.SingleValue);
-
- command.OnExecute(() =>
- {
- if (string.IsNullOrEmpty(clientAssemblyPath.Value))
- {
- Console.WriteLine($"ERROR: No value specified for required argument '{clientAssemblyPath.Name}'.");
- return 1;
- }
-
- try
- {
- Console.WriteLine($"Building Blazor app from {clientAssemblyPath.Value}...");
- AppBuilder.Execute(clientAssemblyPath.Value, webRootPath.HasValue() ? webRootPath.Value() : null);
- return 0;
- }
- catch (Exception ex)
- {
- Console.WriteLine($"ERROR: {ex.Message}");
- Console.WriteLine(ex.StackTrace);
- return 1;
- }
- });
- }
- }
-}
diff --git a/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/BuildIndexHtmlCommand.cs b/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/BuildIndexHtmlCommand.cs
new file mode 100644
index 0000000000..02e188c1cb
--- /dev/null
+++ b/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/BuildIndexHtmlCommand.cs
@@ -0,0 +1,51 @@
+// 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;
+using Microsoft.Extensions.CommandLineUtils;
+
+namespace Microsoft.AspNetCore.Blazor.Build.Cli.Commands
+{
+ internal class BuildIndexHtmlCommand
+ {
+ public static void Command(CommandLineApplication command)
+ {
+ var clientPage = command.Option("--html-page",
+ "Path to the HTML Page containing the Blazor bootstrap script tag.",
+ CommandOptionType.SingleValue);
+
+ var references = command.Option("--reference",
+ "The path from the _bin folder to a given referenced dll file (Typically just the dll name)",
+ CommandOptionType.MultipleValue);
+
+ var outputPath = command.Option("--output",
+ "Path to the output file",
+ CommandOptionType.SingleValue);
+
+ var mainAssemblyPath = command.Argument("assembly",
+ "Path to the assembly containing the entry point of the application.");
+
+ command.OnExecute(() =>
+ {
+ if (string.IsNullOrEmpty(mainAssemblyPath.Value) ||
+ !clientPage.HasValue() || !references.HasValue() || !outputPath.HasValue())
+ {
+ command.ShowHelp(command.Name);
+ return 1;
+ }
+
+ try
+ {
+ IndexHtmlWriter.UpdateIndex(clientPage.Value(), mainAssemblyPath.Value, references.Values.ToArray(), outputPath.Value());
+ return 0;
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"ERROR: {ex.Message}");
+ Console.WriteLine(ex.StackTrace);
+ return 1;
+ }
+ });
+ }
+ }
+}
diff --git a/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/ResolveRuntimeDependenciesCommand.cs b/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/ResolveRuntimeDependenciesCommand.cs
new file mode 100644
index 0000000000..4a892f2872
--- /dev/null
+++ b/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/ResolveRuntimeDependenciesCommand.cs
@@ -0,0 +1,56 @@
+// 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;
+using Microsoft.Extensions.CommandLineUtils;
+
+namespace Microsoft.AspNetCore.Blazor.Build.Cli.Commands
+{
+ class ResolveRuntimeDependenciesCommand
+ {
+ public static void Command(CommandLineApplication command)
+ {
+ var references = command.Option("--reference",
+ "Full path to a referenced assembly file",
+ CommandOptionType.MultipleValue);
+
+ var baseClassLibrary = command.Option("--base-class-library",
+ "Full path to a directory in which BCL assemblies can be found",
+ CommandOptionType.MultipleValue);
+
+ var outputPath = command.Option("--output",
+ "Path to the output file that will contain the list with the full paths of the resolved assemblies",
+ CommandOptionType.SingleValue);
+
+ var mainAssemblyPath = command.Argument("assembly",
+ "Path to the assembly containing the entry point of the application.");
+
+ command.OnExecute(() =>
+ {
+ if (string.IsNullOrEmpty(mainAssemblyPath.Value) ||
+ !baseClassLibrary.HasValue() || !outputPath.HasValue())
+ {
+ command.ShowHelp(command.Name);
+ return 1;
+ }
+
+ try
+ {
+ RuntimeDependenciesResolver.ResolveRuntimeDependencies(
+ mainAssemblyPath.Value,
+ references.Values.ToArray(),
+ baseClassLibrary.Values.ToArray(),
+ outputPath.Value());
+
+ return 0;
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"ERROR: {ex.Message}");
+ Console.WriteLine(ex.StackTrace);
+ return 1;
+ }
+ });
+ }
+ }
+}
diff --git a/src/Microsoft.AspNetCore.Blazor.Build/Cli/Program.cs b/src/Microsoft.AspNetCore.Blazor.Build/Cli/Program.cs
index d8022c7ce7..db72e2ba8f 100644
--- a/src/Microsoft.AspNetCore.Blazor.Build/Cli/Program.cs
+++ b/src/Microsoft.AspNetCore.Blazor.Build/Cli/Program.cs
@@ -16,7 +16,8 @@ namespace Microsoft.AspNetCore.Blazor.Build
};
app.HelpOption("-?|-h|--help");
- app.Command("build", BuildCommand.Command);
+ app.Command("build", BuildIndexHtmlCommand.Command);
+ app.Command("resolve-dependencies", ResolveRuntimeDependenciesCommand.Command);
if (args.Length > 0)
{
diff --git a/src/Microsoft.AspNetCore.Blazor.Build/Core/AppBuilder.cs b/src/Microsoft.AspNetCore.Blazor.Build/Core/AppBuilder.cs
deleted file mode 100644
index 041e2648d0..0000000000
--- a/src/Microsoft.AspNetCore.Blazor.Build/Core/AppBuilder.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// 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.Core.FileSystem;
-using System.IO;
-
-namespace Microsoft.AspNetCore.Blazor.Build.Core
-{
- internal static class AppBuilder
- {
- internal static void Execute(string assemblyPath, string webRootPath)
- {
- var clientFileSystem = new ClientFileProvider(assemblyPath, webRootPath);
- var distDirPath = Path.Combine(Path.GetDirectoryName(assemblyPath), "dist");
- FileUtil.WriteFileProviderToDisk(clientFileSystem, distDirPath, clean: true);
- }
- }
-}
diff --git a/src/Microsoft.AspNetCore.Blazor.Build/Core/FileSystem/ClientFileProvider.cs b/src/Microsoft.AspNetCore.Blazor.Build/Core/FileSystem/ClientFileProvider.cs
deleted file mode 100644
index 8ff6e301e7..0000000000
--- a/src/Microsoft.AspNetCore.Blazor.Build/Core/FileSystem/ClientFileProvider.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-// 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.Internal.Common.FileProviders;
-using Microsoft.Extensions.FileProviders;
-using Mono.Cecil;
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Microsoft.AspNetCore.Blazor.Build.Core.FileSystem
-{
- internal class ClientFileProvider : CompositeMountedFileProvider
- {
- public ClientFileProvider(string clientAssemblyPath, string webRootPath)
- : base(GetContents(clientAssemblyPath, webRootPath))
- {
- }
-
- private static (string, IFileProvider)[] GetContents(string clientAssemblyPath, string webRootPath)
- {
- var fileProviders = new List<(string, IFileProvider)>();
-
- // There must always be a client assembly, and we always supply a /_framework
- // directory containing everything needed to execute it
- if (!File.Exists(clientAssemblyPath))
- {
- throw new FileNotFoundException($"Could not find client assembly file at '{clientAssemblyPath}'.", clientAssemblyPath);
- }
- var frameworkFileProvider = new FrameworkFileProvider(clientAssemblyPath);
- fileProviders.Add(("/_framework", frameworkFileProvider));
-
- // The web root directory is optional. If it exists and contains /index.html, then
- // we will inject the relevant ";
- var htmlTemplateSuffix = @"
-