Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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