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

Rename intellisense script #1594

Merged
merged 4 commits into from
Jun 16, 2017
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
File renamed without changes.
6 changes: 3 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if DOTNETCORE
// We need to use this for now as "regular" Fake breaks when its caching logic cannot find "loadDependencies.fsx".
// This is the reason why we need to checkin the "loadDependencies.fsx" file for now...
#load ".fake/build.fsx/loadDependencies.fsx"
// We need to use this for now as "regular" Fake breaks when its caching logic cannot find "intellisense.fsx".
// This is the reason why we need to checkin the "intellisense.fsx" file for now...
#load ".fake/build.fsx/intellisense.fsx"

open System
open System.IO
Expand Down
4 changes: 2 additions & 2 deletions help/markdown/fake-fake5-custom-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ One example would be:
[lang=fsharp]
(* -- Fake Dependencies paket-inline
source https://nuget.org/api/v2

nuget Fake.Core.Targets prerelease
nuget MyTaskNuGetPackage
-- Fake Dependencies -- *)
#load "./.fake/build.fsx/loadDependencies.fsx"
#load "./.fake/build.fsx/intellisense.fsx"

open Fake.Core
open MyCustomTask
Expand Down
11 changes: 6 additions & 5 deletions help/markdown/fake-fake5-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For example create a new file `build.fsx` with

```fsharp
// Use this for IDE support. Not required by FAKE 5. Change "build.fsx" to the name of your script.
#load ".fake/build.fsx/loadDependencies.fsx"
#load ".fake/build.fsx/intellisense.fsx"

open Fake.Core.Targets

Expand Down Expand Up @@ -55,12 +55,13 @@ To tell Fake which dependencies are needed a script can start with a header as w
(* -- Fake Dependencies ***header***
*** Dependencies ***
-- Fake Dependencies -- *)
#load "./.fake/build.fsx/loadDependencies.fsx"
#load "./.fake/build.fsx/intellisense.fsx"
```

The last line `#load` is not requiredby FAKE 5, however
this way the file can still be edited in editors (after restoring packages initially).
Fake will write a `loadDependencies.fsx` file for you importing all required references.
Fake will write an `intellisense.fsx` file for you importing all required references.
Please note that as of right now, Fake doesn't write anything useful into this file, yet.

There are two headers known by Fake:

Expand All @@ -73,7 +74,7 @@ To reference a FAKE group explicitely you can put the following at the top of yo
file ./paket.dependencies
group netcorebuild
-- Fake Dependencies -- *)
#load "./.fake/build.fsx/loadDependencies.fsx"
#load "./.fake/build.fsx/intellisense.fsx"

This header will reference a `paket.dependencies` file and a group within.

Expand All @@ -87,7 +88,7 @@ To write your build dependencies in-line you can put the following at the top of

nuget Fake.Core.Targets prerelease
-- Fake Dependencies -- *)
#load "./.fake/build.fsx/loadDependencies.fsx"
#load "./.fake/build.fsx/intellisense.fsx"

This has the advantage that your build-script is now "standalone" and no separate `paket.dependencies` is required.
We still recommend to add (`git add -f`, because usually you have `.fake` folder gitignored) the generated `paket.lock` (in `.fake/<scriptName>/`) to your repository to have reproducable script runs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source ../../../nuget/dotnetcore

nuget Fake.Core.Context prerelease
-- Fake Dependencies -- *)
#load ".fake/context-exists.fsx/loadDependencies.fsx"
#load ".fake/context-exists.fsx/intellisense.fsx"

printfn "loading context"
let context = Fake.Core.Context.forceFakeContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nuget FSharp.Core prerelease

printfn "before load"

#load ".fake/reference_fake-targets.fsx/loadDependencies.fsx"
#load ".fake/reference_fake-targets.fsx/intellisense.fsx"

printfn "test_before open"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ source ../../../nuget/dotnetcore
nuget Fake.Runtime prerelease
nuget FSharp.Core prerelease
-- Fake Dependencies -- *)
#load ".fake/reference_fake-runtime.fsx/loadDependencies.fsx"
#load ".fake/reference_fake-runtime.fsx/intellisense.fsx"

open Fake.Runtime

printfn "Starting Build."
Trace.traceFAKE "Some Info from FAKE"
printfn "Ending Build."
printfn "Ending Build."
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
file paket.dependencies
group Main
-- Fake Dependencies -- *)
#load ".fake/use_external_dependencies.fsx/loadDependencies.fsx"
#load ".fake/use_external_dependencies.fsx/intellisense.fsx"

open Fake.Runtime

printfn "Starting Build."
Trace.traceFAKE "Some Info from FAKE"
printfn "Ending Build."
printfn "Ending Build."
11 changes: 7 additions & 4 deletions src/app/Fake.Runtime/FakeRuntime.fs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,13 @@ let paketCachingProvider printDetails cacheDir (paketDependencies:Paket.Dependen
let lockGroup = lockFile.GetGroup groupName

// Write loadDependencies file (basically only for editor support)
let loadFile = Path.Combine (cacheDir, "loadDependencies.fsx")
if printDetails then Trace.log <| sprintf "Writing '%s'" loadFile
let intellisenseFile = Path.Combine (cacheDir, "intellisense.fsx")
if printDetails then Trace.log <| sprintf "Writing '%s'" intellisenseFile
// TODO: Make sure to create #if !FAKE block, because we don't actually need it.
File.WriteAllText (loadFile, """printfn "loading dependencies... " """)
let intellisenseContents =
[| "// This file is needed for IDE support"
"printfn \"loading dependencies ...\"" |]
File.WriteAllLines (intellisenseFile, intellisenseContents)

let rid =
#if DOTNETCORE
Expand Down Expand Up @@ -299,4 +302,4 @@ let prepareAndRunScriptRedirect printDetails fsiOptions scriptPath envVars onErr
let prepareAndRunScript printDetails fsiOptions scriptPath envVars useCache =
prepareAndRunScriptRedirect printDetails fsiOptions scriptPath envVars (printf "%s") (printf "%s") useCache

//#endif
//#endif