Skip to content

Commit 76a6ab9

Browse files
committed
Allow using FSharp.Core package in new service solution projects
1 parent e06e079 commit 76a6ab9

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
<Import Project="FSharpBuild.Directory.Build.props" Condition = " '$(FSharpTestCompilerVersion)' == '' "/>
44
<Import Project="FSharpTests.Directory.Build.props" Condition = " '$(FSharpTestCompilerVersion)' != '' "/>
55

6+
<!--
7+
When developers load the FSharp.Compiler.Service solution we set FSHARPCORE_USE_PACKAGE to true if it hasn't already been set to a value.
8+
This option ensures that building and testing uses the specified FSharp.Core nuget package instead of the local
9+
FSharp.Core project.
10+
-->
11+
<PropertyGroup Condition="'$(FSHARPCORE_USE_PACKAGE)' == ''">
12+
<FSHARPCORE_USE_PACKAGE Condition="'$(SolutionName)' == 'FSharp.Compiler.Service'">true</FSHARPCORE_USE_PACKAGE>
13+
</PropertyGroup>
14+
615
<ItemGroup>
716
<!-- If there is a README.md next to a project file, include it (for easier access in the IDE) -->
817
<None Include="README.md" Condition="Exists('README.md')" />

tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,23 @@
4040
<!-- Reference a project -->
4141
<ItemGroup Condition="'$(FcsReferenceType)' == 'project'">
4242
<ProjectReference Include="$(FcsProjectPath)" />
43-
<ProjectReference Include="..\..\..\..\src\FSharp.Core\FSharp.Core.fsproj" />
4443
</ItemGroup>
4544
<!-- Reference the FCS NuGet package with the specified $FcsVersion, use locally built FSharp.Core
4645
Arguably this could be changed to depend on the version of FSharp.Core that's pulled in via FSharp.Compiler.Service.
4746
Keeping the old behaviour for now
4847
-->
4948
<ItemGroup Condition=" '$(FcsReferenceType)' == 'nuget' ">
5049
<PackageReference Include="FSharp.Compiler.Service" Version="$(FcsNuGetVersion)" />
50+
</ItemGroup>
51+
52+
<ItemGroup Condition="'$(FSHARPCORE_USE_PACKAGE)' != 'true'">
5153
<ProjectReference Include="..\..\..\..\src\FSharp.Core\FSharp.Core.fsproj" />
5254
</ItemGroup>
55+
56+
<ItemGroup Condition="'$(FSHARPCORE_USE_PACKAGE)' == 'true'">
57+
<PackageReference Include="FSharp.Core" Version="$(FSharpCoreShippedPackageVersionValue)" />
58+
</ItemGroup>
59+
5360
<!-- Reference the dlls specified in $FcsDllPath and $FSharpCoreDllPath -->
5461
<ItemGroup Condition=" '$(FcsReferenceType)' == 'dll' ">
5562
<Reference Include="FSharp.Compiler.Service">

tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,15 @@
2727

2828
<ItemGroup>
2929
<ProjectReference Include="..\..\..\..\src\Compiler\FSharp.Compiler.Service.fsproj" />
30-
<ProjectReference Include="..\..\..\..\src\FSharp.Core\FSharp.Core.fsproj" />
3130
<ProjectReference Include="..\BenchmarkComparison\HistoricalBenchmark.fsproj" />
3231
</ItemGroup>
3332

33+
<ItemGroup Condition="'$(FSHARPCORE_USE_PACKAGE)' != 'true'">
34+
<ProjectReference Include="..\..\..\..\src\FSharp.Core\FSharp.Core.fsproj" />
35+
</ItemGroup>
36+
37+
<ItemGroup Condition="'$(FSHARPCORE_USE_PACKAGE)' == 'true'">
38+
<PackageReference Include="FSharp.Core" Version="$(FSharpCoreShippedPackageVersionValue)" />
39+
</ItemGroup>
40+
3441
</Project>

0 commit comments

Comments
 (0)