<commit_before>#r "packages/FAKE/tools/FakeLib.dll"

open Fake

let solutionFile = !!"*.sln" |> Seq.head

let version = 
  if isLocalBuild then "0.0.0.0"
  else appVeyorBuildVersion

Target "KillProcesses" <| fun () -> 
  ProcessHelper.killProcess "nunit-agent"
  ProcessHelper.killMSBuild()

Target "Build" <| fun () -> 
  !!"src/**/bin/Release/" |> CleanDirs
  build (fun x -> 
    { x with Verbosity = Some MSBuildVerbosity.Quiet
             Properties = [ "Configuration", "Release" ] }) solutionFile

Target "Test" <| fun () -> 
  let tests = !!"src/**/bin/Release/Tests.dll"
  
  let nUnitParams p = 
    { p with DisableShadowCopy = true
             TimeOut = System.TimeSpan.FromMinutes 10. }
  try 
    tests |> NUnit nUnitParams
  finally
    if not isLocalBuild then AppVeyor.UploadTestResultsXml AppVeyor.TestResultsType.NUnit currentDirectory

Target "Nuget" <| fun () -> 
  let version = getUserInput "Version : "
  let apiKey = getUserInput "ApiKey : "
  Paket.Pack(fun p -> { p with Version = version })
  Paket.Push(fun p -> 
    { p with ApiKey = apiKey
             WorkingDir = "./temp" })

Target "Default" DoNothing
"KillProcesses" ==> "Build" ==> "Test" ==> "Default"
"Default" ==> "Nuget"
RunTargetOrDefault "Default"<commit_msg>delete temp directory after nuget push<commit_after>#r "packages/FAKE/tools/FakeLib.dll"

open Fake

let solutionFile = !!"*.sln" |> Seq.head

let version = 
  if isLocalBuild then "0.0.0.0"
  else appVeyorBuildVersion

Target "KillProcesses" <| fun () -> 
  ProcessHelper.killProcess "nunit-agent"
  ProcessHelper.killMSBuild()

Target "Build" <| fun () -> 
  !!"src/**/bin/Release/" |> CleanDirs
  build (fun x -> 
    { x with Verbosity = Some MSBuildVerbosity.Quiet
             Properties = [ "Configuration", "Release" ] }) solutionFile

Target "Test" <| fun () -> 
  let tests = !!"src/**/bin/Release/Tests.dll"
  
  let nUnitParams p = 
    { p with DisableShadowCopy = true
             TimeOut = System.TimeSpan.FromMinutes 10. }
  try 
    tests |> NUnit nUnitParams
  finally
    if not isLocalBuild then AppVeyor.UploadTestResultsXml AppVeyor.TestResultsType.NUnit currentDirectory

Target "Nuget" <| fun () -> 
  let version = getUserInput "Version : "
  let apiKey = getUserInput "ApiKey : "
  Paket.Pack(fun p -> { p with Version = version })
  Paket.Push(fun p -> 
    { p with ApiKey = apiKey
             WorkingDir = "./temp" })
  DeleteDir "./temp"

Target "Default" DoNothing
"KillProcesses" ==> "Build" ==> "Test" ==> "Default"
"Default" ==> "Nuget"
RunTargetOrDefault "Default"
{'fraction_non_alphanumeric': 0.13849765258215962, 'fraction_numerical': 0.004694835680751174, 'mean_word_length': 3.2194719471947195, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3450520', 'n_tokens_mistral': 882, 'n_tokens_neox': 859, 'n_words': 212}