anchor.diff:  let solutionsToBuild = !! "Src/All.sln"
   let bakFileExt = ".orig"
   
  -type BuildVersionInfo = { assemblyVersion:string; fileVersion:string; infoVersion:string; nugetVersion:string }
  -let calculateVersionFromGit buildNumber =
  +type BuildVersionCalculationSource = { major: int; minor: int; revision: int; preSuffix: string; 
  +                                       commitsNum: int; sha: string; buildNumber: int }
  +let getVersionSourceFromGit buildNumber =
       // Example of output for a release tag: v3.50.2-288-g64fd5c5b, for a prerelease tag: v3.50.2-alpha1-288-g64fd5c5b
       let desc = Git.CommandHelper.runSimpleGitCommand "" "describe --tags --long --match=v*"
   
  
positive.code:                       | 0 -> nugetVersion
                        | _ -> sprintf "%s-%s" nugetVersion sha
  
      { assemblyVersion=assemblyVersion; fileVersion=fileVersion; infoVersion=infoVersion; nugetVersion=nugetVersion }
  
  // Calculate version that should be used for the build. Define globally as data might be required by multiple targets.
  // Please never name the build parameter with version as "Version" - it might be consumed by the MSBuild, override 
  // the defined properties and break some tasks (e.g. NuGet restore).
  let buildVersion = match getBuildParamOrDefault "BuildVersion" "git" with
                     | "git"       -> calculateVersionFromGit (getBuildParamOrDefault "BuildNumber" "0" |> int)
                     | assemblyVer -> { assemblyVersion = assemblyVer
                                        fileVersion = getBuildParamOrDefault "BuildFileVersion" assemblyVer
                                        infoVersion = getBuildParamOrDefault "BuildInfoVersion" assemblyVer
                                        nugetVersion = getBuildParamOrDefault "BuildNugetVersion" assemblyVer }
  
  let addBakExt path = sprintf "%s%s" path bakFileExt
  
  
negative.code:                              @"^v(?<maj>\d+)\.(?<min>\d+)\.(?<rev>\d+)(?<pre>-\w+\d*)?-(?<num>\d+)-g(?<sha>[a-z0-9]+)$",
                               RegexOptions.IgnoreCase)
                        .Groups
  
      let getMatch (name:string) = result.[name].Value
  
      { major = getMatch "maj" |> int
        minor = getMatch "min" |> int
        revision = getMatch "rev" |> int
        preSuffix = getMatch "pre"
        commitsNum = getMatch "num" |> int
        sha = getMatch "sha"
        buildNumber = buildNumber
      }
  
  type BuildVersionInfo = { assemblyVersion:string; fileVersion:string; infoVersion:string; nugetVersion:string; 
                            source: Option<BuildVersionCalculationSource> }
  let calculateVersion source =
      let s = source
      let (major, minor, revision, preReleaseSuffix, commitsNum, sha, buildNumber) =
          (s.major, s.minor, s.revision, s.preSuffix, s.commitsNum, s.sha, s.buildNumber)
  
      let assemblyVersion = sprintf "%d.%d.0.0" major minor
      let fileVersion = sprintf "%d.%d.%d.%d" major minor revision buildNumber
      
      // If number of commits since last tag is greater than zero, we append another identifier with number of commits.
      // The produced version is larger than the last tag version.
      // If we are on a tag, we use version without modification.
      // Examples of output: 3.50.2.1, 3.50.2.215, 3.50.1-rc1.3, 3.50.1-rc3.35
      let nugetVersion = match commitsNum with
                         | 0 -> sprintf "%d.%d.%d%s" major minor revision preReleaseSuffix
  