From 1606d9b0d308d4e348c8a4ad42bf7f7f7d662980 Mon Sep 17 00:00:00 2001 From: John Luo Date: Thu, 12 Sep 2019 22:02:18 -0700 Subject: [PATCH 1/3] Support netcoreapp3.1 TFM (dotnet/aspnetcore-tooling#1122) * Support netcoreapp3.1 TFM * Update branding to preview1 * Skip failing 1.1 test \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/133b252f09e9d77608b6e0e767f299f1db1b5c64 --- .../Microsoft.AspNetCore.Razor.Tools.csproj | 2 +- ...crosoft.AspNetCore.Razor.Tools.Test.csproj | 2 +- .../src/Microsoft.NET.Sdk.Razor.csproj | 12 +++-- .../src/Microsoft.NET.Sdk.Razor.nuspec | 3 ++ ...osoft.NET.Sdk.Razor.CodeGeneration.targets | 6 +-- .../Sdk.Razor.CurrentVersion.targets | 2 +- .../test/BuildVariables.cs | 6 +-- .../IntegrationTests/BuildIntegrationTest.cs | 2 +- .../BuildIntegrationTest11.cs | 2 +- .../InitializeTestProjectAttribute.cs | 4 +- .../MSBuildIntegrationTestBase.cs | 4 +- .../IntegrationTests/PackIntegrationTest.cs | 50 ++++++++++--------- .../PublishIntegrationTest.cs | 2 +- .../test/Microsoft.NET.Sdk.Razor.Test.csproj | 4 +- ...tCore.Razor.Test.MvcShim.Version1_X.csproj | 2 +- ...tCore.Razor.Test.MvcShim.Version2_X.csproj | 2 +- ...osoft.AspNetCore.Razor.Test.MvcShim.csproj | 4 +- .../AppWithP2PReference.csproj | 4 +- .../AppWithPackageAndP2PReference.csproj | 4 +- .../ClassLibrary/ClassLibrary.csproj | 4 +- .../ClassLibrary2/ClassLibrary2.csproj | 6 +-- .../ComponentApp/ComponentApp.csproj | 2 +- .../test/testassets/Directory.Build.props | 5 +- .../test/testassets/Directory.Build.targets | 2 +- .../LargeProject/LargeProject.csproj | 6 +-- .../MvcWithComponents.csproj | 2 +- .../PackageLibraryDirectDependency.csproj | 4 +- .../RestoreTestProjects.csproj | 2 +- .../testassets/SimpleMvc/SimpleMvc.csproj | 2 +- .../SimpleMvcFSharp/SimpleMvcFSharp.fsproj | 2 +- .../testassets/SimplePages/SimplePages.csproj | 2 +- 31 files changed, 83 insertions(+), 73 deletions(-) diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/Microsoft.AspNetCore.Razor.Tools.csproj b/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/Microsoft.AspNetCore.Razor.Tools.csproj index cec75baae8..d95e126d74 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/Microsoft.AspNetCore.Razor.Tools.csproj +++ b/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/Microsoft.AspNetCore.Razor.Tools.csproj @@ -3,7 +3,7 @@ Razor is a markup syntax for adding server-side logic to web pages. This assembly contains infrastructure supporting Razor MSBuild integration. - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) Exe rzc diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Tools/test/Microsoft.AspNetCore.Razor.Tools.Test.csproj b/src/Razor/Microsoft.AspNetCore.Razor.Tools/test/Microsoft.AspNetCore.Razor.Tools.Test.csproj index 48976ae144..8430edfc23 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Tools/test/Microsoft.AspNetCore.Razor.Tools.Test.csproj +++ b/src/Razor/Microsoft.AspNetCore.Razor.Tools/test/Microsoft.AspNetCore.Razor.Tools.Test.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) $(DefaultItemExcludes);TestFiles\** diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.csproj b/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.csproj index 24bf87a38e..ba33b9f833 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.csproj +++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.csproj @@ -1,7 +1,7 @@  Razor is a markup syntax for adding server-side logic to web pages. This package contains MSBuild support for Razor. - netcoreapp3.0;net46 + $(DefaultNetCoreTargetFramework);net46 Microsoft.NET.Sdk.Razor.Tasks $(MSBuildProjectName).nuspec @@ -11,6 +11,8 @@ $(NoWarn);NU5100 + + $(NoWarn);NU5129 @@ -19,8 +21,8 @@ - - + + @@ -44,7 +46,7 @@ @@ -57,7 +59,7 @@ - + diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.nuspec b/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.nuspec index 85713bd963..fc409c5e90 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.nuspec +++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.nuspec @@ -2,6 +2,9 @@ $CommonMetadataElements$ + + + diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.CodeGeneration.targets b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.CodeGeneration.targets index 52037f43c4..5cc0be05e9 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.CodeGeneration.targets +++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.CodeGeneration.targets @@ -39,7 +39,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_RazorGenerateInputsHash> <_RazorGenerateInputsHashFile>$(IntermediateOutputPath)$(MSBuildProjectName).RazorCoreGenerate.cache - <_RazorToolAssembly Condition="'$(_RazorToolAssembly)'==''">$(RazorSdkDirectoryRoot)tools\netcoreapp3.0\rzc.dll + <_RazorToolAssembly Condition="'$(_RazorToolAssembly)'==''">$(RazorSdkDirectoryRoot)tools\$(DefaultNetCoreTargetFramework)\rzc.dll $(MSBuildThisFileDirectory)..\..\ $(RazorSdkDirectoryRoot)tasks\ - <_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.0 + <_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">$(DefaultNetCoreTargetFramework) <_RazorSdkTasksTFM Condition=" '$(_RazorSdkTasksTFM)' == ''">net46 $(RazorSdkBuildTasksDirectoryRoot)$(_RazorSdkTasksTFM)\Microsoft.NET.Sdk.Razor.Tasks.dll diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/BuildVariables.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/BuildVariables.cs index 2fc7b8eae6..1373497c3e 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/BuildVariables.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/BuildVariables.cs @@ -6,7 +6,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests internal static partial class BuildVariables { private static string _msBuildPath = string.Empty; - private static string _microsoftNETCoreApp30PackageVersion = string.Empty; + private static string _microsoftNETCoreApp31PackageVersion = string.Empty; private static string _microsoftNetCompilersToolsetPackageVersion = string.Empty; static partial void InitializeVariables(); @@ -20,12 +20,12 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests } } - public static string MicrosoftNETCoreApp30PackageVersion + public static string MicrosoftNETCoreApp31PackageVersion { get { InitializeVariables(); - return _microsoftNETCoreApp30PackageVersion; + return _microsoftNETCoreApp31PackageVersion; } } diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs index 6acfd7c50b..6ccfae6bf0 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs @@ -639,7 +639,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.FileDoesNotExist(result, IntermediateOutputPath, "SimpleMvc.Views.dll"); } - [Fact] + [Fact(Skip = "Default C# version is 7.3 for netcoreapp3.1 and later https://github.com/aspnet/AspNetCore/issues/13930")] [InitializeTestProject("SimpleMvc")] public async Task Build_ImplicitCSharp8_NullableEnforcement_WarningsDuringBuild_NoBuildServer() { diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest11.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest11.cs index a3b255ed18..dc7d470a3c 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest11.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest11.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.BuildOutputDoesNotContainLine(result, "ProjectCapability: DotNetCoreRazorConfiguration"); } - [Fact] + [Fact (Skip = "https://github.com/aspnet/AspNetCore-Tooling/pull/1122#issuecomment-530976125")] [InitializeTestProject("SimpleMvc11")] public async Task RazorSdk_DoesNotBuildViewsForNetCoreApp11Projects() { diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/InitializeTestProjectAttribute.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/InitializeTestProjectAttribute.cs index 5dc1651e47..ebf9ddb067 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/InitializeTestProjectAttribute.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/InitializeTestProjectAttribute.cs @@ -37,8 +37,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests } MSBuildIntegrationTestBase.Project = ProjectDirectory.Create(_originalProjectName, _testProjectName, _baseDirectory, _additionalProjects, _language); -#if NETCOREAPP3_0 - MSBuildIntegrationTestBase.TargetFramework = "netcoreapp3.0"; +#if NETCOREAPP + MSBuildIntegrationTestBase.TargetFramework = "netcoreapp3.1"; #else #error Target frameworks need to be updated #endif diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/MSBuildIntegrationTestBase.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/MSBuildIntegrationTestBase.cs index b82e000de2..34c4b87961 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/MSBuildIntegrationTestBase.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/MSBuildIntegrationTestBase.cs @@ -93,7 +93,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests // Let the test app know it is running as part of a test. "/p:RunningAsTest=true", - $"/p:MicrosoftNETCoreApp30PackageVersion={BuildVariables.MicrosoftNETCoreApp30PackageVersion}", + $"/p:MicrosoftNETCoreApp31PackageVersion={BuildVariables.MicrosoftNETCoreApp31PackageVersion}", $"/p:MicrosoftNetCompilersToolsetPackageVersion={BuildVariables.MicrosoftNetCompilersToolsetPackageVersion}", // Additional restore sources for projects that require built packages @@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests { if (!Directory.Exists(LocalNugetPackagesCacheTempPath)) { - // The local cache folder needs to exist so that nuget + // The local cache folder needs to exist so that nuget Directory.CreateDirectory(LocalNugetPackagesCacheTempPath); } } diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PackIntegrationTest.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PackIntegrationTest.cs index f1502e0a37..e148aa2b24 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PackIntegrationTest.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PackIntegrationTest.cs @@ -11,6 +11,8 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests { public class PackIntegrationTest : MSBuildIntegrationTestBase, IClassFixture { + private static readonly string TFM = "netcoreapp3.1"; + public PackIntegrationTest(BuildServerTestFixture buildServer) : base(buildServer) { @@ -29,12 +31,12 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.NuspecContains( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - @""); + $@""); Assert.NupkgContains( result, Path.Combine("bin", Configuration, "ClassLibrary.1.0.0.nupkg"), - Path.Combine("contentFiles", "any", "netcoreapp3.0", "Views", "Shared", "_Layout.cshtml")); + Path.Combine("contentFiles", "any", TFM, "Views", "Shared", "_Layout.cshtml")); } [Fact] @@ -56,25 +58,25 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.NuspecContains( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - $""); + $""); Assert.NuspecDoesNotContain( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - $""); + $""); } Assert.NuspecDoesNotContain( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - @""); + $@""); Assert.NupkgContains( result, Path.Combine("bin", Configuration, "ClassLibrary.1.0.0.nupkg"), - Path.Combine("lib", "netcoreapp3.0", "ClassLibrary.Views.dll")); + Path.Combine("lib", TFM, "ClassLibrary.Views.dll")); } [Fact] @@ -94,25 +96,25 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.NuspecContains( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - $""); + $""); Assert.NuspecDoesNotContain( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - $""); + $""); } Assert.NuspecDoesNotContain( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - @""); + $@""); Assert.NupkgContains( result, Path.Combine("bin", Configuration, "ClassLibrary.1.0.0.nupkg"), - Path.Combine("lib", "netcoreapp3.0", "ClassLibrary.Views.dll")); + Path.Combine("lib", TFM, "ClassLibrary.Views.dll")); } [Fact] @@ -129,21 +131,21 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.NuspecContains( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.symbols.nuspec"), - $""); + $""); Assert.NuspecContains( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.symbols.nuspec"), - $""); + $""); } Assert.NupkgContains( result, Path.Combine("bin", Configuration, "ClassLibrary.1.0.0.symbols.nupkg"), - Path.Combine("lib", "netcoreapp3.0", "ClassLibrary.Views.dll"), - Path.Combine("lib", "netcoreapp3.0", "ClassLibrary.Views.pdb")); + Path.Combine("lib", TFM, "ClassLibrary.Views.dll"), + Path.Combine("lib", TFM, "ClassLibrary.Views.pdb")); } [Fact] @@ -163,19 +165,19 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.NuspecContains( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - $""); + $""); Assert.NuspecContains( result, Path.Combine("obj", Configuration, "ClassLibrary.1.0.0.nuspec"), - @""); + $@""); } Assert.NupkgContains( result, Path.Combine("bin", Configuration, "ClassLibrary.1.0.0.nupkg"), - Path.Combine("lib", "netcoreapp3.0", "ClassLibrary.Views.dll")); + Path.Combine("lib", TFM, "ClassLibrary.Views.dll")); } [Fact] diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PublishIntegrationTest.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PublishIntegrationTest.cs index cebd5de38c..037600112b 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PublishIntegrationTest.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PublishIntegrationTest.cs @@ -434,7 +434,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests var result = await DotnetMSBuild("Publish", "/p:NoBuild=true"); Assert.BuildFailed(result); - Assert.BuildError(result, "MSB3030"); // Could not copy the file "obj/Debug/netcoreapp3.0/SimpleMvc.dll because it couldn't be found. + Assert.BuildError(result, "MSB3030"); // Could not copy the file "obj/Debug/netcoreapp3.1/SimpleMvc.dll because it couldn't be found. Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.dll"); Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.dll"); diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/Microsoft.NET.Sdk.Razor.Test.csproj b/src/Razor/Microsoft.NET.Sdk.Razor/test/Microsoft.NET.Sdk.Razor.Test.csproj index 9f0dab1860..0ae4b051c3 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/Microsoft.NET.Sdk.Razor.Test.csproj +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/Microsoft.NET.Sdk.Razor.Test.csproj @@ -7,7 +7,7 @@ This is also a partial workaround for https://github.com/Microsoft/msbuild/issues/2661 - this project has netcoreapp dependencies that need to be built first. --> - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) true $(DefineConstants);PRESERVE_WORKING_DIRECTORY @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests static partial void InitializeVariables() { _msBuildPath = @"$(_DesktopMSBuildPath)"; - _microsoftNETCoreApp30PackageVersion = "$(MicrosoftNETCoreApp30PackageVersion)"; + _microsoftNETCoreApp31PackageVersion = "$(MicrosoftNETCoreApp31PackageVersion)"; _microsoftNetCompilersToolsetPackageVersion = "$(MicrosoftNetCompilersToolsetPackageVersion)"; } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj index b3c5ef2c7b..2708eb193f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj @@ -1,7 +1,7 @@ - netcoreapp3.0;net461 + $(DefaultNetCoreTargetFramework);net461 true diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj index b3c5ef2c7b..2708eb193f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj @@ -1,7 +1,7 @@ - netcoreapp3.0;net461 + $(DefaultNetCoreTargetFramework);net461 true diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.csproj index 868c485056..4b556f73e1 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.csproj @@ -1,14 +1,14 @@  - netcoreapp3.0;net461 + $(DefaultNetCoreTargetFramework);net461 true - + diff --git a/src/Razor/test/testassets/AppWithP2PReference/AppWithP2PReference.csproj b/src/Razor/test/testassets/AppWithP2PReference/AppWithP2PReference.csproj index d5034c583f..6102fad181 100644 --- a/src/Razor/test/testassets/AppWithP2PReference/AppWithP2PReference.csproj +++ b/src/Razor/test/testassets/AppWithP2PReference/AppWithP2PReference.csproj @@ -1,11 +1,11 @@ - + $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) diff --git a/src/Razor/test/testassets/AppWithPackageAndP2PReference/AppWithPackageAndP2PReference.csproj b/src/Razor/test/testassets/AppWithPackageAndP2PReference/AppWithPackageAndP2PReference.csproj index 076d9b77b0..730b0e4988 100644 --- a/src/Razor/test/testassets/AppWithPackageAndP2PReference/AppWithPackageAndP2PReference.csproj +++ b/src/Razor/test/testassets/AppWithPackageAndP2PReference/AppWithPackageAndP2PReference.csproj @@ -1,11 +1,11 @@ - + $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) $(MSBuildThisFileDirectory)..\TestPackageRestoreSource\ $(RestoreSources); diff --git a/src/Razor/test/testassets/ClassLibrary/ClassLibrary.csproj b/src/Razor/test/testassets/ClassLibrary/ClassLibrary.csproj index 57ca5669a8..87ec461496 100644 --- a/src/Razor/test/testassets/ClassLibrary/ClassLibrary.csproj +++ b/src/Razor/test/testassets/ClassLibrary/ClassLibrary.csproj @@ -1,5 +1,5 @@ - + $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ @@ -9,7 +9,7 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) © Microsoft Razor Test Microsoft diff --git a/src/Razor/test/testassets/ClassLibrary2/ClassLibrary2.csproj b/src/Razor/test/testassets/ClassLibrary2/ClassLibrary2.csproj index 8ba54d6c98..0a331a69c0 100644 --- a/src/Razor/test/testassets/ClassLibrary2/ClassLibrary2.csproj +++ b/src/Razor/test/testassets/ClassLibrary2/ClassLibrary2.csproj @@ -1,11 +1,11 @@ - + $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) true @@ -13,7 +13,7 @@ false - + diff --git a/src/Razor/test/testassets/ComponentApp/ComponentApp.csproj b/src/Razor/test/testassets/ComponentApp/ComponentApp.csproj index 68b1028aa0..488b36eb48 100644 --- a/src/Razor/test/testassets/ComponentApp/ComponentApp.csproj +++ b/src/Razor/test/testassets/ComponentApp/ComponentApp.csproj @@ -5,7 +5,7 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) diff --git a/src/Razor/test/testassets/Directory.Build.props b/src/Razor/test/testassets/Directory.Build.props index c1270c5a7f..fb8728a71e 100644 --- a/src/Razor/test/testassets/Directory.Build.props +++ b/src/Razor/test/testassets/Directory.Build.props @@ -18,7 +18,7 @@ $(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.props $(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets - + $(RestoreSources); @@ -38,6 +38,9 @@ OutOfProcess + + + $(NoWarn);NU5131 diff --git a/src/Razor/test/testassets/Directory.Build.targets b/src/Razor/test/testassets/Directory.Build.targets index 39f4f47645..4e299bd016 100644 --- a/src/Razor/test/testassets/Directory.Build.targets +++ b/src/Razor/test/testassets/Directory.Build.targets @@ -2,7 +2,7 @@ - $(MicrosoftNETCoreApp30PackageVersion) + $(MicrosoftNETCoreApp31PackageVersion) 99.9 diff --git a/src/Razor/test/testassets/LargeProject/LargeProject.csproj b/src/Razor/test/testassets/LargeProject/LargeProject.csproj index b2b6b1019a..109a8d32bc 100644 --- a/src/Razor/test/testassets/LargeProject/LargeProject.csproj +++ b/src/Razor/test/testassets/LargeProject/LargeProject.csproj @@ -17,7 +17,7 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) @@ -33,8 +33,8 @@ - + - + diff --git a/src/Razor/test/testassets/MvcWithComponents/MvcWithComponents.csproj b/src/Razor/test/testassets/MvcWithComponents/MvcWithComponents.csproj index 31429c409f..c16ec85c0b 100644 --- a/src/Razor/test/testassets/MvcWithComponents/MvcWithComponents.csproj +++ b/src/Razor/test/testassets/MvcWithComponents/MvcWithComponents.csproj @@ -5,7 +5,7 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) diff --git a/src/Razor/test/testassets/PackageLibraryDirectDependency/PackageLibraryDirectDependency.csproj b/src/Razor/test/testassets/PackageLibraryDirectDependency/PackageLibraryDirectDependency.csproj index eacc72651e..8bebdb3285 100644 --- a/src/Razor/test/testassets/PackageLibraryDirectDependency/PackageLibraryDirectDependency.csproj +++ b/src/Razor/test/testassets/PackageLibraryDirectDependency/PackageLibraryDirectDependency.csproj @@ -1,5 +1,5 @@ - + $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ @@ -9,7 +9,7 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) © Microsoft Razor Test Microsoft diff --git a/src/Razor/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj b/src/Razor/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj index b7ae27c5e0..ced12b1fa3 100644 --- a/src/Razor/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj +++ b/src/Razor/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj @@ -1,6 +1,6 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) diff --git a/src/Razor/test/testassets/SimpleMvc/SimpleMvc.csproj b/src/Razor/test/testassets/SimpleMvc/SimpleMvc.csproj index 1cde2c2ba5..5a395f6802 100644 --- a/src/Razor/test/testassets/SimpleMvc/SimpleMvc.csproj +++ b/src/Razor/test/testassets/SimpleMvc/SimpleMvc.csproj @@ -5,7 +5,7 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) diff --git a/src/Razor/test/testassets/SimpleMvcFSharp/SimpleMvcFSharp.fsproj b/src/Razor/test/testassets/SimpleMvcFSharp/SimpleMvcFSharp.fsproj index 611e331385..ef683132a5 100644 --- a/src/Razor/test/testassets/SimpleMvcFSharp/SimpleMvcFSharp.fsproj +++ b/src/Razor/test/testassets/SimpleMvcFSharp/SimpleMvcFSharp.fsproj @@ -5,7 +5,7 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) diff --git a/src/Razor/test/testassets/SimplePages/SimplePages.csproj b/src/Razor/test/testassets/SimplePages/SimplePages.csproj index 1cde2c2ba5..5a395f6802 100644 --- a/src/Razor/test/testassets/SimplePages/SimplePages.csproj +++ b/src/Razor/test/testassets/SimplePages/SimplePages.csproj @@ -5,7 +5,7 @@ - netcoreapp3.0 + $(DefaultNetCoreTargetFramework) From 901f8aa76df0f84bb572b3ba8a5a672178b1e920 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2019 19:38:15 +0000 Subject: [PATCH 2/3] [release/3.0] Update dependencies from aspnet/Extensions (dotnet/aspnetcore-tooling#1132) * Update dependencies from https://github.com/aspnet/Extensions build 20190913.2 - Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-rc2.19463.2 - Microsoft.AspNetCore.Testing - 3.0.0-rc2.19463.2 - Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-rc2.19463.2 - Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-rc2.19463.2 - Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-rc2.19463.2 - Microsoft.Extensions.Logging - 3.0.0-rc2.19463.2 Dependency coherency updates - System.Diagnostics.DiagnosticSource - 4.6.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0 (parent: Microsoft.Extensions.Logging) - System.Reflection.Metadata - 1.7.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Text.Encodings.Web - 4.6.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.Extensions.DependencyModel - 3.0.0 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Ref - 3.0.0 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.Platforms - 3.0.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) * Update dependencies from https://github.com/aspnet/Extensions build 20190913.3 - Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-rc2.19463.3 - Microsoft.AspNetCore.Testing - 3.0.0-rc2.19463.3 - Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-rc2.19463.3 - Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-rc2.19463.3 - Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-rc2.19463.3 - Microsoft.Extensions.Logging - 3.0.0 Dependency coherency updates - System.Diagnostics.DiagnosticSource - 4.6.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0 (parent: Microsoft.Extensions.Logging) - System.Reflection.Metadata - 1.7.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Text.Encodings.Web - 4.6.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.Extensions.DependencyModel - 3.0.0 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Ref - 3.0.0 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.Platforms - 3.0.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) * Update dependencies from https://github.com/aspnet/Extensions build 20190913.5 - Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-rc2.19463.5 - Microsoft.AspNetCore.Testing - 3.0.0-rc2.19463.5 - Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-rc2.19463.5 - Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-rc2.19463.5 - Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-rc2.19463.5 - Microsoft.Extensions.Logging - 3.0.0 Dependency coherency updates - System.Diagnostics.DiagnosticSource - 4.6.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 3.0.0 (parent: Microsoft.Extensions.Logging) - System.Reflection.Metadata - 1.7.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Text.Encodings.Web - 4.6.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.Extensions.DependencyModel - 3.0.0 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Ref - 3.0.0 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.Platforms - 3.0.0 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.Net.Compilers.Toolset - 3.3.1-beta4-19462-11 (parent: Microsoft.Extensions.Logging) * Restore test projects prior to running SDK tests (dotnet/aspnetcore-tooling#1078) * Fix 3.0 tests \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/eaf897c5428581c80ef5829cafb98104a804c9a8 --- .../BuildIncrementalismTest.cs | 4 ++-- .../MSBuildIntegrationTestBase.cs | 16 +--------------- .../IntegrationTests/PackIntegrationTest.cs | 4 ++-- .../test/IntegrationTests/ProjectDirectory.cs | 18 +++++++++--------- .../AppWithPackageAndP2PReference.csproj | 9 +++------ .../test/testassets/Directory.Build.props | 15 ++------------- 6 files changed, 19 insertions(+), 47 deletions(-) diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIncrementalismTest.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIncrementalismTest.cs index d87b5642e0..d9a4cfc8e9 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIncrementalismTest.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIncrementalismTest.cs @@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests var thumbprintLookup = new Dictionary(); // Act 1 - var result = await DotnetMSBuild("Build", runRestoreBeforeBuildOrPublish: false); + var result = await DotnetMSBuild("Build"); var directoryPath = Path.Combine(result.Project.DirectoryPath, IntermediateOutputPath); var filesToIgnore = new[] @@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests // We want to make sure nothing changed between multiple incremental builds. using (var razorGenDirectoryLock = LockDirectory(RazorIntermediateOutputPath)) { - result = await DotnetMSBuild("Build", runRestoreBeforeBuildOrPublish: false); + result = await DotnetMSBuild("Build"); } Assert.BuildPassed(result); diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/MSBuildIntegrationTestBase.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/MSBuildIntegrationTestBase.cs index e8a001c49d..b82e000de2 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/MSBuildIntegrationTestBase.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/MSBuildIntegrationTestBase.cs @@ -69,8 +69,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests bool suppressTimeout = false, bool suppressBuildServer = false, string buildServerPipeName = null, - MSBuildProcessKind msBuildProcessKind = MSBuildProcessKind.Dotnet, - bool runRestoreBeforeBuildOrPublish = true) + MSBuildProcessKind msBuildProcessKind = MSBuildProcessKind.Dotnet) { var timeout = suppressTimeout ? (TimeSpan?)Timeout.InfiniteTimeSpan : null; @@ -117,23 +116,10 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests if (!string.IsNullOrEmpty(target)) { - // Restore before build or publish - if (runRestoreBeforeBuildOrPublish && - (string.Equals("Build", target, StringComparison.OrdinalIgnoreCase) - || string.Equals("Publish", target, StringComparison.OrdinalIgnoreCase))) - { - buildArgumentList.Add($"/t:Restore"); - } - buildArgumentList.Add($"/t:{target}"); } else { - // By default, restore then build - if (runRestoreBeforeBuildOrPublish) - { - buildArgumentList.Add($"/t:Restore"); - } buildArgumentList.Add($"/t:Build"); } diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PackIntegrationTest.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PackIntegrationTest.cs index 80e404a083..f1502e0a37 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PackIntegrationTest.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/PackIntegrationTest.cs @@ -230,10 +230,10 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests [InitializeTestProject("PackageLibraryDirectDependency", additionalProjects: new[] { "PackageLibraryTransitiveDependency" })] public async Task Pack_NoBuild_IncludesStaticWebAssets() { - var result = await DotnetMSBuild("Build", runRestoreBeforeBuildOrPublish: false); + var result = await DotnetMSBuild("Build"); Assert.BuildPassed(result, allowWarnings: true); - var pack = await DotnetMSBuild("Pack", "/p:NoBuild=true", runRestoreBeforeBuildOrPublish: false); + var pack = await DotnetMSBuild("Pack", "/p:NoBuild=true"); Assert.BuildPassed(pack, allowWarnings: true); Assert.FileExists(pack, OutputPath, "PackageLibraryDirectDependency.dll"); diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/ProjectDirectory.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/ProjectDirectory.cs index 6f19052ebb..1506165b14 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/ProjectDirectory.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/ProjectDirectory.cs @@ -73,7 +73,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests var newProjectFilePath = Path.Combine(directoryPath, targetProjectName + extension); File.Move(oldProjectFilePath, newProjectFilePath); - CopyGlobalJson(repositoryRoot, destinationPath); + CopyRepositoryAssets(repositoryRoot, destinationPath); return new ProjectDirectory( destinationPath, @@ -140,16 +140,16 @@ $@" }); } - void CopyGlobalJson(string repositoryRoot, string projectRoot) + void CopyRepositoryAssets(string repositoryRoot, string projectRoot) { - var srcGlobalJson = Path.Combine(repositoryRoot, "global.json"); - if (!File.Exists(srcGlobalJson)) - { - throw new InvalidOperationException("global.json at the root of the repository could not be found. Run './build /t:Noop' at the repository root and re-run these tests."); - } + var files = new[] { "global.json", "NuGet.config" }; - var destinationGlobalJson = Path.Combine(projectRoot, "global.json"); - File.Copy(srcGlobalJson, destinationGlobalJson); + foreach (var file in files) + { + var srcFile = Path.Combine(repositoryRoot, file); + var destinationFile = Path.Combine(projectRoot, file); + File.Copy(srcFile, destinationFile); + } } } diff --git a/src/Razor/test/testassets/AppWithPackageAndP2PReference/AppWithPackageAndP2PReference.csproj b/src/Razor/test/testassets/AppWithPackageAndP2PReference/AppWithPackageAndP2PReference.csproj index 076d9b77b0..1bc4281ac7 100644 --- a/src/Razor/test/testassets/AppWithPackageAndP2PReference/AppWithPackageAndP2PReference.csproj +++ b/src/Razor/test/testassets/AppWithPackageAndP2PReference/AppWithPackageAndP2PReference.csproj @@ -1,16 +1,13 @@ - + $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ netcoreapp3.0 - $(MSBuildThisFileDirectory)..\TestPackageRestoreSource\ - - $(RestoreSources); - $(RuntimeAdditionalRestoreSources) - + $(MSBuildThisFileDirectory)..\TestPackageRestoreSource\ + $(RestoreAdditionalProjectSources);$(RuntimeAdditionalRestoreSources) diff --git a/src/Razor/test/testassets/Directory.Build.props b/src/Razor/test/testassets/Directory.Build.props index 1bdf3f0025..5d13eb6e52 100644 --- a/src/Razor/test/testassets/Directory.Build.props +++ b/src/Razor/test/testassets/Directory.Build.props @@ -18,21 +18,10 @@ $(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.props $(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets - - - - $(RestoreSources); - https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; - https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json; - https://api.nuget.org/v3/index.json; - - - - $(RestoreSources); - https://dotnet.myget.org/F/roslyn/api/v3/index.json; - + + OutOfProcess From a2081d584f4b2a0694a88132214df429513a1d26 Mon Sep 17 00:00:00 2001 From: John Luo Date: Sun, 15 Sep 2019 08:05:47 -0700 Subject: [PATCH 3/3] Fix razor tool assembly path (dotnet/aspnetcore-tooling#1138) \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/88cd749f381e5b02e5ed3dd0d9c24f2272fea816 --- .../Microsoft.NET.Sdk.Razor.CodeGeneration.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.CodeGeneration.targets b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.CodeGeneration.targets index 5cc0be05e9..25ea86a65d 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.CodeGeneration.targets +++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.CodeGeneration.targets @@ -39,7 +39,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_RazorGenerateInputsHash> <_RazorGenerateInputsHashFile>$(IntermediateOutputPath)$(MSBuildProjectName).RazorCoreGenerate.cache - <_RazorToolAssembly Condition="'$(_RazorToolAssembly)'==''">$(RazorSdkDirectoryRoot)tools\$(DefaultNetCoreTargetFramework)\rzc.dll + <_RazorToolAssembly Condition="'$(_RazorToolAssembly)'==''">$(RazorSdkDirectoryRoot)tools\netcoreapp3.1\rzc.dll