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

FAKE 5.0 replacement for Fake.ChangeWatcher.WatchChanges bad warning message #1838

Closed
jackfoxy opened this issue Mar 30, 2018 · 8 comments
Closed

Comments

@jackfoxy
Copy link
Contributor

jackfoxy commented Mar 30, 2018

Description

Fake.ChangeWatcher.WatchChanges

warning message is:

This construct is deprecated. Use Fake.IO.FileSystem instead.

but adding nugety Fake.IO.FileSystem dependencie does not help.

Where is the replacement for legacy Fake.ChangeWatcher?

Repro steps

open Fake
open Fake.Core
open Fake.Core.TargetOperators
open Fake.DotNet
open Fake.DotNet.AssemblyInfo
open Fake.DotNet.AssemblyInfoFile
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.Tools
open Fake.Testing.Expecto
open System

Fake.Core.Target.create "KeepRunning" (fun _ ->
    use watcher = !! "docsrc/content/**/*.*"  |> WatchChanges (fun changes ->
         generateHelp' true true
    )

     Trace.traceImportant "Waiting for help edits. Press any key to stop."
    System.Console.ReadKey() |> ignore
    watcher.Dispose()
)

Expected behavior

More informative message.

Actual behavior

This construct is deprecated. Use Fake.IO.FileSystem instead.

Related information

FAKE 5.0.0-beta029

@jackfoxy
Copy link
Contributor Author

Correction to issue. Adding Fake.IO.FileSystem dependency does not fix the issue. Where is the replacement for legacy Fake.ChangeWatcher?

@matthid
Copy link
Member

matthid commented Apr 7, 2018

It actually is here: https:/fsharp/FAKE/blob/master/src/app/Fake.IO.FileSystem/ChangeWatcher.fs

But I just noticed that this wasn't according to the API guidelines and fixed the namespace and the warning messages.

Thanks for reporting

@jackfoxy
Copy link
Contributor Author

jackfoxy commented Apr 7, 2018

Thanks for looking into these, @matthid
I have a bigger problem, yet to report, that after beta 26 or 27 Fake 5.0 causes FSharp.Formatting beta to break. I will open a new issue when I have more information and a test repo.

@jackfoxy
Copy link
Contributor Author

jackfoxy commented Apr 7, 2018

Maybe because I cannot get past beta 25, for now.
nuget Fake.IO.FileSystem 5.0.0-beta025 is loaded and in lock file, but I cannot seem to access it in my script.

@matthid
Copy link
Member

matthid commented Apr 7, 2018

I have a bigger problem, yet to report, that after beta 26 or 27 Fake 5.0 causes FSharp.Formatting beta to break. I will open a new issue when I have more information and a test repo

Yeah please do. However if it is related to FCS it might not be fixable without FSharp.Formatting update.
Because fsf doesn't support .netcore and the new fake runner is based on netcore my suggestion currently is the following:

https:/fsharp/FAKE/blob/master/build.fsx#L356-L423
This will call the fsformatting.exe tool instead of trying to reference it in the fake context.

@matthid
Copy link
Member

matthid commented Apr 7, 2018

Maybe because I cannot get past beta 25, for now.

ChangeWatcher was added in beta022, but you need to open Fake.IO.FileSystem but this is a bug, because according to API-Guidelines open Fake.IO should be enough.

@jackfoxy
Copy link
Contributor Author

jackfoxy commented Apr 7, 2018

new fake runner is based on netcore

Did that change in beta 26 or 27?

@matthid
Copy link
Member

matthid commented Apr 8, 2018

Did that change in beta 26 or 27?

The new runner was there for the begin with, but we will not upgrade you by just upgrading the NuGet package. It is a manual process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants