Skip to content

Commit

Permalink
Merge branch 'release/5.0' into 'internal/release/5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dougbu committed Jan 14, 2021
2 parents ae430f3 + fe37d39 commit 940fed8
Show file tree
Hide file tree
Showing 21 changed files with 223 additions and 16 deletions.
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,17 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>cf258a14b70ad9069470a108f13765e0e5988f51</Sha>
</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>
<Sha>f1c7a4b1bcd028e17f2714b7e6f30ec1abd1a03f</Sha>
<Sha>f73f462f75b5fa21805f0b3c477b11277c5da556</Sha>
</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>
<Sha>f1c7a4b1bcd028e17f2714b7e6f30ec1abd1a03f</Sha>
<Sha>f73f462f75b5fa21805f0b3c477b11277c5da556</Sha>
</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>
<Sha>f1c7a4b1bcd028e17f2714b7e6f30ec1abd1a03f</Sha>
<Sha>f73f462f75b5fa21805f0b3c477b11277c5da556</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<MicrosoftEntityFrameworkCorePackageVersion>5.0.3</MicrosoftEntityFrameworkCorePackageVersion>
<MicrosoftEntityFrameworkCoreDesignPackageVersion>5.0.3</MicrosoftEntityFrameworkCoreDesignPackageVersion>
<!-- Packages from dotnet/arcade -->
<MicrosoftDotNetBuildTasksInstallersPackageVersion>5.0.0-beta.20621.10</MicrosoftDotNetBuildTasksInstallersPackageVersion>
<MicrosoftDotNetBuildTasksInstallersPackageVersion>5.0.0-beta.21063.3</MicrosoftDotNetBuildTasksInstallersPackageVersion>
</PropertyGroup>
<!--
Expand Down
2 changes: 1 addition & 1 deletion eng/common/post-build/publish-using-darc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ try {
--id $buildId `
--publishing-infra-version $PublishingInfraVersion `
--default-channels `
--source-branch internal/release-publishing `
--source-branch master `
--azdev-pat $AzdoToken `
--bar-uri $MaestroApiEndPoint `
--password $MaestroToken `
Expand Down
12 changes: 6 additions & 6 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"sdk": {
"version": "5.0.101"
"version": "5.0.102"
},
"tools": {
"dotnet": "5.0.101",
"dotnet": "5.0.102",
"runtimes": {
"dotnet/x64": [
"2.1.23",
"2.1.24",
"$(MicrosoftNETCoreAppInternalPackageVersion)"
],
"dotnet/x86": [
"$(MicrosoftNETCoreAppInternalPackageVersion)"
],
"aspnetcore/x64": [
"3.1.10"
"3.1.11"
]
},
"Git": "2.22.0",
Expand All @@ -30,7 +30,7 @@
},
"msbuild-sdks": {
"Yarn.MSBuild": "1.15.2",
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20621.10",
"Microsoft.DotNet.Helix.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.21063.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,58 @@ public async Task Publish_WithInvariantGlobalizationEnabled_DoesNotCopyGlobaliza
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)
{
var path = Path.Combine(project.SolutionPath, "blazorwasm", "blazorwasm.csproj");
Expand Down Expand Up @@ -1022,7 +1074,6 @@ static string ParseWebFormattedHash(string webFormattedHash)
}
}


private void VerifyTypeGranularTrimming(MSBuildResult result, string blazorPublishDirectory)
{
var componentsShimAssemblyPath = Path.Combine(blazorPublishDirectory, "_framework", "Microsoft.AspNetCore.Razor.Test.ComponentShim.dll");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<ItemGroup>
<_BlazorPublishBootResource
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>

<GetFileHash Files="@(_BlazorPublishBootResource)" Algorithm="SHA256" HashEncoding="base64">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>@typeof(BlazorMultipleApps.FirstClient.Program)</h1>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* First app.css */
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>@typeof(BlazorMultipleApps.SecondClient.Program)</h1>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;

namespace BlazorMultipleApps.SecondClient
{
public class Program
{
public static void Main(string[] args)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Second app.css */
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace BlazorMultipleApps.Server
{
public class Program
{
public static void Main(string[] args)
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ProjectReference Include="..\blazorwasm\blazorwasm.csproj" />
<ProjectReference Include="..\blazorwasm-minimal\blazorwasm-minimal.csproj" />
<ProjectReference Include="..\blazorwasm-fxref\blazorwasm-fxref.csproj" />
<ProjectReference Include="..\BlazorMultipleApps.Server\BlazorMultipleApps.Server.csproj" />
</ItemGroup>

</Project>

0 comments on commit 940fed8

Please sign in to comment.