Merge branch 'release/5.0' into 'internal/release/5.0'

This commit is contained in:
Doug Bunting 2021-01-14 14:14:55 -08:00
commit 940fed892b
No known key found for this signature in database
GPG Key ID: EE41520987982C03
21 changed files with 223 additions and 16 deletions

View File

@ -313,17 +313,17 @@
<Uri>https://github.com/dotnet/runtime</Uri> <Uri>https://github.com/dotnet/runtime</Uri>
<Sha>cf258a14b70ad9069470a108f13765e0e5988f51</Sha> <Sha>cf258a14b70ad9069470a108f13765e0e5988f51</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20621.10"> <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.21063.3">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>f1c7a4b1bcd028e17f2714b7e6f30ec1abd1a03f</Sha> <Sha>f73f462f75b5fa21805f0b3c477b11277c5da556</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="5.0.0-beta.20621.10"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="5.0.0-beta.21063.3">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>f1c7a4b1bcd028e17f2714b7e6f30ec1abd1a03f</Sha> <Sha>f73f462f75b5fa21805f0b3c477b11277c5da556</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20621.10"> <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.21063.3">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>f1c7a4b1bcd028e17f2714b7e6f30ec1abd1a03f</Sha> <Sha>f73f462f75b5fa21805f0b3c477b11277c5da556</Sha>
</Dependency> </Dependency>
</ToolsetDependencies> </ToolsetDependencies>
</Dependencies> </Dependencies>

View File

@ -135,7 +135,7 @@
<MicrosoftEntityFrameworkCorePackageVersion>5.0.3</MicrosoftEntityFrameworkCorePackageVersion> <MicrosoftEntityFrameworkCorePackageVersion>5.0.3</MicrosoftEntityFrameworkCorePackageVersion>
<MicrosoftEntityFrameworkCoreDesignPackageVersion>5.0.3</MicrosoftEntityFrameworkCoreDesignPackageVersion> <MicrosoftEntityFrameworkCoreDesignPackageVersion>5.0.3</MicrosoftEntityFrameworkCoreDesignPackageVersion>
<!-- Packages from dotnet/arcade --> <!-- Packages from dotnet/arcade -->
<MicrosoftDotNetBuildTasksInstallersPackageVersion>5.0.0-beta.20621.10</MicrosoftDotNetBuildTasksInstallersPackageVersion> <MicrosoftDotNetBuildTasksInstallersPackageVersion>5.0.0-beta.21063.3</MicrosoftDotNetBuildTasksInstallersPackageVersion>
</PropertyGroup> </PropertyGroup>
<!-- <!--

View File

@ -54,7 +54,7 @@ try {
--id $buildId ` --id $buildId `
--publishing-infra-version $PublishingInfraVersion ` --publishing-infra-version $PublishingInfraVersion `
--default-channels ` --default-channels `
--source-branch internal/release-publishing ` --source-branch master `
--azdev-pat $AzdoToken ` --azdev-pat $AzdoToken `
--bar-uri $MaestroApiEndPoint ` --bar-uri $MaestroApiEndPoint `
--password $MaestroToken ` --password $MaestroToken `

View File

@ -1,19 +1,19 @@
{ {
"sdk": { "sdk": {
"version": "5.0.101" "version": "5.0.102"
}, },
"tools": { "tools": {
"dotnet": "5.0.101", "dotnet": "5.0.102",
"runtimes": { "runtimes": {
"dotnet/x64": [ "dotnet/x64": [
"2.1.23", "2.1.24",
"$(MicrosoftNETCoreAppInternalPackageVersion)" "$(MicrosoftNETCoreAppInternalPackageVersion)"
], ],
"dotnet/x86": [ "dotnet/x86": [
"$(MicrosoftNETCoreAppInternalPackageVersion)" "$(MicrosoftNETCoreAppInternalPackageVersion)"
], ],
"aspnetcore/x64": [ "aspnetcore/x64": [
"3.1.10" "3.1.11"
] ]
}, },
"Git": "2.22.0", "Git": "2.22.0",
@ -30,7 +30,7 @@
}, },
"msbuild-sdks": { "msbuild-sdks": {
"Yarn.MSBuild": "1.15.2", "Yarn.MSBuild": "1.15.2",
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20621.10", "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.21063.3",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20621.10" "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.21063.3"
} }
} }

View File

@ -970,6 +970,58 @@ $@"<PropertyGroup>
Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat"); Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat");
} }
[Fact]
public async Task Publish_HostingMultipleBlazorWebApps_Works()
{
// Regression test for https://github.com/dotnet/aspnetcore/issues/29264
// Arrange
using var project = ProjectDirectory.Create("BlazorMultipleApps.Server", "BlazorMultipleApps.FirstClient", "BlazorMultipleApps.SecondClient", "BlazorMultipleApps.Shared");
var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish");
var publishOutputDirectory = project.PublishOutputDirectory;
Assert.FileExists(result, Path.Combine(publishOutputDirectory, "BlazorMultipleApps.Server.dll"));
Assert.FileExists(result, Path.Combine(publishOutputDirectory, "BlazorMultipleApps.FirstClient.dll"));
Assert.FileExists(result, Path.Combine(publishOutputDirectory, "BlazorMultipleApps.SecondClient.dll"));
var firstAppPublishDirectory = Path.Combine(publishOutputDirectory, "wwwroot", "FirstApp");
var firstCss = Assert.FileExists(result, Path.Combine(firstAppPublishDirectory, "css", "app.css"));
Assert.FileContains(result, firstCss, "/* First app.css */");
var firstBootJsonPath = Path.Combine(firstAppPublishDirectory, "_framework", "blazor.boot.json");
var firstBootJson = ReadBootJsonData(result, firstBootJsonPath);
// Do a sanity check that the boot json has files.
Assert.Contains("System.Text.Json.dll", firstBootJson.resources.assembly.Keys);
VerifyBootManifestHashes(result, firstAppPublishDirectory);
// Verify compression works
Assert.FileExists(result, firstAppPublishDirectory, "_framework", "dotnet.wasm.br");
Assert.FileExists(result, firstAppPublishDirectory, "_framework", "BlazorMultipleApps.FirstClient.dll.br");
Assert.FileExists(result, firstAppPublishDirectory, "_framework", "System.Text.Json.dll.br");
var secondAppPublishDirectory = Path.Combine(publishOutputDirectory, "wwwroot", "SecondApp");
var secondCss = Assert.FileExists(result, Path.Combine(secondAppPublishDirectory, "css", "app.css"));
Assert.FileContains(result, secondCss, "/* Second app.css */");
var secondBootJsonPath = Path.Combine(secondAppPublishDirectory, "_framework", "blazor.boot.json");
var secondBootJson = ReadBootJsonData(result, secondBootJsonPath);
// Do a sanity check that the boot json has files.
Assert.Contains("System.Private.CoreLib.dll", secondBootJson.resources.assembly.Keys);
VerifyBootManifestHashes(result, secondAppPublishDirectory);
// Verify compression works
Assert.FileExists(result, secondAppPublishDirectory, "_framework", "dotnet.wasm.br");
Assert.FileExists(result, secondAppPublishDirectory, "_framework", "BlazorMultipleApps.SecondClient.dll.br");
Assert.FileExists(result, secondAppPublishDirectory, "_framework", "System.Private.CoreLib.dll.br");
Assert.FileDoesNotExist(result, secondAppPublishDirectory, "_framework", "System.Text.Json.dll.br");
}
private static void AddWasmProjectContent(ProjectDirectory project, string content) private static void AddWasmProjectContent(ProjectDirectory project, string content)
{ {
var path = Path.Combine(project.SolutionPath, "blazorwasm", "blazorwasm.csproj"); var path = Path.Combine(project.SolutionPath, "blazorwasm", "blazorwasm.csproj");
@ -1022,7 +1074,6 @@ $@"<PropertyGroup>
} }
} }
private void VerifyTypeGranularTrimming(MSBuildResult result, string blazorPublishDirectory) private void VerifyTypeGranularTrimming(MSBuildResult result, string blazorPublishDirectory)
{ {
var componentsShimAssemblyPath = Path.Combine(blazorPublishDirectory, "_framework", "Microsoft.AspNetCore.Razor.Test.ComponentShim.dll"); var componentsShimAssemblyPath = Path.Combine(blazorPublishDirectory, "_framework", "Microsoft.AspNetCore.Razor.Test.ComponentShim.dll");

View File

@ -509,7 +509,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<ItemGroup> <ItemGroup>
<_BlazorPublishBootResource <_BlazorPublishBootResource
Include="@(ResolvedFileToPublish)" Include="@(ResolvedFileToPublish)"
Condition="$([System.String]::Copy('%(RelativePath)').Replace('\','/').StartsWith('wwwroot/_framework')) AND '%(Extension)' != '.a'" /> Condition="$([System.String]::Copy('%(RelativePath)').Replace('\','/').StartsWith($(_BlazorFrameworkPublishPath.Replace('\', '/')))) AND '%(Extension)' != '.a'" />
</ItemGroup> </ItemGroup>
<GetFileHash Files="@(_BlazorPublishBootResource)" Algorithm="SHA256" HashEncoding="base64"> <GetFileHash Files="@(_BlazorPublishBootResource)" Algorithm="SHA256" HashEncoding="base64">

View File

@ -0,0 +1 @@
<h1>@typeof(BlazorMultipleApps.FirstClient.Program)</h1>

View File

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<StaticWebAssetBasePath>FirstApp</StaticWebAssetBasePath>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
<BlazorWebAssemblySdkDirectoryRoot>$(BlazorWebAssemblySdkArtifactsDirectory)$(Configuration)\sdk-output\</BlazorWebAssemblySdkDirectoryRoot>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BlazorMultipleApps.Shared\BlazorMultipleApps.Shared.csproj" />
</ItemGroup>
<PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup>
<!-- DO NOT add addition references here. This is meant to simulate a non-MVC library -->
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.ComponentShim.dll"/>
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
namespace BlazorMultipleApps.FirstClient
{
public class Program
{
public static void Main(string[] args)
{
GC.KeepAlive(typeof(System.Text.Json.JsonSerializer));
}
}
}

View File

@ -0,0 +1 @@
/* First app.css */

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>BlazorMultipleApps</title>
<base href="/FirstApp/" />
<link href="css/app.css" rel="stylesheet" />
</head>
<body>
<script src="_framework/blazor.webassembly.js"></script>
</body>
</html>

View File

@ -0,0 +1 @@
<h1>@typeof(BlazorMultipleApps.SecondClient.Program)</h1>

View File

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<StaticWebAssetBasePath>SecondApp</StaticWebAssetBasePath>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
<BlazorWebAssemblySdkDirectoryRoot>$(BlazorWebAssemblySdkArtifactsDirectory)$(Configuration)\sdk-output\</BlazorWebAssemblySdkDirectoryRoot>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BlazorMultipleApps.Shared\BlazorMultipleApps.Shared.csproj" />
</ItemGroup>
<PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup>
<!-- DO NOT add addition references here. This is meant to simulate a non-MVC library -->
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.ComponentShim.dll"/>
</ItemGroup>
</Project>

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace BlazorMultipleApps.SecondClient
{
public class Program
{
public static void Main(string[] args)
{
}
}
}

View File

@ -0,0 +1 @@
/* Second app.css */

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>SecondBlazorApp</title>
<base href="/SecondApp/" />
<link href="css/app.css" rel="stylesheet" />
</head>
<body>
<script src="_framework/blazor.webassembly.js"></script>
</body>
</html>

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BlazorMultipleApps.SecondClient\BlazorMultipleApps.SecondClient.csproj" />
<ProjectReference Include="..\BlazorMultipleApps.FirstClient\BlazorMultipleApps.FirstClient.csproj" />
<ProjectReference Include="..\BlazorMultipleApps.Shared\BlazorMultipleApps.Shared.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,10 @@
namespace BlazorMultipleApps.Server
{
public class Program
{
public static void Main(string[] args)
{
}
}
}

View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BlazorMultipleApps.Shared
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public string Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}

View File

@ -9,6 +9,7 @@
<ProjectReference Include="..\blazorwasm\blazorwasm.csproj" /> <ProjectReference Include="..\blazorwasm\blazorwasm.csproj" />
<ProjectReference Include="..\blazorwasm-minimal\blazorwasm-minimal.csproj" /> <ProjectReference Include="..\blazorwasm-minimal\blazorwasm-minimal.csproj" />
<ProjectReference Include="..\blazorwasm-fxref\blazorwasm-fxref.csproj" /> <ProjectReference Include="..\blazorwasm-fxref\blazorwasm-fxref.csproj" />
<ProjectReference Include="..\BlazorMultipleApps.Server\BlazorMultipleApps.Server.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>