Skip to content

Commit e822f5f

Browse files
authored
Create a Blazor WebAssembly SDK (#24044)
1 parent 5266918 commit e822f5f

File tree

84 files changed

+2625
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2625
-72
lines changed

AspNetCore.sln

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Compon
14271427
EndProject
14281428
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.Web.Extensions.Tests", "src\Components\Web.Extensions\test\Microsoft.AspNetCore.Components.Web.Extensions.Tests.csproj", "{157605CB-5170-4C1A-980F-4BAE42DB60DE}"
14291429
EndProject
1430+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sdk", "Sdk", "{FED4267E-E5E4-49C5-98DB-8B3F203596EE}"
1431+
EndProject
1432+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Sdk.BlazorWebAssembly", "src\Components\WebAssembly\Sdk\src\Microsoft.NET.Sdk.BlazorWebAssembly.csproj", "{6B2734BF-C61D-4889-ABBF-456A4075D59B}"
1433+
EndProject
1434+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Sdk.BlazorWebAssembly.Tests", "src\Components\WebAssembly\Sdk\test\Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj", "{83371889-9A3E-4D16-AE77-EB4F83BC6374}"
1435+
EndProject
1436+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests", "src\Components\WebAssembly\Sdk\integrationtests\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj", "{525EBCB4-A870-470B-BC90-845306C337D1}"
1437+
EndProject
1438+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Sdk.BlazorWebAssembly.Tools", "src\Components\WebAssembly\Sdk\tools\Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj", "{175E5CD8-92D4-46BB-882E-3A930D3302D4}"
1439+
EndProject
14301440
Global
14311441
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14321442
Debug|Any CPU = Debug|Any CPU
@@ -6729,6 +6739,54 @@ Global
67296739
{157605CB-5170-4C1A-980F-4BAE42DB60DE}.Release|x64.Build.0 = Release|Any CPU
67306740
{157605CB-5170-4C1A-980F-4BAE42DB60DE}.Release|x86.ActiveCfg = Release|Any CPU
67316741
{157605CB-5170-4C1A-980F-4BAE42DB60DE}.Release|x86.Build.0 = Release|Any CPU
6742+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6743+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|Any CPU.Build.0 = Debug|Any CPU
6744+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|x64.ActiveCfg = Debug|Any CPU
6745+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|x64.Build.0 = Debug|Any CPU
6746+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|x86.ActiveCfg = Debug|Any CPU
6747+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|x86.Build.0 = Debug|Any CPU
6748+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|Any CPU.ActiveCfg = Release|Any CPU
6749+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|Any CPU.Build.0 = Release|Any CPU
6750+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|x64.ActiveCfg = Release|Any CPU
6751+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|x64.Build.0 = Release|Any CPU
6752+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|x86.ActiveCfg = Release|Any CPU
6753+
{6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|x86.Build.0 = Release|Any CPU
6754+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6755+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|Any CPU.Build.0 = Debug|Any CPU
6756+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|x64.ActiveCfg = Debug|Any CPU
6757+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|x64.Build.0 = Debug|Any CPU
6758+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|x86.ActiveCfg = Debug|Any CPU
6759+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|x86.Build.0 = Debug|Any CPU
6760+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|Any CPU.ActiveCfg = Release|Any CPU
6761+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|Any CPU.Build.0 = Release|Any CPU
6762+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|x64.ActiveCfg = Release|Any CPU
6763+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|x64.Build.0 = Release|Any CPU
6764+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|x86.ActiveCfg = Release|Any CPU
6765+
{83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|x86.Build.0 = Release|Any CPU
6766+
{525EBCB4-A870-470B-BC90-845306C337D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6767+
{525EBCB4-A870-470B-BC90-845306C337D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
6768+
{525EBCB4-A870-470B-BC90-845306C337D1}.Debug|x64.ActiveCfg = Debug|Any CPU
6769+
{525EBCB4-A870-470B-BC90-845306C337D1}.Debug|x64.Build.0 = Debug|Any CPU
6770+
{525EBCB4-A870-470B-BC90-845306C337D1}.Debug|x86.ActiveCfg = Debug|Any CPU
6771+
{525EBCB4-A870-470B-BC90-845306C337D1}.Debug|x86.Build.0 = Debug|Any CPU
6772+
{525EBCB4-A870-470B-BC90-845306C337D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
6773+
{525EBCB4-A870-470B-BC90-845306C337D1}.Release|Any CPU.Build.0 = Release|Any CPU
6774+
{525EBCB4-A870-470B-BC90-845306C337D1}.Release|x64.ActiveCfg = Release|Any CPU
6775+
{525EBCB4-A870-470B-BC90-845306C337D1}.Release|x64.Build.0 = Release|Any CPU
6776+
{525EBCB4-A870-470B-BC90-845306C337D1}.Release|x86.ActiveCfg = Release|Any CPU
6777+
{525EBCB4-A870-470B-BC90-845306C337D1}.Release|x86.Build.0 = Release|Any CPU
6778+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6779+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
6780+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|x64.ActiveCfg = Debug|Any CPU
6781+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|x64.Build.0 = Debug|Any CPU
6782+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|x86.ActiveCfg = Debug|Any CPU
6783+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|x86.Build.0 = Debug|Any CPU
6784+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
6785+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|Any CPU.Build.0 = Release|Any CPU
6786+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|x64.ActiveCfg = Release|Any CPU
6787+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|x64.Build.0 = Release|Any CPU
6788+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|x86.ActiveCfg = Release|Any CPU
6789+
{175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|x86.Build.0 = Release|Any CPU
67326790
EndGlobalSection
67336791
GlobalSection(SolutionProperties) = preSolution
67346792
HideSolutionNode = FALSE
@@ -7444,6 +7502,11 @@ Global
74447502
{F71FE795-9923-461B-9809-BB1821A276D0} = {60D51C98-2CC0-40DF-B338-44154EFEE2FF}
74457503
{8294A74F-7DAA-4B69-BC56-7634D93C9693} = {F71FE795-9923-461B-9809-BB1821A276D0}
74467504
{157605CB-5170-4C1A-980F-4BAE42DB60DE} = {F71FE795-9923-461B-9809-BB1821A276D0}
7505+
{FED4267E-E5E4-49C5-98DB-8B3F203596EE} = {562D5067-8CD8-4F19-BCBB-873204932C61}
7506+
{6B2734BF-C61D-4889-ABBF-456A4075D59B} = {FED4267E-E5E4-49C5-98DB-8B3F203596EE}
7507+
{83371889-9A3E-4D16-AE77-EB4F83BC6374} = {FED4267E-E5E4-49C5-98DB-8B3F203596EE}
7508+
{525EBCB4-A870-470B-BC90-845306C337D1} = {FED4267E-E5E4-49C5-98DB-8B3F203596EE}
7509+
{175E5CD8-92D4-46BB-882E-3A930D3302D4} = {FED4267E-E5E4-49C5-98DB-8B3F203596EE}
74477510
EndGlobalSection
74487511
GlobalSection(ExtensibilityGlobals) = postSolution
74497512
SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F}

eng/Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
@(ProjectToBuild);
173173
@(ProjectToExclude);
174174
$(RepoRoot)src\Razor\test\testassets\**\*.*proj;
175+
$(RepoRoot)src\Components\WebAssembly\Sdk\testassets\**\*.*proj;
175176
$(RepoRoot)**\node_modules\**\*;
176177
$(RepoRoot)**\bin\**\*;
177178
$(RepoRoot)**\obj\**\*;"

eng/ProjectReferences.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Components.Web.Extensions" ProjectPath="$(RepoRoot)src\Components\Web.Extensions\src\Microsoft.AspNetCore.Components.Web.Extensions.csproj" />
146146
<ProjectReferenceProvider Include="Microsoft.Authentication.WebAssembly.Msal" ProjectPath="$(RepoRoot)src\Components\WebAssembly\Authentication.Msal\src\Microsoft.Authentication.WebAssembly.Msal.csproj" />
147147
<ProjectReferenceProvider Include="Microsoft.JSInterop.WebAssembly" ProjectPath="$(RepoRoot)src\Components\WebAssembly\JSInterop\src\Microsoft.JSInterop.WebAssembly.csproj" />
148+
<ProjectReferenceProvider Include="Microsoft.NET.Sdk.BlazorWebAssembly" ProjectPath="$(RepoRoot)src\Components\WebAssembly\Sdk\src\Microsoft.NET.Sdk.BlazorWebAssembly.csproj" />
148149
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Components.WebAssembly.Server" ProjectPath="$(RepoRoot)src\Components\WebAssembly\Server\src\Microsoft.AspNetCore.Components.WebAssembly.Server.csproj" />
149150
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" ProjectPath="$(RepoRoot)src\Components\WebAssembly\WebAssembly.Authentication\src\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj" />
150151
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Components.WebAssembly" ProjectPath="$(RepoRoot)src\Components\WebAssembly\WebAssembly\src\Microsoft.AspNetCore.Components.WebAssembly.csproj" />

src/Components/Components.slnf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@
110110
"src\\Components\\WebAssembly\\WebAssembly.Authentication\\test\\Microsoft.AspNetCore.Components.WebAssembly.Authentication.Tests.csproj",
111111
"src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Client\\Wasm.Authentication.Client.csproj",
112112
"src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Shared\\Wasm.Authentication.Shared.csproj",
113+
"src\\Components\\WebAssembly\\Sdk\\src\\Microsoft.NET.Sdk.BlazorWebAssembly.csproj",
114+
"src\\Components\\WebAssembly\\Sdk\\test\\Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj",
115+
"src\\Components\\WebAssembly\\Sdk\\integrationtests\\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj",
113116
"src\\JSInterop\\Microsoft.JSInterop\\src\\Microsoft.JSInterop.csproj"
114117
]
115118
}

src/Components/ComponentsNoDeps.slnf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
"src\\Components\\WebAssembly\\testassets\\HostedInAspNet.Client\\HostedInAspNet.Client.csproj",
3232
"src\\Components\\WebAssembly\\testassets\\HostedInAspNet.Server\\HostedInAspNet.Server.csproj",
3333
"src\\Components\\WebAssembly\\testassets\\StandaloneApp\\StandaloneApp.csproj",
34+
"src\\Components\\WebAssembly\\Sdk\\src\\Microsoft.NET.Sdk.BlazorWebAssembly.csproj",
35+
"src\\Components\\WebAssembly\\Sdk\\test\\Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj",
36+
"src\\Components\\WebAssembly\\Sdk\\tools\\Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj",
37+
"src\\Components\\WebAssembly\\Sdk\\integrationtests\\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj",
3438
"src\\Components\\Web\\src\\Microsoft.AspNetCore.Components.Web.csproj",
3539
"src\\Components\\Web\\test\\Microsoft.AspNetCore.Components.Web.Tests.csproj",
3640
"src\\Components\\benchmarkapps\\Wasm.Performance\\Driver\\Wasm.Performance.Driver.csproj",

src/Components/Directory.Build.props

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<Project>
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
33

4-
<PropertyGroup>
5-
<!-- Workaround for https://github.com/dotnet/aspnetcore/issues/5486 which requires the bin and obj directory be in the project directory -->
6-
<BaseIntermediateOutputPath />
7-
<IntermediateOutputPath />
8-
<BaseOutputPath />
9-
<OutputPath />
10-
</PropertyGroup>
11-
124
<PropertyGroup>
135
<EnableTypeScriptNuGetTarget>true</EnableTypeScriptNuGetTarget>
146
</PropertyGroup>

src/Components/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<BlazorWebAssemblyJSPath>$(RepoRoot)src\Components\Web.JS\dist\$(Configuration)\blazor.webassembly.js</BlazorWebAssemblyJSPath>
44
<BlazorWebAssemblyJSMapPath>$(BlazorWebAssemblyJSPath).map</BlazorWebAssemblyJSMapPath>
55

6-
<_BlazorDevServerPath>$(RepoRoot)src/Components/WebAssembly/DevServer/src/bin/$(Configuration)/$(DefaultNetCoreTargetFramework)/blazor-devserver.dll</_BlazorDevServerPath>
6+
<_BlazorDevServerPath>$(ArtifactsDir)/bin/Microsoft.AspNetCore.Components.WebAssembly.DevServer/$(Configuration)/$(DefaultNetCoreTargetFramework)/blazor-devserver.dll</_BlazorDevServerPath>
77
<RunCommand>dotnet</RunCommand>
88
<RunArguments>exec &quot;$(_BlazorDevServerPath)&quot; serve --applicationpath &quot;$(TargetPath)&quot; $(AdditionalRunArguments)</RunArguments>
99
</PropertyGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<!--
5+
There's not much value in multi-targeting here, this doesn't run much .NET code, it tests MSBuild.
6+
7+
This is also a partial workaround for https://github.com/Microsoft/msbuild/issues/2661 - this project
8+
has netcoreapp dependencies that need to be built first.
9+
-->
10+
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
11+
<PreserveCompilationContext>true</PreserveCompilationContext>
12+
13+
<!-- Tests do not work on Helix yet -->
14+
<BuildHelixPayload>false</BuildHelixPayload>
15+
<TestAppsRoot>$(MSBuildProjectDirectory)\..\testassets\</TestAppsRoot>
16+
</PropertyGroup>
17+
18+
<Import Project="$(SharedSourceRoot)MSBuild.Testing\MSBuild.Testing.targets" />
19+
20+
<ItemGroup>
21+
<None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
22+
</ItemGroup>
23+
24+
<ItemGroup>
25+
<Reference Include="Microsoft.Build.Utilities.Core" />
26+
<Reference Include="Microsoft.Extensions.DependencyModel" />
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<ProjectReference Include="$(RepoRoot)src\Razor\test\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj" />
31+
32+
<ProjectReference Include="..\src\Microsoft.NET.Sdk.BlazorWebAssembly.csproj">
33+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
34+
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
35+
</ProjectReference>
36+
37+
<ProjectReference Include="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\Microsoft.NET.Sdk.Razor.csproj">
38+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
39+
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
40+
</ProjectReference>
41+
</ItemGroup>
42+
43+
<ItemGroup>
44+
<Compile Include="..\src\BootJsonData.cs" LinkBase="Wasm" />
45+
<Compile Include="..\src\AssetsManifestFile.cs" LinkBase="Wasm" />
46+
<Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
47+
</ItemGroup>
48+
49+
<Target Name="GenerateTestData" BeforeTargets="GetAssemblyAttributes">
50+
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="&quot;$(NuGetPackageRoot)vswhere\$(VSWhereVersion)\tools\vswhere.exe&quot; -latest -prerelease -property installationPath -requires Microsoft.Component.MSBuild" ConsoleToMsBuild="true" StandardErrorImportance="high">
51+
<Output TaskParameter="ConsoleOutput" PropertyName="_VSInstallDir" />
52+
</Exec>
53+
<Error Condition="'$(OS)' == 'Windows_NT' and '$(_VSInstallDir)'=='' and '$(Test)' == 'true'" Text="Visual Studio not found on Windows." />
54+
55+
<PropertyGroup>
56+
<_DesktopMSBuildPath Condition="'$(OS)' == 'Windows_NT' and Exists('$(_VSInstallDir)\MSBuild\Current\Bin\msbuild.exe')">$(_VSInstallDir)\MSBuild\Current\Bin\msbuild.exe</_DesktopMSBuildPath>
57+
<_DesktopMSBuildPath Condition="'$(OS)' == 'Windows_NT' and Exists('$(_VSInstallDir)\MSBuild\15.0\Bin\msbuild.exe')">$(_VSInstallDir)\MSBuild\15.0\Bin\msbuild.exe</_DesktopMSBuildPath>
58+
</PropertyGroup>
59+
60+
<Error Condition="'$(OS)' == 'Windows_NT' and '$(_DesktopMSBuildPath)'=='' and '$(Test)' == 'true'" Text="MSBuild.exe not found on Windows." />
61+
62+
<ItemGroup>
63+
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
64+
<_Parameter1>DesktopMSBuildPath</_Parameter1>
65+
<_Parameter2>$(_DesktopMSBuildPath)</_Parameter2>
66+
</AssemblyAttribute>
67+
</ItemGroup>
68+
</Target>
69+
70+
<Target Name="RestoreTestProjects" BeforeTargets="Restore;Build" Condition="'$(DotNetBuildFromSource)' != 'true'">
71+
<MSBuild Projects="..\testassets\RestoreBlazorWasmTestProjects\RestoreBlazorWasmTestProjects.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion);RepoRoot=$(RepoRoot)" />
72+
</Target>
73+
74+
<Target Name="EnsureLogFolder" AfterTargets="Build">
75+
<MakeDir Directories="$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'log', '$(_BuildConfig)'))" />
76+
</Target>
77+
78+
</Project>

src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/Wasm/ServiceWorkerAssert.cs renamed to src/Components/WebAssembly/Sdk/integrationtests/ServiceWorkerAssert.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.IO;
77
using System.Linq;
88
using System.Text.Json;
9-
using Microsoft.AspNetCore.Razor.Tasks;
9+
using Microsoft.NET.Sdk.BlazorWebAssembly;
1010

1111
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
1212
{

src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/Wasm/WasmBuildIncrementalismTest.cs renamed to src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIncrementalismTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.IO;
55
using System.Text.Json;
66
using System.Threading.Tasks;
7-
using Microsoft.AspNetCore.Razor.Tasks;
7+
using Microsoft.NET.Sdk.BlazorWebAssembly;
88
using Xunit;
99

1010
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests

src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/Wasm/WasmBuildIntegrationTest.cs renamed to src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.IO;
55
using System.Text.Json;
66
using System.Threading.Tasks;
7-
using Microsoft.AspNetCore.Razor.Tasks;
7+
using Microsoft.NET.Sdk.BlazorWebAssembly;
88
using Microsoft.AspNetCore.Testing;
99
using Xunit;
1010

src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/Wasm/WasmBuildLazyLoadTest.cs renamed to src/Components/WebAssembly/Sdk/integrationtests/WasmBuildLazyLoadTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.IO;
55
using System.Text.Json;
66
using System.Threading.Tasks;
7-
using Microsoft.AspNetCore.Razor.Tasks;
7+
using Microsoft.NET.Sdk.BlazorWebAssembly;
88
using Xunit;
99

1010
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests

src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/Wasm/WasmPublishIntegrationTest.cs renamed to src/Components/WebAssembly/Sdk/integrationtests/WasmPublishIntegrationTest.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.IO.Compression;
66
using System.Text.Json;
77
using System.Threading.Tasks;
8-
using Microsoft.AspNetCore.Razor.Tasks;
8+
using Microsoft.NET.Sdk.BlazorWebAssembly;
99
using Microsoft.AspNetCore.Testing;
1010
using Xunit;
1111
using static Microsoft.AspNetCore.Razor.Design.IntegrationTests.ServiceWorkerAssert;
@@ -608,6 +608,17 @@ public async Task Publish_HostedApp_VisualStudio_WithSatelliteAssemblies()
608608
assetsManifestPath: "custom-service-worker-assets.js");
609609
}
610610

611+
[Fact]
612+
public async Task Publish_HostedApp_WithRidSpecifiedInCLI_Works()
613+
{
614+
// Arrange
615+
using var project = ProjectDirectory.Create("blazorhosted-rid", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", });
616+
project.RuntimeIdentifier = "linux-x64";
617+
var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/p:RuntimeIdentifier=linux-x64");
618+
619+
AssertRIDPublishOuput(project, result);
620+
}
621+
611622
[Fact]
612623
public async Task Publish_HostedApp_WithRid_Works()
613624
{
@@ -616,6 +627,11 @@ public async Task Publish_HostedApp_WithRid_Works()
616627
project.RuntimeIdentifier = "linux-x64";
617628
var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish");
618629

630+
AssertRIDPublishOuput(project, result);
631+
}
632+
633+
private static void AssertRIDPublishOuput(ProjectDirectory project, MSBuildResult result)
634+
{
619635
Assert.BuildPassed(result);
620636

621637
var publishDirectory = project.PublishOutputDirectory;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"methodDisplay": "method",
3+
"shadowCopy": false,
4+
"maxParallelThreads": -1
5+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
namespace Microsoft.NET.Sdk.BlazorWebAssembly
5+
{
6+
#pragma warning disable IDE1006 // Naming Styles
7+
public class AssetsManifestFile
8+
{
9+
/// <summary>
10+
/// Gets or sets a version string.
11+
/// </summary>
12+
public string version { get; set; }
13+
14+
/// <summary>
15+
/// Gets or sets the assets. Keys are URLs; values are base-64-formatted SHA256 content hashes.
16+
/// </summary>
17+
public AssetsManifestFileEntry[] assets { get; set; }
18+
}
19+
20+
public class AssetsManifestFileEntry
21+
{
22+
/// <summary>
23+
/// Gets or sets the asset URL. Normally this will be relative to the application's base href.
24+
/// </summary>
25+
public string url { get; set; }
26+
27+
/// <summary>
28+
/// Gets or sets the file content hash. This should be the base-64-formatted SHA256 value.
29+
/// </summary>
30+
public string hash { get; set; }
31+
}
32+
#pragma warning restore IDE1006 // Naming Styles
33+
}

0 commit comments

Comments
 (0)