dolly22 / FAKE.Dotnet

.NET Command Line Interface and .NET Core SDK FAKE helpers
Other
14 stars 2 forks source link

FAKE.Dotnet

NuGet Status MyGet Status

"FAKE.Dotnet" is FAKE build automation system extension for .NET Core CLI tools. It contains helpers to download and install specific versions .NET Core SDK with CLI. Currently supports only windows.

See the API documentation for all available helpers and Release Notes for version details

.NET Core CLI (SDK) helper usage

.NET Core SDK is downloaded and installed using dotnet-install.ps1 powershell script. By default SDK is installed to %LOCALAPPDATA%\Microsoft\dotnet folder (and version subfolders).

example

There is sample project and build script for 1.0.1 SDK tooling

#r "tools/FAKE.Dotnet/tools/Fake.Dotnet.dll" // include Fake.Dotnet lib
open Fake.Dotnet

Target "Initialize" (fun _ ->
    DotnetSdkInstall SdkVersions.NetCore101
)

Target "BuildProjects" (fun _ ->
    let solutionFile = "solution.sln"

    DotnetRestore id solutionFile

    DotnetPack (fun c -> 
        { c with 
            Configuration = Debug;
            VersionSuffix = Some "ci-100";
            OutputPath = Some (currentDirectory @@ "artifacts")
        }) solutionFile
)

"Initialize"            // define the dependencies
      ==> "BuildProjects"

Run "BuildProjects"

Build the project