-
Notifications
You must be signed in to change notification settings - Fork 0
Working with the code
Dmitry Polyanitsa edited this page Aug 1, 2017
·
1 revision
All commands below assume cwd in src
at the start. .NET Core must be installed first (see links below for the installer).
Restore packages each time dependencies inside .fsproj
change.
dotnet restore
You can build from src
or any of the project folders, dependencies are resolved properly in both cases.
dotnet build
You can also restore project folders, too.
To run the app use dotnet
, not dotnet run
, which is slow:
# with a helper script
Icfpc2017.App/run
Icfpc2017.App/run release
# or without
dotnet Icfpc2017.App/bin/Debug/netcoreapp1.1/Icfpc2017.App.dll
dotnet Icfpc2017.App/bin/Release/netcoreapp1.1/Icfpc2017.App.dll
To run the tests:
dotnet test Icfpc2017.Tests
# or
cd Icfpc2017.Tests
dotnet test
dotnet
commands are pretty discoverable, you can add --help
at any level:
dotnet --help
dotnet new --help
dotnet new console --help
Sometimes, however, commands complain at --help
and print help when not supplied any arguments, so in case --help
fails, try without it. E.g.
dotnet exec
Things to remember/common gotchas:
- Files must be manually added to
.fsproj
fiels and ordered by hand, dependencies first. - p.1 and language design in other places make type dependency cycles impossible to compile, so plan/design accordingly.
- Default F#
Array
andList
are not the same as in C#, you need to fully qualify the latter.
Useful links:
- .NET Core installer: https://www.microsoft.com/net/core
- F# Guide: https://docs.microsoft.com/en-us/dotnet/fsharp/
- .NET Core Guide: https://docs.microsoft.com/en-us/dotnet/core/
- .NET API: https://docs.microsoft.com/en-us/dotnet/api/?view=netcore-1.1
- Nugets: https://preview.nuget.org/