FAKE Getting Started

Install FAKE globally dotnet tool install fake-cli -g

In your program directory add build.fsx:

#r "paket:
nuget Fake.Core.Target //"
// include Fake modules, see Fake modules section

open Fake.Core

// *** Define Targets ***
Target.create "Clean" (fun _ ->
  Trace.log " --- Cleaning stuff --- "
)

Target.create "Build" (fun _ ->
  Trace.log " --- Building the app --- "
)

Target.create "Deploy" (fun _ ->
  Trace.log " --- Deploying app --- "
)

open Fake.Core.TargetOperators

// *** Define Dependencies ***
"Clean"
  ==> "Build"
  ==> "Deploy"

// *** Start Build ***
Target.runOrDefault "Deploy"

Run sudo fake run build.fsx. You can also just run sudo fake build. When you download a new module, delete the build.fsx.lock file.

Notes:

Fake.IO.FileSystem //

open Fake.IO

Shell.cleanDir

Fake.DotNet.MSBuild // builds csproj-files under /src/app

Target.create "BuildApp" (fun _ ->
    !! "src/app/**/*.csproj"
    |> MSBuild.runRelease id buildDir "Build"
    |> Trace.logItems "AppBuild-Output: "
)

// !! is a pattern to scan for

Starting a new Project with a Template

Here is a Fake Template!

Run:

mkdir proj_dir
cd proj_dir

sudo dotnet new fake
./fake.sh build

This doesn't have any of the files like "src/**/bin" or "src/**/*.*proj". Why isn't it like Rust?

This may be helpful.