0.a Ensure newest dotnet SDK version
0.b Init repo with appropriate license and gitignore (e.g. Visual Studio)
0.c Clone repo
-
Install Fake template :
dotnet new -i "fake-template::*"
-
In the repo root:
dotnet new fake
(creates basic build script)dotnet new global.json
(locks minimum dotnet SDK version)mkdir src
-
in the
src
directory:dotnet new classlib --framework netstandard2.1 -lang F# -n "myProj"
(adapt arguments accordingly)
-
Back in the project root:
dotnet new sln
(creates .sln file with the same name as the root directory)dotnet sln .\testproj.sln add .\src\myProj\myProj.fsproj --in-root
(adapt names of sln and fsproj files accordingly)- create a RELEASE_NOTES.md in the project root (for versioning of the nuget package) like this
-
(If you want to use paket) In the project root:
dotnet tool install paket
dotnet paket init
dotnet paket add {YourPackage}
(reference the packages you need)
-
Create a
paket.references
file containing the referencces needed for the project insrc/myProj
-
in
src/myProj
, usedotnet paket install
-
For nuget package generation:
- replace contents of build.fsx with the script above (this may lead to future incompatibilities, bit this gist is only thought of as a temporary helper).
- in
src/myProj
create a paket.template file like this
-
you can now build the project and package using
./fake.cmd build
from the project root. -
Further things that will make this not so much 'minimal' anymore:
- use https://github.com/MNie/Expecto.Template for creating a test project
- use https://github.com/SteveGilham/altcover/wiki/QuickStart-Guide to set up altcover test coverage calculation for the test project
- heres an example fake build target for that: https://github.com/CSBiology/BioFSharp/blob/developer/build.fsx#L265
- use http://fsprojects.github.io/FSharp.Formatting/ for docs generation (they added a dotnet tool recently, i have not tested it so far but looks promising)