anchor.diff:    =?> ("SourceLink", Pdbstr.tryFind().IsSome )
   #endif
     ==> "NuGet"
  -  =?> ("AddNetcoreToNupkg", isDotnetCLIInstalled)
  +  =?> ("Nuget.AddNetCore", isDotnetSDKInstalled)
     ==> "BuildPackage"
   
   "CleanDocs"
  
positive.code: 
  
  // --------------------------------------------------------------------------------------
  // .NET CLI and .NET Core
  
  let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x
  let netcoreFW = "netstandard1.5"
  
  Target "DotnetCliBuild" (fun _ ->
      Shell.Exec("dotnet", "restore") |> assertExitCodeZero
      Shell.Exec("dotnet", sprintf "--verbose build --framework %s --configuration Release" netcoreFW, "src/Chessie") |> assertExitCodeZero
  )
  
  Target "DotnetCliRunTests" (fun _ ->
      // Run tests (Chessie.Tests)
      Shell.Exec("dotnet", sprintf "--verbose run --framework %s --configuration Release" netcoreFW, "tests/Chessie.Tests") |> assertExitCodeZero
  
      // Run tests (Chessie.CSharp.Test) 
      Shell.Exec("dotnet", sprintf "--verbose run --framework %s --configuration Release" netcoreFW, "tests/Chessie.CSharp.Test") |> assertExitCodeZero
  )
  
  let isDotnetCLIInstalled = Shell.Exec("dotnet", "--version") = 0
  
  Target "AddNetcoreToNupkg" (fun _ ->
      let nupkg = sprintf "../../temp/Chessie.%s.nupkg" (release.AssemblyVersion)
  
      Shell.Exec("dotnet", "--verbose pack --configuration Release", "src/Chessie") |> assertExitCodeZero
  
      let netcoreNupkg = sprintf "bin/Release/Chessie.%s.nupkg" (release.AssemblyVersion)
  
      Shell.Exec("dotnet", sprintf """mergenupkg --source "%s" --other "%s" --framework "%s" """ nupkg netcoreNupkg netcoreFW, "src/Chessie/") |> assertExitCodeZero
  )
  
  // --------------------------------------------------------------------------------------
  
negative.code: "Clean"
    ==> "AssemblyInfo"
    ==> "Build"
    =?> ("Build.NetCore", isDotnetSDKInstalled)
    ==> "RunTests"
    =?> ("RunTests.NetCore", isDotnetSDKInstalled)
    =?> ("GenerateReferenceDocs",isLocalBuild)
    =?> ("GenerateDocs",isLocalBuild)
    ==> "All"
  