Skip to content

Commit d0d5da1

Browse files
authored
Fix yellow triangle of horror (#4990)
* Fix yellow triangle of horror * typo
1 parent e33831a commit d0d5da1

File tree

5 files changed

+34
-66
lines changed

5 files changed

+34
-66
lines changed

src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
3232
<PropertyGroup>
3333
<EnableDefaultCompileItems Condition=" '$(EnableDefaultCompileItems)' == '' ">false</EnableDefaultCompileItems> <!--- Do not glob F# source files -->
3434
<EnableDefaultNoneItems Condition=" '$(EnableDefaultNoneItems)' == '' ">false</EnableDefaultNoneItems>
35-
<DefaultValueTuplePackageVersion>4.3.1</DefaultValueTuplePackageVersion>
36-
<DefaultFSharpPackageVersion>4.3.4</DefaultFSharpPackageVersion>
3735
</PropertyGroup>
3836

3937
<PropertyGroup>
@@ -67,14 +65,35 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
6765
<FscToolExe Condition="'$(OS)' == 'Unix' and '$(FscToolExe)' == ''">RunFsc.sh</FscToolExe>
6866
</PropertyGroup>
6967

70-
<ItemGroup>
71-
<PackageReference Include="System.ValueTuple" Version="$(DefaultValueTuplePackageVersion)" >
72-
<DefaultInclude>true</DefaultInclude>
73-
</PackageReference>
68+
<ItemGroup Condition="'$(DisableImplicitSystemValueTupleReference)' != 'true'
69+
and ('$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == '.NETCoreApp')
70+
and !('$(_TargetFrameworkVersionWithoutV)' >= '2.0' )">
71+
<PackageReference Include="System.ValueTuple" Version="$(ValueTupleImplicitPackageVersion)" />
72+
</ItemGroup>
73+
74+
<PropertyGroup>
75+
<DefaultValueTuplePackageVersion>4.3.1</DefaultValueTuplePackageVersion>
76+
<DefaultFSharpCorePackageVersion>4.3.4</DefaultFSharpCorePackageVersion>
77+
<ValueTupleImplicitPackageVersion>$(DefaultValueTuplePackageVersion)</ValueTupleImplicitPackageVersion>
78+
<FSharpCoreImplicitPackageVersion>$(DefaultFSharpCorePackageVersion)</FSharpCoreImplicitPackageVersion>
79+
</PropertyGroup>
80+
81+
<ItemGroup Condition="'$(DisableImplicitSystemValueTupleReference)' != 'true'
82+
and ('$(TargetFrameworkIdentifier)' == '.NETFramework'
83+
and ('$(_TargetFrameworkVersionWithoutV)' == ''
84+
or '$(_TargetFrameworkVersionWithoutV)' == '4.0' or
85+
'$(_TargetFrameworkVersionWithoutV)' == '4.5' or
86+
'$(_TargetFrameworkVersionWithoutV)' == '4.5.1' or
87+
'$(_TargetFrameworkVersionWithoutV)' == '4.5.2' or
88+
'$(_TargetFrameworkVersionWithoutV)' == '4.6' or
89+
'$(_TargetFrameworkVersionWithoutV)' == '4.6.1' or
90+
'$(_TargetFrameworkVersionWithoutV)' == '4.6.2' or
91+
'$(_TargetFrameworkVersionWithoutV)' == '4.7')) ">
92+
<PackageReference Include="System.ValueTuple" Version="$(ValueTupleImplicitPackageVersion)" />
93+
</ItemGroup>
7494

75-
<PackageReference Include="FSharp.Core" Version="$(DefaultFSharpPackageVersion)">
76-
<DefaultInclude>true</DefaultInclude>
77-
</PackageReference>
95+
<ItemGroup Condition="'$(DisableImplicitFSharpCoreReference)' != 'true'">
96+
<PackageReference Include="FSharp.Core" Version="$(FSharpCoreImplicitPackageVersion)" />
7897
</ItemGroup>
7998

8099
</Project>

src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
3535
<_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" Condition=" '$(NoStdLib)' != 'true' " />
3636
</ItemGroup>
3737

38-
<PropertyGroup>
39-
<_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion)</_TargetFrameworkVersionWithoutV>
40-
<_TargetFrameworkVersionWithoutV Condition="$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion.Substring(1))</_TargetFrameworkVersionWithoutV>
41-
</PropertyGroup>
42-
4338
<PropertyGroup>
4439
<TargetProfile Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' " >mscorlib</TargetProfile>
4540
<TargetProfile Condition=" '$(TargetFrameworkIdentifier)' != '.NETFramework' " >netcore</TargetProfile>
@@ -53,60 +48,10 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
5348
<PackProjectInputFile>$(MSBuildProjectFullPath)</PackProjectInputFile>
5449
</PropertyGroup>
5550

56-
<PropertyGroup>
57-
<_FrameworkNeedsValueTupleReference Condition=" ('$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == '.NETCoreApp') and !('$(_TargetFrameworkVersionWithoutV)' >= '2.0') ">true</_FrameworkNeedsValueTupleReference>
58-
<_FrameworkNeedsValueTupleReference Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' and
59-
('$(_TargetFrameworkVersionWithoutV)' == '' or
60-
'$(_TargetFrameworkVersionWithoutV)' == '4.0' or
61-
'$(_TargetFrameworkVersionWithoutV)' == '4.5' or
62-
'$(_TargetFrameworkVersionWithoutV)' == '4.6' or
63-
'$(_TargetFrameworkVersionWithoutV)' == '4.6.1' or
64-
'$(_TargetFrameworkVersionWithoutV)' == '4.6.2' or
65-
'$(_TargetFrameworkVersionWithoutV)' == '4.7') ">true</_FrameworkNeedsValueTupleReference>
66-
</PropertyGroup>
67-
6851
<PropertyGroup>
6952
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackageFSharpDesignTimeTools</TargetsForTfmSpecificContentInPackage>
7053
</PropertyGroup>
7154

72-
<Target Name="FSharpCorePackageReferences" BeforeTargets="CollectPackageReferences;">
73-
<ItemGroup>
74-
<FSharpCorePackages Include="@(PackageReference)" Condition=" '%(Identity)' == 'FSharp.Core' " />
75-
<PackageReference Update="FSharp.Core" Version="$(FSharpCoreImplicitPackageVersion)"
76-
Condition=" ('%(PackageReference.Identity)' == 'FSharp.Core')
77-
and ('%(PackageReference.Version)' == '$(DefaultFSharpPackageVersion)')
78-
and ('%(PackageReference.DefaultInclude)' == 'true')
79-
and ('$(DisableImplicitFSharpCoreReference)' != 'true')
80-
and ('$(FSharpCoreImplicitPackageVersion)' != '')
81-
and (@(FSharpCorePackages->Count()) == 1) " />
82-
<PackageReference Remove="FSharp.Core"
83-
Condition=" (('$(DisableImplicitFSharpCoreReference)' == 'true') or (@(FSharpCorePackages->Count()) &gt; 1))
84-
and ('%(PackageReference.Identity)' == 'FSharp.Core')
85-
and ('%(PackageReference.Version)' == '$(DefaultFSharpPackageVersion)')
86-
and ('%(PackageReference.DefaultInclude)' == 'true') " />
87-
</ItemGroup>
88-
</Target>
89-
90-
<Target Name="ValueTuplePackageReferences" BeforeTargets="CollectPackageReferences;">
91-
<Message Text="PackageReferences: ValueTuplePackageReferences start : @(PackageReference)" />
92-
<ItemGroup>
93-
<ValueTuplePackages Include="@(PackageReference)" Condition=" '%(Identity)' == 'System.ValueTuple' " />
94-
<PackageReference Update="System.ValueTuple" Version="$(ValueTupleImplicitPackageVersion)"
95-
Condition=" ('%(PackageReference.Identity)' == 'System.ValueTuple')
96-
and ('%(PackageReference.Version)' == '$(DefaultValueTuplePackageVersion)')
97-
and ('%(PackageReference.DefaultInclude)' == 'true')
98-
and ('$(ValueTupleImplicitPackageVersion)' != '')
99-
and ('$(DisableImplicitSystemValueTupleReference)' != 'true')
100-
and ('$(_FrameworkNeedsValueTupleReference)' == 'true')
101-
and (@(ValueTuplePackages->Count()) == 1) " />
102-
<PackageReference Remove="System.ValueTuple"
103-
Condition=" ( ('$(DisableImplicitSystemValueTupleReference)' == 'true') or ('$(_FrameworkNeedsValueTupleReference)' != 'true') or (@(ValueTuplePackages->Count()) &gt; 1) )
104-
and ('%(PackageReference.Identity)' == 'System.ValueTuple')
105-
and ('%(PackageReference.Version)' == '$(DefaultValueTuplePackageVersion)')
106-
and ('%(PackageReference.DefaultInclude)' == 'true') " />
107-
</ItemGroup>
108-
</Target>
109-
11055
<Target Name="PackageFSharpDesignTimeTools" DependsOnTargets="_GetFrameworkAssemblyReferences">
11156
<PropertyGroup>
11257
<FSharpDesignTimeProtocol Condition = " '$(FSharpDesignTimeProtocol)' == '' ">fsharp41</FSharpDesignTimeProtocol>

tests/fsharp/SDKTests/tests/DefaultImplicitReferenceTest.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<PropertyGroup>
99
<ExpectsFSharpCore>true</ExpectsFSharpCore>
10-
<ExpectedFSharpCorePackageVersion>$(DefaultFSharpPackageVersion)</ExpectedFSharpCorePackageVersion>
10+
<ExpectedFSharpCorePackageVersion>$(DefaultFSharpCorePackageVersion)</ExpectedFSharpCorePackageVersion>
1111

1212
<ExpectsValueTuple>true</ExpectsValueTuple>
1313
<ExpectedValueTuplePackageVersion>$(DefaultValueTuplePackageVersion)</ExpectedValueTuplePackageVersion>

tests/fsharp/SDKTests/tests/Test.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

33
<PropertyGroup>
4+
45
<TargetFramework Condition="'$(TargetFramework)' == ''">net46</TargetFramework>
6+
<_TargetFrameworkVersionWithoutV Condition="'$(_TargetFrameworkVersionWithoutV)' == ''">4.6</_TargetFrameworkVersionWithoutV>
7+
<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
8+
59
<Configuration Condition="'$(Configuration)' == ''">release</Configuration>
610
<BinariesDirectory>$(MSBuildThisFileDirectory)..\..\..\..\$(Configuration)\net40\bin</BinariesDirectory>
711

tests/fsharp/SDKTests/tests/Test.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<Import Project="$(BinariesDirectory)\Microsoft.FSharp.NetSdk.targets" />
44

5-
<Target Name="Test" DependsOnTargets="FSharpCorePackageReferences;ValueTuplePackageReferences">
5+
<Target Name="Test">
66

77
<Message Importance="High" Text="Testing : $(MSBuildProjectName)" />
88
<ItemGroup>

0 commit comments

Comments
 (0)