Generate semantic version number from Git with GitVersion

INFO

This documentation is for FAKE version 5.0 or later. The old documentation can be found here

GitVersion is a tool that generates a Semantic Version number based on your Git history.

API-Reference

Minimal working example

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
#r "paket:
nuget Fake.Core.Target
nuget Fake.DotNet.Cli
nuget Fake.Tools.GitVersion
//"

open Fake.Core
open Fake.DotNet
open Fake.Tools

let install = lazy DotNet.install DotNet.Versions.FromGlobalJson

Target.create "Version" (fun _ ->
    GitVersion.generateProperties gitVersionGenerateProperties (fun p ->
        { p with ToolType = ToolType.CreateCLIToolReference(install.Value) })
)
val install : Lazy<obj>
property System.Lazy.Value: obj with get