Skip to content

Commit

Permalink
Make FSharp.Core references explicit (#1213)
Browse files Browse the repository at this point in the history
* Fixes nuget restore. Makes FSharp.Core reference explicit.
* Prevents use of nuget fallback folder
  • Loading branch information
aivascu committed Dec 18, 2020
1 parent 0809811 commit 5264098
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ nCrunchTemp_*

# Temp build artifacts and tools
/build/
.tmp/

# VIM tmp files
*.swp
8 changes: 5 additions & 3 deletions Src/AutoFoq/AutoFoq.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.props" />
<Import Project="..\Common.FSharp.props" />

<PropertyGroup>
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
Expand Down Expand Up @@ -30,13 +31,14 @@
<Compile Include="AutoFoqCustomization.fs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net452'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Foq" Version="[1.8.0,2.0.0)" />
<PackageReference Include="FSharp.Core" Version="4.2.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<PackageReference Include="Foq" Version="[1.5.1,2.0.0)" />
<PackageReference Include="FSharp.Core" Version="3.0.2" PrivateAssets="All" />
<PackageReference Include="Foq" Version="[1.5.1,2.0.0)" />
<PackageReference Include="FSharp.Core" Version="[3.0.2,5.0.0)" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 7 additions & 4 deletions Src/AutoFoqUnitTest/AutoFoqUnitTest.fsproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.props" />
<Import Project="..\Common.FSharp.props" />
<Import Project="..\Common.Test.props" />
<Import Project="..\Common.Test.xUnit.props" />

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>net452;netcoreapp2.1</TargetFrameworks>
<AssemblyTitle>AutoFixture.AutoFoq.UnitTest</AssemblyTitle>
<AssemblyName>AutoFixture.AutoFoq.UnitTest</AssemblyName>
<RootNamespace>AutoFixture.AutoFoq.UnitTest</RootNamespace>
Expand All @@ -22,13 +23,15 @@

<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<PackageReference Include="Unquote" Version="3.1.0" />
<!-- AutoFoq targets FSharp.Core 3.0.2, but we require 3.1.2 as Unquote was compiled against it for .Net Framework. -->
<PackageReference Include="FSharp.Core" Version="3.1.2" PrivateAssets="All" />
<!-- AutoFoq targets FSharp.Core 3.0.2, but we require 3.1.2 as Unquote was compiled against it for .NET Framework. -->
<PackageReference Include="FSharp.Core" Version="[3.1.2]" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net452'">
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Unquote" Version="4.0.0" />
<PackageReference Include="FSharp.Core" Version="[4.2.3]" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AutoFixture\AutoFixture.csproj" />
<ProjectReference Include="..\AutoFoq\AutoFoq.fsproj" />
Expand Down
7 changes: 7 additions & 0 deletions Src/Common.FSharp.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!--Prevents restoring the latest version of FSharp.Core (i.e. FSharp.Core 5.0.0).
Should be safe to remove after dropping net4.5 runtime.-->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions Src/Common.Test.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
<IsPackable>false</IsPackable>
<!-- Disable source link support for test projects as they are not publishable. -->
<SourceLinkCreate>false</SourceLinkCreate>

<!--Prevents failing cross target NuGet package restores-->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.props" />
<Import Project="..\Common.FSharp.props" />
<Import Project="..\Common.Test.props" />
<Import Project="..\Common.Test.xUnit.props" />

Expand All @@ -22,6 +23,7 @@
<ItemGroup>
<PackageReference Include="FsCheck" Version="[1.0.0]" />
<PackageReference Include="Unquote" Version="4.0.0" />
<PackageReference Include="FSharp.Core" Version="[4.2.3]" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.props" />
<Import Project="..\Common.FSharp.props" />
<Import Project="..\Common.Test.props" />
<Import Project="..\Common.Test.xUnit.props" />

<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<TargetFrameworks>net452;netcoreapp2.1</TargetFrameworks>
<AssemblyTitle>Idioms.FsCheck.FsCheck2UnitTest</AssemblyTitle>
<AssemblyName>Idioms.FsCheck.FsCheck2UnitTest</AssemblyName>
<RootNamespace>AutoFixture.Idioms.FsCheckUnitTest</RootNamespace>
Expand All @@ -20,10 +21,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FsCheck" Version="[2.0.1]" />
<PackageReference Include="Unquote" Version="4.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net452'">
<PackageReference Include="FSharp.Core" Version="[4.2.3]" PrivateAssets="All" />
<PackageReference Include="FsCheck" Version="[2.0.1]" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.1'">
<PackageReference Include="FSharp.Core" Version="[4.2.3]" PrivateAssets="All" />
<PackageReference Include="FsCheck" Version="2.9.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AutoFixture\AutoFixture.csproj" />
<ProjectReference Include="..\Idioms\Idioms.csproj" />
Expand Down
13 changes: 8 additions & 5 deletions Src/Idioms.FsCheck/Idioms.FsCheck.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.props" />
<Import Project="..\Common.FSharp.props" />

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
Expand Down Expand Up @@ -28,12 +29,14 @@
<Compile Include="ReturnValueMustNotBeNullAssertion.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FsCheck" Version="[0.9.2,3.0.0)" Condition=" '$(TargetFramework)'=='net452' " />
<PackageReference Include="FSharp.Core" Version="3.1.2" Condition=" '$(TargetFramework)'=='net452' " PrivateAssets="All" />
<ItemGroup Condition=" '$(TargetFramework)'=='net452' ">
<PackageReference Include="FsCheck" Version="[0.9.2,3.0.0)" />
<PackageReference Include="FSharp.Core" Version="[3.1.2,5.0.0)" />
</ItemGroup>

<PackageReference Include="FsCheck" Version="[2.9.0,3.0.0)" Condition=" '$(TargetFramework)'=='netstandard2.0' " />
<PackageReference Include="FSharp.Core" Version="4.1.17" Condition=" '$(TargetFramework)'=='netstandard2.0' " PrivateAssets="All" />
<ItemGroup Condition=" '$(TargetFramework)'=='netstandard2.0' ">
<PackageReference Include="FsCheck" Version="[2.9.0,3.0.0)" />
<PackageReference Include="FSharp.Core" Version="4.1.17" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions Src/Idioms.FsCheckUnitTest/Idioms.FsCheckUnitTest.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.props" />
<Import Project="..\Common.FSharp.props" />
<Import Project="..\Common.Test.props" />
<Import Project="..\Common.Test.xUnit.props" />

Expand All @@ -21,6 +22,7 @@

<ItemGroup>
<PackageReference Include="Unquote" Version="4.0.0" />
<PackageReference Include="FSharp.Core" Version="[4.2.3]" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 5264098

Please sign in to comment.