Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do only disable automagic when FSharp.Core is actually used #3725

Merged
merged 2 commits into from
Nov 15, 2019
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
17 changes: 16 additions & 1 deletion src/Paket.Core/Installation/RestoreProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ let createAlternativeNuGetConfig (projectFile:FileInfo, objDirectory:DirectoryIn

saveToFile config alternativeConfigFileInfo |> ignore

let FSharpCore = PackageName "FSharp.Core"

let createPaketPropsFile (lockFile:LockFile) (cliTools:ResolvedPackage seq) (packages:((GroupName * PackageName) * PackageInstallSettings * _)seq) (fileInfo:FileInfo) =
let cliParts =
if Seq.isEmpty cliTools then
Expand Down Expand Up @@ -324,18 +326,31 @@ let createPaketPropsFile (lockFile:LockFile) (cliTools:ResolvedPackage seq) (pac
yield " </ItemGroup>"])
|> fun xs -> String.Join(Environment.NewLine,xs)

let disableImplicitFSharpCore =
if packages |> Seq.exists (fun ((_,name),_,_) -> name = FSharpCore) then
"""
<!-- Disable automagic references for F# dotnet sdk -->
<!-- This will not do anything for other project types -->
<!-- see https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1002-fsharp-in-dotnet-sdk.md -->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
"""
else
""

// When updating the PaketPropsVersion be sure to update the Paket.Restore.targets which checks this value
let content =
sprintf """<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<PaketPropsVersion>5.185.3</PaketPropsVersion>
<PaketPropsLoaded>true</PaketPropsLoaded>
<PaketPropsLoaded>true</PaketPropsLoaded>%s
forki marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
%s
%s
</Project>"""
disableImplicitFSharpCore
cliParts
packagesParts

Expand Down
6 changes: 0 additions & 6 deletions src/Paket.Core/embedded/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT' ">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>

<!-- Disable automagic references for F# dotnet sdk -->
<!-- This will not do anything for other project types -->
<!-- see https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1002-fsharp-in-dotnet-sdk.md -->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>

<!-- Disable Paket restore under NCrunch build -->
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>

Expand Down