Building F # .fsproj on Mac (Mono)

I have .fsproj (and .sln) from an F # project that was developed on Windows that I want to build on a Mac.

I created several programs with one F # file with Mono, and that’s great. Unfortunately, this .fsproj is not trivial, as there are several source files and many links.

Creating a command line to create a project manually does not seem funny.

Is there a tool that will parse .sln / .fsproj and give the correct command line? Or maybe just build from .sln / .fsproj?

I would like to do this without MonoDevelop or SharpDevelop, if possible, although answers to these lines are welcome.

+6
source share
2 answers

Here is a simple make file that I use

FSC=/home/john/FSharp-2.0.0.0/bin/fsc.exe FSFILES= tokenizer.fs BuildTree.fs symtable.fs mkVMCommands.fs codegen.fs compiler: compiler.exe compiler.exe: $(FSFILES) $(FSC) --define:LINUX --debug:full --debug+ $(FSFILES) -o:compiler.exe --sig:sigfile.fs run: compiler mono compiler.exe 

note that the lines after each target are compiler.exe:... should be indented with TAB , not spaces. If you need redo, just add -r "Somefile.dll" to the command line.

+3
source

You can see the xbuilds that directly read the sln and fsproj and build them on the Mono platform.

As mentioned in a comment by @JPW, it also works on Mac OS X. Although support for xbuild F # seems immature, someone has managed to build F # projects with xbuild on Linux . We hope you find it helpful to set up your build environment on Mac.

+2
source

Source: https://habr.com/ru/post/902049/


All Articles