From 667a861a45e9cfb2725fa4e2b98a8e9d18929b3a Mon Sep 17 00:00:00 2001 From: Sarah Oslund Date: Tue, 11 Aug 2020 10:10:14 -0700 Subject: [PATCH 1/4] Rename SdkSupportedTargetPlatform, add SupportedTargetPlatform --- .../Microsoft.NET.Sdk.BeforeCommon.targets | 5 +++-- .../targets/Microsoft.NET.Sdk.props | 5 ++++- ...crosoft.NET.SupportedTargetPlatforms.props | 21 +++++++++++++++++++ ...osoft.NET.TargetFrameworkInference.targets | 6 +++--- ....WindowsSdkSupportedTargetPlatforms.props} | 14 ++++++------- .../GivenThatWeWantToBuildALibrary.cs | 8 +++---- 6 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props rename src/Tasks/Microsoft.NET.Build.Tasks/targets/{Microsoft.NET.WindowsSupportedTargetPlatforms.props => Microsoft.NET.WindowsSdkSupportedTargetPlatforms.props} (57%) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets index d50d7192a596..55bf28e46dfa 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets @@ -16,7 +16,8 @@ Copyright (c) .NET Foundation. All rights reserved. - + + + + + - + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props new file mode 100644 index 000000000000..41fc4aad60dd --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props @@ -0,0 +1,21 @@ + + + + + + + + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets index c731a14b406f..13c1ee757783 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets @@ -198,7 +198,7 @@ Copyright (c) .NET Foundation. All rights reserved. BeforeTargets="ProcessFrameworkReferences" Condition="'$(TargetPlatformVersion)' != '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0))"> - <_ValidTargetPlatformVersion Include="@(SupportedTargetPlatform)" Condition="'@(SupportedTargetPlatform)' != '' and $([MSBuild]::VersionEquals(%(Identity), $(TargetPlatformVersion)))" /> + <_ValidTargetPlatformVersion Include="@(SdkSupportedTargetPlatform)" Condition="'@(SdkSupportedTargetPlatform)' != '' and $([MSBuild]::VersionEquals(%(Identity), $(TargetPlatformVersion)))" /> @@ -212,8 +212,8 @@ Copyright (c) .NET Foundation. All rights reserved. Condition="'$(TargetPlatformVersion)' != '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0))"> true - <_ValidTargetPlatformVersions Condition="'@(SupportedTargetPlatform)' != ''" >@(SupportedTargetPlatform, '%0a') - <_ValidTargetPlatformVersions Condition="'@(SupportedTargetPlatform)' == ''" >None + <_ValidTargetPlatformVersions Condition="'@(SdkSupportedTargetPlatform)' != ''" >@(SdkSupportedTargetPlatform, '%0a') + <_ValidTargetPlatformVersions Condition="'@(SdkSupportedTargetPlatform)' == ''" >None - - - - - + + + + + - + diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs index dfb19aaba2d8..f9444d95de7f 100644 --- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs +++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs @@ -454,8 +454,8 @@ public void It_implicitly_defines_compilation_constants_for_the_target_platform( [Theory] [InlineData(new[] { "1.0", "1.1" }, "ios", "1.1", new[] { "IOS", "IOS1_1", "IOS1_0" })] [InlineData(new[] { "11.11", "12.12", "13.13" }, "android", "12.12", new[] { "ANDROID", "ANDROID11_11", "ANDROID12_12" })] - [InlineData(new string[] { /* Use the built in SupportedTargetPlatform items */}, "windows", "10.0.19041", new[] { "WINDOWS", "WINDOWS7_0", "WINDOWS8_0", "WINDOWS10_0_17763", "WINDOWS10_0_18362", "WINDOWS10_0_19041" })] - public void It_implicitly_defines_compilation_constants_for_the_target_platform_with_backwards_compatibility(string[] supportedTargetPlatform, string targetPlatformIdentifier, string targetPlatformVersion, string[] expectedDefines) + [InlineData(new string[] { /* Use the built in SdkSupportedTargetPlatform items */}, "windows", "10.0.19041", new[] { "WINDOWS", "WINDOWS7_0", "WINDOWS8_0", "WINDOWS10_0_17763", "WINDOWS10_0_18362", "WINDOWS10_0_19041" })] + public void It_implicitly_defines_compilation_constants_for_the_target_platform_with_backwards_compatibility(string[] sdkSupportedTargetPlatform, string targetPlatformIdentifier, string targetPlatformVersion, string[] expectedDefines) { var targetFramework = "net5.0"; var testAsset = _testAssetsManager @@ -480,9 +480,9 @@ public void It_implicitly_defines_compilation_constants_for_the_target_platform_ var itemGroup = new XElement(ns + "ItemGroup"); project.Root.Add(itemGroup); - foreach (var targetPlatform in supportedTargetPlatform) + foreach (var targetPlatform in sdkSupportedTargetPlatform) { - itemGroup.Add(new XElement(ns + "SupportedTargetPlatform", new XAttribute("Include", targetPlatform))); + itemGroup.Add(new XElement(ns + "SdkSupportedTargetPlatform", new XAttribute("Include", targetPlatform))); } }); From 1a22b5c3fe9a4c6960ca3e890c26d175086b2105 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 19 Aug 2020 06:32:05 -0700 Subject: [PATCH 2/4] Fix typo in name Experimenting to see what happens if I edit a different repo --- .../targets/Microsoft.NET.SupportedTargetPlatforms.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props index 41fc4aad60dd..0b529130bd58 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props @@ -1,6 +1,6 @@ - + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedPlatforms.props similarity index 78% rename from src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props rename to src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedPlatforms.props index 5730aff610f7..e78da5619f0e 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedTargetPlatforms.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedPlatforms.props @@ -1,6 +1,6 @@ diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSdkSupportedTargetPlatforms.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSdkSupportedTargetPlatforms.props index 5c36c328b7bd..b27e16caff12 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSdkSupportedTargetPlatforms.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSdkSupportedTargetPlatforms.props @@ -10,7 +10,7 @@ Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> - +