<commit_before>// include Fake lib
#r "../packages/FAKE/tools/FakeLib.dll"
open Fake

RestorePackages()

// Properties
let buildDir = "./artifacts/build/"
let testsDir  = "./artifacts/tests/"

// Targets
Target "Clean" (fun _ ->
    trace "Cleanup..."
    CleanDirs [buildDir; testsDir]
)

Target "BuildApp" (fun _ ->
   trace "Building App..."
   !! "src/**/*.csproj"
     |> MSBuildRelease buildDir "Build"
     |> Log "AppBuild-Output: "
)

Target "BuildTests" (fun _ ->
    trace "Building Tests..."
    !! "tests/**/*.csproj"
      |> MSBuildDebug testsDir "Build"
      |> Log "TestBuild-Output: "
)

Target "RunTests" (fun _ ->
    trace "Running Tests..."
    !! (testsDir + @"\*Tests.dll") 
      |> xUnit (fun p -> {p with OutputDir = testsDir })
)

Target "Default" (fun _ ->
    trace "Default Target invoked."
)

// Dependencies
"Clean"
  ==> "BuildApp"
  ==> "BuildTests"
  ==> "RunTests"
  ==> "Default"

// start build
RunTargetOrDefault "Default"<commit_msg>first steps with nuget pack<commit_after>// include Fake lib
#r "../packages/FAKE/tools/FakeLib.dll"
open Fake

RestorePackages()

// Properties
let artifactsDir = @".\artifacts\"
let artifactsBuildDir = "./artifacts/build/"
let artifactsTestsDir  = "./artifacts/tests/"
let artifactsNugetDir  = @".\artifacts\nuget\"
let toolNugetExe = @".nuget\nuget.exe"

// Targets
Target "Clean" (fun _ ->
    trace "Cleanup..."
    CleanDirs [artifactsDir]
)

Target "BuildApp" (fun _ ->
   trace "Building App..."
   !! "src/**/*.csproj"
     |> MSBuildRelease artifactsBuildDir "Build"
     |> Log "AppBuild-Output: "
)

Target "BuildTests" (fun _ ->
    trace "Building Tests..."
    !! "tests/**/*.csproj"
      |> MSBuildDebug artifactsTestsDir "Build"
      |> Log "TestBuild-Output: "
)

Target "RunTests" (fun _ ->
    trace "Running Tests..."
    !! (artifactsTestsDir + @"\*Tests.dll") 
      |> xUnit (fun p -> {p with OutputDir = artifactsTestsDir })
)



let nuspec = @".\src\Sloader.Types\Sloader.Types.nuspec"
// Poor mans NuGet Pack Solution for FAKE...  
Target "CreateNuGetPackages" (fun _ ->
    trace "Create NuGet Packages..."
    CreateDir artifactsNugetDir
    let result =
        ExecProcess (fun info -> 
            info.FileName <- toolNugetExe
            info.Arguments <- "pack " + nuspec + " -OutputDirectory " + artifactsNugetDir
        ) (System.TimeSpan.FromMinutes 1.)
 
    if result <> 0 then failwith "Failed result from NuGet"
)

Target "Default" (fun _ ->
    trace "Default Target invoked."
)

// Dependencies
"Clean"
  ==> "BuildApp"
  ==> "BuildTests"
  ==> "RunTests"
  ==> "CreateNuGetPackages"
  ==> "Default"

// start build
RunTargetOrDefault "Default"
{'fraction_non_alphanumeric': 0.1646661665416354, 'fraction_numerical': 0.0007501875468867217, 'mean_word_length': 2.8820960698689957, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1724408', 'n_tokens_mistral': 930, 'n_tokens_neox': 881, 'n_words': 216}