Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit98e6821

Browse files
KevinRansombrettfo
authored andcommitted
Resolve magic on sdk (#3018)
* Remove comment ifdefs* Add Microsoft.NET.Sdk.FSharp.props* Make TargetFrameworks work* restore {BuildSuffix}* rename sdk targets and props, refactor project logic into our repo* wrong name* Add automagic FSharp.Core reference for coreclr* Set <DefaultProjectTypeGuid to F# project system guid* Fix setup* Resolve magic* resolve magic
1 parentb91327c commit98e6821

File tree

1 file changed

+39
-43
lines changed

1 file changed

+39
-43
lines changed

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

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,86 +24,82 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
2424
<DefineCommonCapabilitiesCondition=" '$(DefineCommonCapabilities)' == ''">true</DefineCommonCapabilities>
2525
</PropertyGroup>
2626

27-
<PropertyGroup>
28-
<TargetProfileCondition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'" >mscorlib</TargetProfile>
29-
<TargetProfileCondition=" '$(TargetFrameworkIdentifier)' != '.NETFramework'" >netcore</TargetProfile>
30-
<OtherFlags>$(OtherFlags) --simpleresolution --nocopyfsharpcore</OtherFlags>
31-
</PropertyGroup>
32-
3327
<ItemGroupCondition="'$(_DebugSymbolsProduced)' == 'true' and '$(PdbFile)' != ''">
3428
<_DebugSymbolsIntermediatePathTemporaryInclude="$(PdbFile)"/>
3529
<!-- Add any missing .pdb extension, as the compiler does-->
3630
<_DebugSymbolsIntermediatePathInclude="@(_DebugSymbolsIntermediatePathTemporary->'%(RootDir)%(Directory)%(Filename).pdb')"/>
3731
</ItemGroup>
3832

33+
34+
<!-- Import design time targets for Roslyn Project System. These are only available if Visual Studio is installed.-->
35+
<!-- Import design time targets before the common targets, which import targets from Nuget.-->
36+
<PropertyGroup>
37+
<FSharpDesignTimeTargetsPathCondition="'$(FSharpDesignTimeTargetsPath)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.FSharp.DesignTime.targets</FSharpDesignTimeTargetsPath>
38+
</PropertyGroup>
39+
<ImportCondition=" Exists('$(FSharpDesignTimeTargetsPath)')"Project="$(FSharpDesignTimeTargetsPath)" />
40+
3941
<!-- Locate and add mscorlib, unless NoStdLib is set-->
4042
<ItemGroup>
4143
<_ExplicitReferenceInclude="$(FrameworkPathOverride)\mscorlib.dll"Condition=" '$(NoStdLib)' != 'true'" />
4244
</ItemGroup>
4345

44-
<!-- Import design time targets for Roslyn Project System. These are only available if Visual Studio is installed.-->
45-
<!-- Import design time targets before the common targets, which import targets from Nuget.-->
4646
<PropertyGroup>
47-
<FSharpDesignTimeTargetsPathCondition="'$(FSharpDesignTimeTargetsPath)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.FSharp.DesignTime.targets</FSharpDesignTimeTargetsPath>
47+
<TargetProfileCondition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'" >mscorlib</TargetProfile>
48+
<TargetProfileCondition=" '$(TargetFrameworkIdentifier)' != '.NETFramework'" >netcore</TargetProfile>
49+
<OtherFlags>$(OtherFlags) --simpleresolution --nocopyfsharpcore</OtherFlags>
4850
</PropertyGroup>
4951

50-
<ImportCondition=" Exists('$(FSharpDesignTimeTargetsPath)')"Project="$(FSharpDesignTimeTargetsPath)" />
5152
<ImportProject="Microsoft.FSharp.targets" />
5253

5354
<PropertyGroupCondition="'$(PackProjectInputFile)' == ''">
5455
<PackProjectInputFile>$(MSBuildProjectFullPath)</PackProjectInputFile>
5556
</PropertyGroup>
5657

57-
<!-- Always reference ValueTuple-->
58-
<ItemGroup Condition =" '$(DisableValueTupleReference)' == ''">
59-
<PackageReferenceInclude="System.ValueTuple"Version="4.3.0" />
60-
</ItemGroup>
61-
6258
<!--
6359
Always reference FSharp.core for coreclr builds
64-
FSharpCorePackageIdentity = Name of package to reference (Default = Microsoft.FSharp.Core.netcore)
65-
FSharpCorePackageVersion = Version of package to reference (Default = TargetFramework = netcoreapp1.0-1.1 netstandard1.0-1.6 then '1.0.0-*')
66-
(Default = TargetFramework = netcoreapp2.0 netstandard2.0 then '1.0.0-*')
60+
TargetFSharpCorePackageIdentity = Name of package to reference (Default = Microsoft.FSharp.Core.netcore)
61+
TargetFSharpCorePackageVersion = Version of package to reference (Default = TargetFramework = netcoreapp1.0-1.1 netstandard1.0-1.6 then '1.0.0-*')
62+
(Default = TargetFramework = netcoreapp2.0 netstandard2.0 then '1.0.0-*')
6763
-->
68-
<PropertyGroupCondition=" '$(FSharpCorePackageIdentity)' == ''">
69-
<FSharpCorePackageIdentity>Microsoft.FSharp.Core.netcore</FSharpCorePackageIdentity>
64+
<PropertyGroupCondition=" '$(TargetFSharpCorePackageVersion)' == ''">
65+
<TargetFSharpCorePackageVersionCondition=" $(TargetFramework.StartsWith(netcoreapp1.)) or $(TargetFramework.StartsWith(netstandard1.))">1.0.0-*</TargetFSharpCorePackageVersion>
66+
<TargetFSharpCorePackageVersionCondition=" $(TargetFramework.StartsWith(netcoreapp2.)) or $(TargetFramework.StartsWith(netstandard2.))">1.0.0-*</TargetFSharpCorePackageVersion>
7067
</PropertyGroup>
7168

72-
<PropertyGroupCondition=" '$(FSharpCorePackageVersion)' == ''">
73-
<FSharpCorePackageVersion Condition ="$(TargetFramework.StartsWith(netcoreapp1.)) or $(TargetFramework.StartsWith(netstandard1.))">1.0.0-*</FSharpCorePackageVersion>
74-
<FSharpCorePackageVersion Condition ="$(TargetFramework.StartsWith(netcoreapp2.)) or $(TargetFramework.StartsWith(netstandard2.))">1.0.0-*</FSharpCorePackageVersion>
69+
<PropertyGroupCondition=" '$(TargetFSharpCorePackageIdentity)' == ''">
70+
<TargetFSharpCorePackageIdentityCondition=" '$(TargetFrameworkIdentifier)' != '.NETFramework'" >Microsoft.FSharp.Core.netcore</TargetFSharpCorePackageIdentity>
7571
</PropertyGroup>
7672

77-
<ItemGroup Condition =" '$(DisableAutoFSharpCoreReference)' != 'true'">
78-
<PackageReferenceInclude="$(FSharpCorePackageIdentity)"Version="$(FSharpCorePackageVersion)" />
79-
</ItemGroup>
73+
<PropertyGroupCondition=" '$(TargetFSharpCoreVersion)' == ''">
74+
<!-- If TargetFSharpCoreversion and we are building for the desktop set version to the desktop version.-->
75+
<TargetFSharpCoreVersionCondition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">4.4.1.0</TargetFSharpCoreVersion>
76+
</PropertyGroup>
77+
78+
<PropertyGroupCondition=" '$(DisableAutoValueTupleReference)' != 'true'">
79+
<FrameworkNeedsValueTupleReferenceCondition=" $(TargetFramework.StartsWith(netcoreapp1.)) or $(TargetFramework.StartsWith(netstandard1.))">true</FrameworkNeedsValueTupleReference>
80+
<FrameworkNeedsValueTupleReferenceCondition=" '$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net45' or '$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'net61' or '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net47'">true</FrameworkNeedsValueTupleReference>
81+
</PropertyGroup>
8082

81-
<ItemGroup Condition =" '$(DisableValueTupleReference)' != 'true'">
82-
<PackageReferenceInclude="System.ValueTuple"Version="4.3.0" />
83+
<ItemGroupCondition=" '$(TargetFramework)' != ''">
84+
<PackageReferenceInclude="System.ValueTuple"Version="4.*"Condition=" '$(DisableAutoValueTupleReference)' != 'true' and '$(FrameworkNeedsValueTupleReference)' == 'true'"/>
85+
<PackageReferenceInclude="$(TargetFSharpCorePackageIdentity)"Version="$(TargetFSharpCorePackageVersion)"Condition=" '$(DisableAutoFSharpCoreReference)' != 'true'"/>
8386
</ItemGroup>
8487

8588
<!-- If we haven't already referenced FSharp.Core do it using the specified TargetFSharpCoreVersion.-->
86-
<TargetName="AddDefaultReferences"BeforeTargets="Compile"AfterTargets="ResolveReferences">
87-
<PropertyGroup>
88-
<IsFSharpCoreReferencedCondition=" '%(ReferencePath.Filename)' == 'FSharp.Core'">true</IsFSharpCoreReferenced>
89-
</PropertyGroup>
90-
91-
<!--- Add it for Desktop Apps-->
92-
<ItemGroupCondition=" '$(IsFSharpCoreReferenced)' != 'true' and '$(TargetName)' != 'FSharp.Core' and '$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(TargetFSharpCoreVersion)' != ''">
93-
<ReferencePathInclude="$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll" />
94-
</ItemGroup>
95-
</Target>
89+
<TargetCondition=" '$(DisableAutoFSharpCoreReference)' != 'true' and '$(TargetFramework)' != '' and '$(TargetName)' != 'FSharp.Core' and '$(TargetFrameworkIdentifier)' == '.NETFramework'"
90+
Name="AddDefaultReferences"
91+
BeforeTargets="Compile"
92+
AfterTargets="ResolveReferences">
9693

97-
<!-- If we haven't already referenced System.ValueTuple just do it.-->
98-
<TargetName="AddValueTupleReferences"BeforeTargets="ResolveReferences">
9994
<PropertyGroup>
100-
<IsValueTupleReferencedCondition=" '%(PackageReference.Identity)' == 'System.ValueTuple'">true</IsValueTupleReferenced>
95+
<IsFSharpCoreReferencedCondition=" '%(ReferencePath.Filename)' == 'FSharp.Core'">true</IsFSharpCoreReferenced>
10196
</PropertyGroup>
10297

10398
<!--- Add it for Desktop Apps-->
104-
<ItemGroupCondition=" '$(IsValueTupleReferenced)' != 'true'">
105-
<PackageReferenceInclude="System.ValueTuple"Version="4.3.0" />
99+
<ItemGroupCondition=" '$(TargetFrameworkIdentifier)'== '.NETFramework' and '$(IsFSharpCoreReferenced)'!= 'true'and '$(TargetFSharpCoreVersion)' != ''">
100+
<ReferencePathInclude="$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll" />
106101
</ItemGroup>
102+
107103
</Target>
108104

109105
</Project>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp