Closed dsyme closed 2 years ago
A quick update: I managed to remove mono from FsLexYacc, though documentation generation still requires the generation of .NET 4.x binaries.
Came across this project today that might be a way forward with documentation generation: https://twitter.com/dbrattli/status/1119488973133377536?s=19
Integrating with Sphinx might be easier overall than maintaining our own.
Closing old issue :)
Let's use this issue to document how to switch to .NET-Core based tooling in "fsprojects" repos. A good measure of this is if "mono" is no longer required in the repo at all (except maybe for testing)
.NET Core Paket
Typical commands to acquire and run paket:
.NET Core FAKE
Switching to FAKE 5
Many "fsprojects" repos use FAKE 4. See https://fake.build/fake-migrate-to-fake-5.html
At top of
build.fsx
you'll need this:Notes:
build.fsx.lock
whenever you update dependencies//"
on the last line, used by FAKE to detect the Paket section in the scriptTypical opens:
Typical code changes. When in doubt search for the old identifier in FAKE repository source
Things with no alternative:
Other notes:
Paket.pack
will need an explicitToolPath
for .NET Core paket tool local install, e.g.Typical
build.cmd
andbuild.sh
Each repo normally has a
build.cmd
andbuild.fsx
that first acquire FAKE and Paket:build.cmd:
build.sh:
Generating .NET Framework binaries without having Mono installed
Use this
netfx.props
- updated so it doesn't need Mono: https://github.com/fsprojects/FsLexYacc/blob/2f9f06a1fe327e2c334abc6b76b60cce697b78d2/netfx.propsIf your project contains .EXE tools
Projects such as
FsLexYacc
include binary tools in their output nuget packages, and a targets file to use theseAdd a "publish" step, e.g.
dotnet public -c Release -f netcoreapp2.0 src\FsLex\fslex.fsproj
Include the binaries in the nuget package, e.g.
../src/FsLex/bin/Release/net46/publish ==> build/fslex/net46 ../src/FsLex/bin/Release/netcoreapp2.0/publish ==> build/fslex/netcoreapp2.0 ../src/FsYacc/bin/Release/net46/publish ==> build/fsyacc/net46 ../src/FsYacc/bin/Release/netcoreapp2.0/publish ==> build/fsyacc/netcoreapp2.0
Adjust the targets to start the right binary using the right runner, e.g.
Documentation generation
Problems
At time of writing FSharp.Formatting is not yet able to produce docs for
netstandard2.0
DLLs. Therefore the only option for producing docs is to makenet46
or similar DLLs as part of your build.At time of writing, both the
fsformatting.exe
tool (normally driven by FAKE FSFormatting module) and the FSharp.Formatting libraries (normally driven by agenerate.fsx
script) are .NET Framework only. This means documentation generation must run on NET Framework.Recommendations:
switch to
docsrc
anddocs
for github pages, e.g. see the revised ProjectScaffoldGet rid of
generate.fsx
and move to structure similar to ProjectScaffold doc generationIf still using
generate.fsx
then make suregenerate.fsx
is not a FAKE script and only generate docs using Windows. If necessary manually generate docs usingfsi docsrc\generate.fsx
rather than doing it from FAKE 5Testing
TBD
Building
net4x
librariesTBD
Examples: