Closed changlan closed 9 years ago
You compile usibg fsc (or fsharpc) directly from FAKE? Or are you only using .fsx files?
Yes, I compile the code using fsc from FAKE, because in OS X command line it's easier to set up than xbuild. Below is my build.fsx:
#r @"packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.FscHelper
let buildDir = "./build/"
Target "clean" (fun _ ->
CleanDirs [ buildDir ]
)
Target "all" (fun _ ->
["src/parser.fs"]
|> Fsc (fun p ->
{ p with Output = buildDir + "Main.exe"
References =
[ "packages/FParsec/lib/net40-client/FParsec.dll"
"packages/FParsec/lib/net40-client/FParsecCS.dll" ]
OtherParams =
[ "--standalone"] })
)
"clean"
==> "all"
RunTargetOrDefault "all"
I like the simplicity of this. However, it does not leave us any way to find the referenced assemblies, other than reflecting over compiled output, which is certainly not right. It may not even compile! :)
Do you have any ideas on how to discover these references? This kills all tools (VS, XS, Emacs etc), so it is not really a Sublime issue. It's really more of an FSharp ecosystem issue. :)
Maybe you could use FAKE to generate the .fsproj from input similar to what you are feeding Fsc above? Then you'd compile the .fsproj instead, and tooling should work.
For reference there is a thread on the mailing list about this: https://groups.google.com/forum/#!topic/fsharp-opensource/zTeIo5ZnGyk
A summary would be that currently you need an .fsproj as @rojepp says. This is because that is how the compiler options are extracted to feed to the compiler services. The two main options here are, I think:
I think we can close this?
OK, it's working when I have a fsproj file. Thanks for the advice!
Hi!
I manage the project packages using paket and FAKE (without fsproj files). It turns out that code intelligence does not recognize the library names and identifiers. Is code intelligence for external libraries supposed to be supported? For example, I used FParsec in my project, and the DLLs and XMLs are under ./packages/FParsec/lib/.
Thanks!