Skip to content
Template for F# project with .NET Core 3.0
F# Shell Batchfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.config
.github/workflows
.paket
src/SampleApp
tests/SampleTest
.gitattributes
.gitignore
.travis.yml
LICENSE
README.md
appveyor.yml
build.cmd
build.fsx
build.sh
paket.dependencies
paket.lock

README.md

FsTemplate

Template for F# project, distributed under MIT License

Use

  1. Clone and change remote repogitory

    $ git clone git@github.com:wraikny/FsTemplate.git
    $ git remote rm origin
    $ git remote add origin <your repogitory>
  2. Change CI Badge in README.md

    • Replace wraikny/FsTemplate to <OWNER>/<REPOSITORY>
    • Set your own AppVeyor badge ID
    • If you don't use a CI service, comment out it from the bellow table.
  3. Create project: Create Project

CI Status

Github Actions
Travis CI
AppVeyor

Requirements

.NET Core 3.0
https://dotnet.microsoft.com/download

$ dotnet --version
3.0.100

Restoring after Clone

$ dotnet tool restore
$ dotnet paket restore

Build

$ dotnet fake build

Run

$ dotnet run --project src/SampleApp [-c {Debug|Release}]

Tests

$ dotnet fake build -t Test

OR

$ dotnet run --project tests/SampleTest

Paket

Each project needs: paket.references file.

After updating paket.dependencies:

$ dotnet paket install

FAKE

Scripting at build.fsx.

$ dotnet fake build -t Clean # Run "Clean" Target
$ dotnet fake build # Run Default Taret

Create Project

$ dotnet new console -lang=f# -o src/SampleApp # Application
$ echo 'FSharp.Core' > src/SampleApp/paket.references

$ dotnet new classlib -lang=f# -o src/SampleLib # Library
$ echo 'FSharp.Core' > src/SampleLib/paket.references

$ paket install # Add reference of Paket to .fsproj file

Create Test Project

$ dotnet new console -lang=f# -o tests/SampleTest
$ echo -e 'FSharp.Core\nExpecto\nExpecto.FsCheck' > tests/SampleTest/paket.references

$ paket install # Add reference of Paket to .fsproj file

and then, Add Project Name to build.fsx.

Solution

$ dotnet new sln # Create Solution File
$ dotnet sln add src/SampleApp
$ dotnet sln add src/SampleLib

Tool Update

$ dotnet tool update fake-cli
$ dotnet tool update paket

and then, commit .config/dotnet-tools.json.

Link

You can’t perform that action at this time.