Skip to content

Commit 5eaad4c

Browse files
authored
Merge pull request #24170 from dotnet-maestro-bot/merge/release/5.0-preview8-to-master
[automated] Merge branch 'release/5.0-preview8' => 'master'
2 parents 3cf8b5c + e1fcdca commit 5eaad4c

File tree

12 files changed

+138
-2
lines changed

12 files changed

+138
-2
lines changed

.azure/pipelines/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ trigger:
1010
- blazor-wasm
1111
- master
1212
- release/*
13+
- internal/release/*
1314

1415
# Run PR validation on all branches
1516
pr:

src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs

+23
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,29 @@ public class WasmBuildIntegrationTest
1414
{
1515
private static readonly string DotNetJsFileName = $"dotnet.{BuildVariables.MicrosoftNETCoreAppRuntimeVersion}.js";
1616

17+
[Fact]
18+
public async Task BuildMinimal_Works()
19+
{
20+
// Arrange
21+
// Minimal has no project references, service worker etc. This is pretty close to the project template.
22+
using var project = ProjectDirectory.Create("blazorwasm-minimal");
23+
var result = await MSBuildProcessManager.DotnetMSBuild(project);
24+
25+
Assert.BuildPassed(result);
26+
27+
var buildOutputDirectory = project.BuildOutputDirectory;
28+
29+
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json");
30+
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js");
31+
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm");
32+
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm.gz");
33+
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", DotNetJsFileName);
34+
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazorwasm-minimal.dll");
35+
36+
var staticWebAssets = Assert.FileExists(result, buildOutputDirectory, "blazorwasm-minimal.StaticWebAssets.xml");
37+
Assert.FileContains(result, staticWebAssets, Path.Combine(project.TargetFramework, "wwwroot"));
38+
}
39+
1740
[Fact]
1841
public async Task Build_Works()
1942
{

src/Components/WebAssembly/Sdk/integrationtests/WasmPublishIntegrationTest.cs

+29
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,35 @@ public class WasmPublishIntegrationTest
1717
{
1818
private static readonly string DotNetJsFileName = $"dotnet.{BuildVariables.MicrosoftNETCoreAppRuntimeVersion}.js";
1919

20+
[Fact]
21+
public async Task Publish_MinimalApp_Works()
22+
{
23+
// Arrange
24+
using var project = ProjectDirectory.Create("blazorwasm-minimal");
25+
var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish");
26+
27+
Assert.BuildPassed(result);
28+
29+
var publishDirectory = project.PublishOutputDirectory;
30+
31+
var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot");
32+
33+
Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json");
34+
Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js");
35+
Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm");
36+
Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName);
37+
Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm-minimal.dll");
38+
39+
// Verify static assets are in the publish directory
40+
Assert.FileExists(result, blazorPublishDirectory, "index.html");
41+
42+
// Verify web.config
43+
Assert.FileExists(result, publishDirectory, "web.config");
44+
Assert.FileCountEquals(result, 1, publishDirectory, "*", SearchOption.TopDirectoryOnly);
45+
46+
VerifyBootManifestHashes(result, blazorPublishDirectory);
47+
}
48+
2049
[Fact]
2150
public async Task Publish_WithDefaultSettings_Works()
2251
{

src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Copyright (c) .NET Foundation. All rights reserved.
3232

3333
<PropertyGroup>
3434
<!-- Paths to tools, tasks, and extensions are calculated relative to the BlazorWebAssemblySdkDirectoryRoot. This can be modified to test a local build. -->
35-
<BlazorWebAssemblySdkDirectoryRoot Condition="'$(BlazorWebAssemblySdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\..\</BlazorWebAssemblySdkDirectoryRoot>
35+
<BlazorWebAssemblySdkDirectoryRoot Condition="'$(BlazorWebAssemblySdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</BlazorWebAssemblySdkDirectoryRoot>
3636
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net5.0</_BlazorWebAssemblySdkTasksTFM>
3737
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net46</_BlazorWebAssemblySdkTasksTFM>
3838
<_BlazorWebAssemblySdkTasksAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tasks\$(_BlazorWebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll</_BlazorWebAssemblySdkTasksAssembly>
@@ -69,7 +69,7 @@ Copyright (c) .NET Foundation. All rights reserved.
6969

7070
</PropertyGroup>
7171

72-
<Import Project="Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets" />
72+
<Import Project="Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets" Condition="'$(ServiceWorkerAssetsManifest)' != ''" />
7373

7474
<Target Name="_ScrambleDotnetJsFileName" AfterTargets="ResolveRuntimePackAssets">
7575
<!--

src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ProjectReference Include="..\blazorhosted\blazorhosted.csproj" />
88
<ProjectReference Include="..\blazorhosted-rid\blazorhosted-rid.csproj" />
99
<ProjectReference Include="..\blazorwasm\blazorwasm.csproj" />
10+
<ProjectReference Include="..\blazorwasm-minimal\blazorwasm-minimal.csproj" />
1011
</ItemGroup>
1112

1213
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Router AppAssembly="@typeof(Program).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData"/>
4+
</Found>
5+
<NotFound>
6+
<p>Sorry, there's nothing at this address.</p>
7+
</NotFound>
8+
</Router>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@page "/"
2+
3+
<h1>Hello, world!</h1>
4+
5+
Welcome to your new app.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
3+
namespace standalone
4+
{
5+
public class Program
6+
{
7+
public static void Main(string[] args)
8+
{
9+
}
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@using Microsoft.AspNetCore.Components.Routing
2+
@using standalone
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
2+
3+
<Import Project="$(RepoRoot)src\Components\WebAssembly\Sdk\src\Sdk\Sdk.props" />
4+
5+
<PropertyGroup>
6+
<TargetFramework>net5.0</TargetFramework>
7+
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
8+
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
9+
<BlazorWebAssemblySdkDirectoryRoot>$(BlazorWebAssemblySdkArtifactsDirectory)$(Configuration)\sdk-output\</BlazorWebAssemblySdkDirectoryRoot>
10+
</PropertyGroup>
11+
12+
<!-- Test Placeholder -->
13+
14+
<PropertyGroup Condition="'$(RunningAsTest)' == ''">
15+
<!-- We don't want to run build server when not running as tests. -->
16+
<UseRazorBuildServer>false</UseRazorBuildServer>
17+
</PropertyGroup>
18+
19+
<PropertyGroup Condition="'$(BinariesRoot)'==''">
20+
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
21+
<BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
22+
</PropertyGroup>
23+
24+
<!-- DO NOT add addition references here. This is meant to simulate a non-MVC library -->
25+
<ItemGroup Condition="'$(BinariesRoot)'!=''">
26+
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.ComponentShim.dll"/>
27+
</ItemGroup>
28+
29+
<Import Project="$(RepoRoot)src\Components\WebAssembly\Sdk\src\Sdk\Sdk.targets" />
30+
31+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.build { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width" />
7+
<title>standalone</title>
8+
<base href="/" />
9+
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
10+
<link href="css/app.css" rel="stylesheet" />
11+
</head>
12+
13+
<body>
14+
<app>Loading...</app>
15+
16+
<div id="blazor-error-ui">
17+
An unhandled error has occurred.
18+
<a href="" class="reload">Reload</a>
19+
<a class="dismiss">🗙</a>
20+
</div>
21+
<script src="_framework/blazor.webassembly.js"></script>
22+
</body>
23+
24+
</html>

0 commit comments

Comments
 (0)