Skip to content

Commit

Permalink
Remove support for NS2x runtime tfm and rename Sdk (#8418)
Browse files Browse the repository at this point in the history
dotnet/runtime was the only consumer that dependent on runtime specific
.NETStandard tfms. Now that we are removing them with
dotnet/runtime#64610 we can also delete the
hacks to make them work in the TargetFramework package.

Also renaming the project from
Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk to
Microsoft.DotNet.Build.Tasks.TargetFramework as doesn't need to be an
msbuild sdk anymore and consuming it as a package will reduce evaluation
time.
  • Loading branch information
ViktorHofer authored Feb 1, 2022
1 parent 57e47a3 commit be22d81
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 67 deletions.
2 changes: 1 addition & 1 deletion Arcade.sln
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Helix.JobS
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.CMake.Sdk", "src\Microsoft.DotNet.CMake.Sdk\Microsoft.DotNet.CMake.Sdk.csproj", "{B1BFCB54-0FE7-4745-A471-2D7F21B5C7B9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk", "src\Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk\src\Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj", "{E83B25A9-66C3-4E15-9BC3-E843CC471622}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Build.Tasks.TargetFramework", "src\Microsoft.DotNet.Build.Tasks.TargetFramework\src\Microsoft.DotNet.Build.Tasks.TargetFramework.csproj", "{E83B25A9-66C3-4E15-9BC3-E843CC471622}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Helix.Sdk.Tests", "src\Microsoft.DotNet.Helix\Sdk.Tests\Microsoft.DotNet.Helix.Sdk.Tests\Microsoft.DotNet.Helix.Sdk.Tests.csproj", "{03390E61-9DC1-4893-93A4-193D76C16034}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$(RepoRoot)src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props;
$(RepoRoot)src/Microsoft.DotNet.Build.Tasks.Installers/build/Microsoft.DotNet.Build.Tasks.Installers.props;
$(RepoRoot)src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.common.targets;
$(RepoRoot)src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.props;
$(RepoRoot)src/Microsoft.DotNet.Build.Tasks.TargetFramework/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.props;
$(RepoRoot)src/Microsoft.DotNet.GenFacades/build/Microsoft.DotNet.GenFacades.targets;
$(RepoRoot)src/Microsoft.DotNet.SourceBuild/tasks/build/Microsoft.DotNet.SourceBuild.Tasks.props" />
</ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/SymStore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@
<_BuildsPortablePdb>false</_BuildsPortablePdb>
<_BuildsPortablePdb Condition="'$(DebugType)' == 'portable' or '$(DebugType)' == 'embedded'">true</_BuildsPortablePdb>

<!--
Support Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk TargetFrameworkSuffix property.
TODO: Remove when https://github.com/dotnet/arcade/issues/4859 is fixed.
-->
<_SymStoreTargetFramework>$(TargetFramework)</_SymStoreTargetFramework>
<_SymStoreTargetFramework Condition="'$(TargetFrameworkSuffix)' != ''">$(_SymStoreTargetFramework)-$(TargetFrameworkSuffix)</_SymStoreTargetFramework>

<_SymStoreOutputDir>$(ArtifactsSymStoreDirectory)$(OutDirName)\$(_SymStoreTargetFramework)\</_SymStoreOutputDir>
<_SymStoreOutputDir Condition="'$(PlatformName)' != 'AnyCPU'">$(_SymStoreOutputDir)$(PlatformName)\</_SymStoreOutputDir>

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Part of the TargetFramework SDK is the binplacing infrastructure which is described below. The TargetFramework SDK infrastructure itself isn't yet documented.
Part of the TargetFramework package is the binplacing infrastructure which is described below. The TargetFramework package infrastructure itself isn't yet documented.

## BinPlacing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System;
using System.IO;

namespace Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk
namespace Microsoft.DotNet.Build.Tasks.TargetFramework
{
public class ChooseBestP2PTargetFrameworkTask : BuildTask
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Collections.Generic;
using System.Linq;

namespace Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk
namespace Microsoft.DotNet.Build.Tasks.TargetFramework
{
public class ChooseBestTargetFrameworksTask : BuildTask
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable>true</IsPackable>
<Title>Configuration system for cross-targeting projects.</Title>
<PackageDescription>This package provides the following MSBuild tasks: ChooseBestTargetFrameworksTask and ChooseBestP2PTargetFrameworkTask. It is also a msbuild sdk which adds default functionality via sdk imports.</PackageDescription>
<PackageDescription>This package provides the following MSBuild tasks: ChooseBestTargetFrameworksTask and ChooseBestP2PTargetFrameworkTask.</PackageDescription>
<DefaultItemExcludes Condition="'$(TargetFramework)' != 'net472'">**/*.Desktop.*</DefaultItemExcludes>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Collections.Generic;
using System.Linq;

namespace Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk
namespace Microsoft.DotNet.Build.Tasks.TargetFramework
{
/// <summary>
/// This class uses NuGet's asset selection logic to choose the best TargetFramework given the list of supported TargetFrameworks.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<UsingTask TaskName="ChooseBestTargetFrameworksTask" AssemblyFile="$(DotNetBuildTasksTargetFrameworkSdkAssembly)"/>
<UsingTask TaskName="ChooseBestTargetFrameworksTask" AssemblyFile="$(DotNetBuildTasksTargetFrameworkAssembly)" />

<PropertyGroup>
<BinPlaceUseHardlinksIfPossible Condition="'$(BinPlaceUseHardlinksIfPossible)' == ''">true</BinPlaceUseHardlinksIfPossible>
<EnableBinPlacing Condition="'$(EnableBinPlacing)' == '' and ('$(BinPlaceNative)' == 'true' or '$(BinPlaceRef)' == 'true' or '$(BinPlaceRuntime)' == 'true' or '$(BinPlaceTest)' == 'true')">true</EnableBinPlacing>
Expand Down Expand Up @@ -59,8 +60,8 @@

<!-- This filename is chosen so that each build of every project has a uniquie filename.-->
<PropertyGroup>
<_propsFilename>$(TargetName).$(_OriginalTargetFramework)</_propsFilename>
<_propsFilename Condition="'$(TargetName)' == ''">$(MSBuildProjectName).$(_OriginalTargetFramework)</_propsFilename>
<_propsFilename>$(TargetName).$(TargetFramework)</_propsFilename>
<_propsFilename Condition="'$(TargetName)' == ''">$(MSBuildProjectName).$(TargetFramework)</_propsFilename>
<_projectDirLength>$(ProjectDir.Length)</_projectDirLength>
</PropertyGroup>

Expand Down Expand Up @@ -130,13 +131,9 @@
RuntimeGraph="$(RuntimeGraph)">
<Output TaskParameter="BestTargetFrameworks" ItemName="_bestBinPlaceTargetFrameworks" />
</ChooseBestTargetFrameworksTask>

<PropertyGroup>
<_OriginalTargetFramework Condition="'$(_OriginalTargetFramework)' == ''">$(TargetFramework)</_OriginalTargetFramework>
</PropertyGroup>

<ItemGroup>
<_currentBinPlaceTargetFrameworks Include="@(_bestBinPlaceTargetFrameworks)" Condition="'%(Identity)' == '$(_OriginalTargetFramework)'" />
<_currentBinPlaceTargetFrameworks Include="@(_bestBinPlaceTargetFrameworks)" Condition="'%(Identity)' == '$(TargetFramework)'" />

<BinPlaceDir Condition="'$(BinPlaceNative)' == 'true'" Include="@(_currentBinPlaceTargetFrameworks->'%(NativePath)')" />
<BinPlaceDir Condition="'$(BinPlaceRef)' == 'true'" Include="@(_currentBinPlaceTargetFrameworks->'%(RefPath)')" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<!-- Add unparsed TargetFrameworks property to GetTargetFrameworks return item metadata to read from it later. -->
<ItemDefinitionGroup>
<_ThisProjectBuildMetadata>
<RawTargetFrameworks>$(TargetFrameworks)</RawTargetFrameworks>
</_ThisProjectBuildMetadata>
</ItemDefinitionGroup>

<PropertyGroup>
<DotNetBuildTasksTargetFrameworkAssembly Condition="'$(DotNetBuildTasksTargetFrameworkAssembly)' == '' and '$(MSBuildRuntimeType)' == 'core'">..\tools\netcoreapp3.1\Microsoft.DotNet.Build.Tasks.TargetFramework.dll</DotNetBuildTasksTargetFrameworkAssembly>
<DotNetBuildTasksTargetFrameworkAssembly Condition="'$(DotNetBuildTasksTargetFrameworkAssembly)' == '' and '$(MSBuildRuntimeType)' != 'core'">..\tools\net472\Microsoft.DotNet.Build.Tasks.TargetFramework.dll</DotNetBuildTasksTargetFrameworkAssembly>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>

<UsingTask TaskName="ChooseBestP2PTargetFrameworkTask" AssemblyFile="$(DotNetBuildTasksTargetFrameworkSdkAssembly)" />
<UsingTask TaskName="ChooseBestTargetFrameworksTask" AssemblyFile="$(DotNetBuildTasksTargetFrameworkSdkAssembly)" />

<!-- Strip away the TargetPlatforms during the graph build restore for frameworks older than net5.0 -->
<PropertyGroup Condition="'$(IsGraphBuild)' == 'true' and '$(MSBuildRestoreSessionId)' != ''">
<TargetFrameworks Condition="'$(TargetFrameworks)' != ''">$([System.Text.RegularExpressions.Regex]::Replace('$(TargetFrameworks)', '$(TargetFrameworkPattern)', '${1}'))</TargetFrameworks>
</PropertyGroup>
<UsingTask TaskName="ChooseBestP2PTargetFrameworkTask" AssemblyFile="$(DotNetBuildTasksTargetFrameworkAssembly)" />
<UsingTask TaskName="ChooseBestTargetFrameworksTask" AssemblyFile="$(DotNetBuildTasksTargetFrameworkAssembly)" />

<!-- We filter _InnerBuildProjects items during DispatchToInnerBuilds and Clean to only run for best target frameworks. -->
<Target Name="RunOnlyBestTargetFrameworks"
Expand Down Expand Up @@ -66,10 +60,6 @@
Condition="'@(ProjectReference)' != ''"
BeforeTargets="AssignProjectConfiguration"
DependsOnTargets="ResolvePackageDependenciesForBuild">
<PropertyGroup>
<_OriginalTargetFramework Condition="'$(_OriginalTargetFramework)' == ''">$(TargetFramework)</_OriginalTargetFramework>
</PropertyGroup>

<MSBuild Projects="@(ProjectReference)"
Targets="GetTargetFrameworks"
BuildInParallel="$(BuildInParallel)"
Expand All @@ -83,7 +73,7 @@
<_ProjectReferenceWithTargetFrameworks Include="@(ProjectReference->WithMetadataValue('SkipGetTargetFrameworkProperties', 'true'))" />
</ItemGroup>

<ChooseBestP2PTargetFrameworkTask TargetFramework="$(_OriginalTargetFramework)"
<ChooseBestP2PTargetFrameworkTask TargetFramework="$(TargetFramework)"
ProjectReferencesWithTargetFrameworks="@(_ProjectReferenceWithTargetFrameworks)"
RuntimeGraph="$(RuntimeGraph)">
<Output TaskParameter="AnnotatedProjectReferencesWithSetTargetFramework" ItemName="_ProjectReferenceWithBestTargetFramework" />
Expand All @@ -95,4 +85,5 @@
</ItemGroup>
</Target>

<Import Project="BinPlace.targets" />
</Project>

0 comments on commit be22d81

Please sign in to comment.