Skip to content

Commit

Permalink
Reverting #12084 (#12418)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoslund authored Jul 10, 2020
1 parent abd85ed commit 9efb3e7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ Copyright (c) .NET Foundation. All rights reserved.
ResourceName="CppRequiresTFMVersion31"
/>
</Target>

<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0))">
<_EnableDefaultWindowsPlatform Condition="'$(_EnableDefaultWindowsPlatform)' == ''" >false</_EnableDefaultWindowsPlatform>
<UseOSWinMdReferences>false</UseOSWinMdReferences>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' And '$(NETStandardMaximumVersion)' == ''">
<NETStandardMaximumVersion>2.1</NETStandardMaximumVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public void It_implicitly_defines_compilation_constants_for_the_target_framework
itemGroup.Add(supportedFramework);
});

AssertDefinedConstantsOutput(testAsset, targetFramework, new[] { "NETCOREAPP", "NET" }.Concat(expectedDefines).ToArray());
AssertDefinedConstantsOutput(testAsset, targetFramework, new[] { "NETCOREAPP", "NET", "WINDOWS", "WINDOWS7_0" }.Concat(expectedDefines).ToArray());
}

[Theory]
Expand Down Expand Up @@ -498,38 +498,6 @@ public void It_fails_gracefully_if_targetframework_should_be_targetframeworks(bo
$"The TargetFramework value '{targetFramework}' is not valid. To multi-target, use the 'TargetFrameworks' property instead");
}

[RequiresMSBuildVersionTheory("16.7.0-preview-20310-07")]
[InlineData("net5.0", false)]
[InlineData("netcoreapp3.1", true)]
public void It_defines_target_platform_defaults_correctly(string targetFramework, bool defaultsDefined)
{
TestProject testProject = new TestProject()
{
Name = "TargetPlatformDefaults",
IsSdkProject = true,
TargetFrameworks = targetFramework
};

var testAsset = _testAssetsManager.CreateTestProject(testProject);

var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), targetFramework, "TargetPlatformIdentifier");
getValuesCommand
.Execute()
.Should()
.Pass();

var values = getValuesCommand.GetValues();
if (defaultsDefined)
{
values.Count().Should().Be(1);
values.FirstOrDefault().Should().Be("Windows");
}
else
{
values.Count().Should().Be(0);
}
}

private void TestInvalidTargetFramework(string testName, string targetFramework, bool useSolution, string expectedOutput)
{
var testProject = new TestProject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void It_implicitly_defines_compilation_constants_for_the_configuration(st
[InlineData("net45", new[] { "NETFRAMEWORK=-1", "NET45=-1" }, true)]
[InlineData("net461", new[] { "NETFRAMEWORK=-1", "NET461=-1" }, true)]
[InlineData("netcoreapp1.0", new[] { "NETCOREAPP=-1", "NETCOREAPP1_0=-1", "_MyType=\"Empty\"" }, false)]
[InlineData("net5.0", new[] { "NET=-1", "NET5_0=-1", "NETCOREAPP=-1", "NETCOREAPP3_1=-1", "_MyType=\"Empty\"" }, false)]
[InlineData("net5.0", new[] { "NET=-1", "NET5_0=-1", "NETCOREAPP=-1", "NETCOREAPP3_1=-1", "WINDOWS=-1", "WINDOWS7_0=-1", "_MyType=\"Empty\"" }, false)]
[InlineData(".NETPortable,Version=v4.5,Profile=Profile78", new string[] { "_MyType=\"Empty\"" }, false)]
[InlineData(".NETFramework,Version=v4.0,Profile=Client", new string[] { "NETFRAMEWORK=-1", "NET40=-1" }, false)]
[InlineData("Xamarin.iOS,Version=v1.0", new string[] { "XAMARINIOS=-1", "XAMARINIOS1_0=-1", "_MyType=\"Empty\"" }, false)]
Expand Down

0 comments on commit 9efb3e7

Please sign in to comment.