Skip to content

Commit

Permalink
Merge pull request #28563 from dotnet/marcpopMSFT-updatetfm
Browse files Browse the repository at this point in the history
Update the sdk build to target net8.0
  • Loading branch information
nagilson authored Nov 21, 2022
2 parents 0cae939 + 923d9f5 commit 86117ad
Show file tree
Hide file tree
Showing 30 changed files with 55 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- Default to all packages generating a corresponding symbol package -->
<IncludeSymbols>true</IncludeSymbols>
<IsShippingPackage>false</IsShippingPackage>
<SdkTargetFramework>net7.0</SdkTargetFramework>
<SdkTargetFramework>net8.0</SdkTargetFramework>
<ToolsetTargetFramework>$(SdkTargetFramework)</ToolsetTargetFramework>

<!-- VS for Mac may run on a lower version of .NET than the SDK is targeting, but needs to load the resolvers. So the resolvers and dependencies
Expand Down
1 change: 1 addition & 0 deletions eng/restore-toolset.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function InitializeCustomSDKToolset {
InstallDotNetSharedFramework "3.1.0"
InstallDotNetSharedFramework "5.0.0"
InstallDotNetSharedFramework "6.0.0"
InstallDotNetSharedFramework "7.0.0-rc.2.22472.3"

CreateBuildEnvScripts
InstallNuget
Expand Down
1 change: 1 addition & 0 deletions eng/restore-toolset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function InitializeCustomSDKToolset {
InstallDotNetSharedFramework "3.1.0"
InstallDotNetSharedFramework "5.0.0"
InstallDotNetSharedFramework "6.0.0"
InstallDotNetSharedFramework "7.0.0-rc.2.22472.3"

CreateBuildEnvScript
}
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "7.0.100-rc.1.22431.12",
"dotnet": "8.0.100-alpha.1.22556.1",
"runtimes": {
"dotnet": [
"$(VSRedistCommonNetCoreSharedFrameworkx6480PackageVersion)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>$(AspNetTestTfm)</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Copyright>© Microsoft</Copyright>
<Product>Razor Test</Product>
<Company>Microsoft</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>$(AspNetTestTfm)</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Copyright>© Microsoft</Copyright>
<Product>Razor Test</Product>
<Company>Microsoft</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Copyright>© Microsoft</Copyright>
<Product>Razor Test</Product>
<Company>Microsoft</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Copyright>© Microsoft</Copyright>
<Product>Razor Test</Product>
<Company>Microsoft</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<!-- Paths to tools, tasks, and extensions are calculated relative to the BlazorWebAssemblySdkDirectoryRoot. This can be modified to test a local build. -->
<BlazorWebAssemblySdkDirectoryRoot Condition="'$(BlazorWebAssemblySdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</BlazorWebAssemblySdkDirectoryRoot>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net7.0</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net8.0</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net472</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\$(_BlazorWebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll</_BlazorWebAssemblySdkTasksAssembly>
<_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net7.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll</_BlazorWebAssemblySdkToolAssembly>
<_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net8.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll</_BlazorWebAssemblySdkToolAssembly>
</PropertyGroup>

<UsingTask TaskName="Microsoft.NET.Sdk.BlazorWebAssembly.GenerateBlazorWebAssemblyBootJson50" AssemblyFile="$(_BlazorWebAssemblySdkTasksAssembly)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<!-- Paths to tools, tasks, and extensions are calculated relative to the BlazorWebAssemblySdkDirectoryRoot. This can be modified to test a local build. -->
<BlazorWebAssemblySdkDirectoryRoot Condition="'$(BlazorWebAssemblySdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</BlazorWebAssemblySdkDirectoryRoot>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net7.0</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net8.0</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net472</_BlazorWebAssemblySdkTasksTFM>
<_BlazorWebAssemblySdkTasksAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\$(_BlazorWebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll</_BlazorWebAssemblySdkTasksAssembly>
<_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net7.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll</_BlazorWebAssemblySdkToolAssembly>
<_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net8.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll</_BlazorWebAssemblySdkToolAssembly>
</PropertyGroup>

<UsingTask TaskName="Microsoft.NET.Sdk.BlazorWebAssembly.GenerateBlazorWebAssemblyBootJson" AssemblyFile="$(_BlazorWebAssemblySdkTasksAssembly)" />
Expand Down
2 changes: 1 addition & 1 deletion src/RazorSdk/Targets/Sdk.Razor.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- Paths to tools, tasks, and extensions are calculated relative to the RazorSdkDirectoryRoot. This can be modified to test a local build. -->
<RazorSdkDirectoryRoot Condition="'$(RazorSdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</RazorSdkDirectoryRoot>
<RazorSdkBuildTasksDirectoryRoot Condition="'$(RazorSdkBuildTasksDirectoryRoot)'==''">$(RazorSdkDirectoryRoot)tasks\</RazorSdkBuildTasksDirectoryRoot>
<_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net7.0</_RazorSdkTasksTFM>
<_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net8.0</_RazorSdkTasksTFM>
<_RazorSdkTasksTFM Condition=" '$(_RazorSdkTasksTFM)' == ''">net472</_RazorSdkTasksTFM>
<RazorSdkBuildTasksAssembly>$(RazorSdkBuildTasksDirectoryRoot)$(_RazorSdkTasksTFM)\Microsoft.NET.Sdk.Razor.Tasks.dll</RazorSdkBuildTasksAssembly>
<_RazorSdkToolAssembly>$(RazorSdkDirectoryRoot)tools\rzc.dll</_RazorSdkToolAssembly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion.TrimStart('vV'))</_TargetFrameworkVersionWithoutV>

<MicrosoftNETBuildExtensionsTasksAssembly Condition="'$(MicrosoftNETBuildExtensionsTasksAssembly)' == '' AND '$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)\tools\net7.0\Microsoft.NET.Build.Extensions.Tasks.dll</MicrosoftNETBuildExtensionsTasksAssembly>
<MicrosoftNETBuildExtensionsTasksAssembly Condition="'$(MicrosoftNETBuildExtensionsTasksAssembly)' == '' AND '$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)\tools\net8.0\Microsoft.NET.Build.Extensions.Tasks.dll</MicrosoftNETBuildExtensionsTasksAssembly>
<MicrosoftNETBuildExtensionsTasksAssembly Condition="'$(MicrosoftNETBuildExtensionsTasksAssembly)' == ''">$(MSBuildThisFileDirectory)\tools\net472\Microsoft.NET.Build.Extensions.Tasks.dll</MicrosoftNETBuildExtensionsTasksAssembly>

<!-- Include conflict resolution targets for NETFramework and allow other frameworks to opt-in -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Copyright (c) .NET Foundation. All rights reserved.
Condition=" '$(DisableImplicitFrameworkDefines)' != 'true' and '$(TargetPlatformIdentifier)' != '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0)) " >
<ItemGroup>
<_SupportedPlatformCompatibleVersions Include="@(SdkSupportedTargetPlatformVersion)" Condition=" %(Identity) != '' and $([MSBuild]::VersionLessThanOrEquals(%(Identity), $(TargetPlatformVersion))) " />
<_ImplicitDefineConstant Include="@(_SupportedPlatformCompatibleVersions->'$(TargetPlatformIdentifier.ToUpper())%(Identity)_OR_GREATER'->Replace('.', '_'))" />
<_ImplicitDefineConstant Include="@(_SupportedPlatformCompatibleVersions->Distinct()->'$(TargetPlatformIdentifier.ToUpper())%(Identity)_OR_GREATER'->Replace('.', '_'))" />
</ItemGroup>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<PropertyGroup>
<MicrosoftNETBuildTasksDirectoryRoot>$(MSBuildThisFileDirectory)..\tools\</MicrosoftNETBuildTasksDirectoryRoot>
<MicrosoftNETBuildTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net7.0</MicrosoftNETBuildTasksTFM>
<MicrosoftNETBuildTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net8.0</MicrosoftNETBuildTasksTFM>
<MicrosoftNETBuildTasksTFM Condition=" '$(MicrosoftNETBuildTasksTFM)' == ''">net472</MicrosoftNETBuildTasksTFM>
<MicrosoftNETBuildTasksDirectory>$(MicrosoftNETBuildTasksDirectoryRoot)$(MicrosoftNETBuildTasksTFM)\</MicrosoftNETBuildTasksDirectory>
<MicrosoftNETBuildTasksAssembly>$(MicrosoftNETBuildTasksDirectory)Microsoft.NET.Build.Tasks.dll</MicrosoftNETBuildTasksAssembly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public void It_fails_if_windows_target_platform_version_is_invalid()
.HaveStdOutContaining("NETSDK1140");
}

[WindowsOnlyTheory]
[WindowsOnlyTheory(Skip="https://github.com/dotnet/sdk/pull/29009")]
[InlineData(true)]
[InlineData(false)]
public void It_succeeds_if_windows_target_platform_version_does_not_have_trailing_zeros(bool setInTargetframework)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ public void It_includes_internals_visible_to()

[RequiresMSBuildVersionTheory("17.0.0.32901")]
[InlineData(true, true, "net5.0")]
[InlineData(true, true, ToolsetInfo.CurrentTargetFramework)]
[InlineData(true, false, ToolsetInfo.CurrentTargetFramework)]
[InlineData(false, false, ToolsetInfo.CurrentTargetFramework)]
[InlineData(true, true, ToolsetInfo.NextTargetFramework)]
[InlineData(true, false, ToolsetInfo.NextTargetFramework)]
[InlineData(false, false, ToolsetInfo.NextTargetFramework)]
public void TestPreviewFeatures(bool enablePreviewFeatures, bool generateRequiresPreviewFeaturesAttribute, string targetFramework)
{
var testAsset = _testAssetsManager
Expand Down Expand Up @@ -419,7 +419,7 @@ public void TestPreviewFeatures(bool enablePreviewFeatures, bool generateRequire

if (enablePreviewFeatures && generateRequiresPreviewFeaturesAttribute)
{
if (targetFramework == ToolsetInfo.CurrentTargetFramework)
if (targetFramework == ToolsetInfo.NextTargetFramework)
{
Assert.Equal("Preview", langVersion);
Assert.True(contains);
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/Microsoft.NET.Build.Tests/ReferenceExeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public void ExeProjectCanReferenceTestProject(string testTemplateName)
var testConsoleProject = new TestProject("ConsoleApp")
{
IsExe = true,
TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
TargetFrameworks = ToolsetInfo.NextTargetFramework,
RuntimeIdentifier = EnvironmentInfo.GetCompatibleRid()
};

Expand Down
11 changes: 7 additions & 4 deletions src/Tests/Microsoft.NET.Publish.Tests/PublishTestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,32 @@ namespace Microsoft.NET.Publish.Tests
{
internal static class PublishTestUtils
{
#if NET7_0
#if NET8_0

public static IEnumerable<object[]> SupportedTfms { get; } = new List<object[]>
{
new object[] { "netcoreapp3.1" },
new object[] { "net5.0" },
new object[] { "net6.0" },
new object[] { ToolsetInfo.CurrentTargetFramework }
new object[] { ToolsetInfo.CurrentTargetFramework },
new object[] { ToolsetInfo.NextTargetFramework }
};

// This list should contain all supported TFMs after net5.0
public static IEnumerable<object[]> Net5Plus { get; } = new List<object[]>
{
new object[] { "net5.0" },
new object[] { "net6.0" },
new object[] { ToolsetInfo.CurrentTargetFramework }
new object[] { ToolsetInfo.CurrentTargetFramework },
new object[] { ToolsetInfo.NextTargetFramework }
};

// This list should contain all supported TFMs after net6.0
public static IEnumerable<object[]> Net6Plus { get; } = new List<object[]>
{
new object[] { "net6.0" },
new object[] { ToolsetInfo.CurrentTargetFramework }
new object[] { ToolsetInfo.CurrentTargetFramework },
new object[] { ToolsetInfo.NextTargetFramework }
};
#else
#error If building for a newer TFM, please update the values above
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2195,12 +2195,12 @@ public void Pack_MultipleTargetFrameworks_WithScopedCssAndJsModules_IncludesAsse
var parse = XDocument.Parse($@"<Project Sdk=""Microsoft.NET.Sdk.Razor"">
<PropertyGroup>
<TargetFrameworks>{ToolsetInfo.CurrentTargetFramework};net6.0;net5.0</TargetFrameworks>
<TargetFrameworks>net8.0;{ToolsetInfo.CurrentTargetFramework};net6.0;net5.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Condition=""'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == '{ToolsetInfo.CurrentTargetFramework}'"" Include=""browser"" />
<SupportedPlatform Condition=""'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == '{ToolsetInfo.CurrentTargetFramework}'"" Include=""browser"" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -2272,12 +2272,12 @@ public void Pack_Incremental_MultipleTargetFrameworks_WithScopedCssAndJsModules_
var parse = XDocument.Parse($@"<Project Sdk=""Microsoft.NET.Sdk.Razor"">
<PropertyGroup>
<TargetFrameworks>{ToolsetInfo.CurrentTargetFramework};net6.0;net5.0</TargetFrameworks>
<TargetFrameworks>net8.0;{ToolsetInfo.CurrentTargetFramework};net6.0;net5.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Condition=""'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == '{ToolsetInfo.CurrentTargetFramework}'"" Include=""browser"" />
<SupportedPlatform Condition=""'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == '{ToolsetInfo.CurrentTargetFramework}'"" Include=""browser"" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -2351,12 +2351,12 @@ public void Pack_MultipleTargetFrameworks_WithScopedCssAndJsModules_DoesNotInclu
var parse = XDocument.Parse($@"<Project Sdk=""Microsoft.NET.Sdk.Razor"">
<PropertyGroup>
<TargetFrameworks>{ToolsetInfo.CurrentTargetFramework};net6.0;net5.0</TargetFrameworks>
<TargetFrameworks>net8.0;{ToolsetInfo.CurrentTargetFramework};net6.0;net5.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Condition=""'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == '{ToolsetInfo.CurrentTargetFramework}'"" Include=""browser"" />
<SupportedPlatform Condition=""'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == '{ToolsetInfo.CurrentTargetFramework}'"" Include=""browser"" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void TestGetManifests()
}
}

[Fact]
[Fact(Skip="https://github.com/dotnet/sdk/issues/28759")]
public void GetPackDefinitionLocations()
{
var definitionLocations = GetWorkloadPackDefinitionLocations(GetManifests());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ gitignore
globaljson
grpc
mstest
mstest-playwright
mvc
nugetconfig
nunit
NUnit-playwright
nunit-test
page
proto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ gitignore
globaljson
grpc
mstest
mstest-playwright
mvc
nugetconfig
nunit
NUnit-playwright
nunit-test
page
proto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ gitignore
globaljson
grpc
mstest
mstest-playwright
mvc
nugetconfig
nunit
NUnit-playwright
nunit-test
page
proto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ dotnet gitignore file gitignore Co
Dotnet local tool manifest file tool-manifest Config
EditorConfig file editorconfig Config
global.json file globaljson Config
MSTest Playwright Test Project mstest-playwright [C#] Test/MSTest/Playwright
MSTest Test Project mstest [C#],F#,VB Test/MSTest
MVC ViewImports viewimports [C#] Web/ASP.NET
MVC ViewStart viewstart [C#] Web/ASP.NET
NuGet Config nugetconfig Config
NUnit 3 Test Item nunit-test [C#],F#,VB Test/NUnit
NUnit 3 Test Project nunit [C#],F#,VB Test/NUnit
NUnit Playwright Test Project NUnit-playwright [C#] Test/NUnit/Playwright
Protocol Buffer File proto Web/gRPC
Razor Class Library razorclasslib [C#] Web/Razor/Library
Razor Component razorcomponent [C#] Web/ASP.NET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ dotnet gitignore file gitignore Co
Dotnet local tool manifest file tool-manifest Config
EditorConfig file editorconfig Config
global.json file globaljson Config
MSTest Playwright Test Project mstest-playwright [C#] Test/MSTest/Playwright
MSTest Test Project mstest [C#],F#,VB Test/MSTest
MVC ViewImports viewimports [C#] Web/ASP.NET
MVC ViewStart viewstart [C#] Web/ASP.NET
NuGet Config nugetconfig Config
NUnit 3 Test Item nunit-test [C#],F#,VB Test/NUnit
NUnit 3 Test Project nunit [C#],F#,VB Test/NUnit
NUnit Playwright Test Project NUnit-playwright [C#] Test/NUnit/Playwright
Protocol Buffer File proto Web/gRPC
Razor Class Library razorclasslib [C#] Web/Razor/Library
Razor Component razorcomponent [C#] Web/ASP.NET
Expand Down
Loading

0 comments on commit 86117ad

Please sign in to comment.