<commit_before>#r @"tools/packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
open Fake.Testing.NUnit3

let assemblyVersion = getBuildParamOrDefault "version" "0.1.0"
let nugetVersion = assemblyVersion + "-alfa0003"
let packageOutputDir = "./.output"

let nugetApiKey = environVarOrDefault "NugetOrgApiKey" "ENV-VARIABLE NugetOrgApiKey is missing"
let project = "./NoCommons/NoCommons.csproj"
let nuspec = "./NoCommons/NoCommons.nuspec"
let sln = "./NoCommons.NET.sln"

let buildOutputTest = "./.testbuild"

Target "Clean" (fun() ->
    CleanDirs [buildOutputTest; packageOutputDir]
)

Target "UpdateAssemblyInfo"(fun _ -> 
    ReplaceAssemblyInfoVersions (fun p -> 
        {
            p with 
                OutputFileName = "./NoCommons/Properties/AssemblyInfo.cs"
                AssemblyFileVersion = assemblyVersion
                AssemblyVersion = assemblyVersion
        }) 
)

Target "NugetRestore" (fun _ -> 
    RestorePackages() 
)

Target "BuildTest" (fun _ ->
    MSBuildRelease buildOutputTest "Clean;Rebuild" [sln] |> ignore 
)

Target "Test" (fun _ ->
    !! ".testbuild/*.Tests.dll"
      |> NUnit3 (fun p ->
          {  p with
                WorkingDir = "./"                                             
          })     
)

Target "Buildpackage" (fun _ -> 
    MSBuildDebug "" "Clean;Rebuild" [project] |> ignore    
)

Target "CreatePackage" (fun _ ->        
    NuGet (fun p -> 
        {p with            
            WorkingDir = "./"
            Authors = ["<NAME>"]
            Project = "NoCommons"
            Title = "NoCommons.NET"                                    
            OutputPath = packageOutputDir
            Version = nugetVersion
            AccessKey = nugetApiKey
            Publish = false    
            })
        project
        
)

Target "Nothing" (fun x -> trace "Try a defined target")

"Clean"
    ==> "UpdateAssemblyInfo"
    ==> "NugetRestore"
    ==> "BuildTest"
    ==> "Test"<commit_msg>Releasebuilds > debug builds<commit_after>#r @"tools/packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
open Fake.Testing.NUnit3

let assemblyVersion = getBuildParamOrDefault "version" "0.1.0"
let nugetVersion = assemblyVersion + "-alfa0003"
let packageOutputDir = "./.output"

let nugetApiKey = environVarOrDefault "NugetOrgApiKey" "ENV-VARIABLE NugetOrgApiKey is missing"
let project = "./NoCommons/NoCommons.csproj"
let nuspec = "./NoCommons/NoCommons.nuspec"
let sln = "./NoCommons.NET.sln"

let buildOutputTest = "./.testbuild"

Target "Clean" (fun() ->
    CleanDirs [buildOutputTest; packageOutputDir]
)

Target "UpdateAssemblyInfo"(fun _ -> 
    ReplaceAssemblyInfoVersions (fun p -> 
        {
            p with 
                OutputFileName = "./NoCommons/Properties/AssemblyInfo.cs"
                AssemblyFileVersion = assemblyVersion
                AssemblyVersion = assemblyVersion
        }) 
)

Target "NugetRestore" (fun _ -> 
    RestorePackages() 
)

Target "BuildTest" (fun _ ->
    MSBuildRelease buildOutputTest "Clean;Rebuild" [sln] |> ignore 
)

Target "Test" (fun _ ->
    !! ".testbuild/*.Tests.dll"
      |> NUnit3 (fun p ->
          {  p with
                WorkingDir = "./"                                             
          })     
)

Target "Buildpackage" (fun _ -> 
    MSBuildRelease "" "Build" [project] |> ignore    
)

Target "CreatePackage" (fun _ ->
    project |>         
        NuGet (fun p -> 
        {p with            
            WorkingDir = "./"
            Authors = ["<NAME>"]
            Project = "NoCommons"
            Title = "NoCommons.NET"                                    
            OutputPath = packageOutputDir
            Version = nugetVersion
            AccessKey = nugetApiKey
            Publish = false
            Properties = [ ("Configuration", "Release") ]    
            })
        
        
)

Target "Nothing" (fun x -> trace "Try a defined target")

"Clean"
    ==> "UpdateAssemblyInfo"
    ==> "NugetRestore"
    ==> "BuildTest"
    ==> "Test"
{'fraction_non_alphanumeric': 0.11607142857142858, 'fraction_numerical': 0.004464285714285714, 'mean_word_length': 1.9288307915758895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '697311', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1184, 'n_words': 256}