<commit_before>#I "packages/FAKE/tools/"
#r "FakeLib"

open Fake

let docDir = "./doc"
let resultsDir = "./results"
let docOutputDir = resultsDir @@ "Documentation"
let nugetTemp = "./nugetTemp/"

Target "Clean" (fun _ -> 
    CleanDirs [resultsDir; nugetTemp]
)

Target "Build" (fun _ ->
    !! "/**/*.sln"
    |> MSBuild resultsDir "Build" ["Configuration", "Testing"]
    |> Log "Build-Output (testing): "

    !! "/**/*.sln"
    |> MSBuildRelease "" "Build"
    |> Log "Build-Output (nuget): "
)

Target "FSharp.Tools Nuget" (fun _ ->
    
    let grahamInfo = !! @"C:\Users\Daniel\git\incube\credit-suisse\fsharp-tools/graham.nuspec" |> Seq.exactlyOne
    let grahamInfo = (ReadFileAsString >> getNuspecProperties) grahamInfo
    
    let fsharpToolsNuget = !! "/**/Fsharp.Tools.nuspec" |> Seq.exactlyOne
    
    let nugetVersion = grahamInfo.Version
    let workingDir = nugetTemp @@ (filenameWithouExt fsharpToolsNuget)
    
    ensureDirectory (workingDir @@ "build")
    
    !! "/**/FSharp.Tools.Tasks/bin/Release/*.dll"
    ++ "/**/FSharp.Tools.Tasks/bin/Release/*.exe"
    ++ "/**/FSharp.Tools.Tasks/bin/Release/*.config"
    ++ "/**/fsharp*.exe.config"
    |> CopyFiles (workingDir @@ "build")

    !! "/**/bin/Release/FSharp.Tools.targets"
    |> CopyFiles (workingDir @@ "build")
    

    NuGet (fun p -> 
        { p with
            WorkingDir = workingDir
            OutputPath = resultsDir
            Version = grahamInfo.Version })
        fsharpToolsNuget
)

Target "Tests" DoNothing // TODO: implement something meaningful

Target "Default" DoNothing

"Clean"
    ==> "Build"
    =?> ("Tests", not <| hasBuildParam "NoTests")
    ==> "FSharp.Tools Nuget"
    ==> "Default"

RunTargetOrDefault "Default"<commit_msg>add depedencies to nuget.<commit_after>#I "packages/FAKE/tools/"
#r "FakeLib"

open Fake

let docDir = "./doc"
let resultsDir = "./results"
let docOutputDir = resultsDir @@ "Documentation"
let nugetTemp = "./nugetTemp/"

Target "Clean" (fun _ -> 
    CleanDirs [resultsDir; nugetTemp]
)

Target "Build" (fun _ ->
    !! "/**/*.sln"
    |> MSBuild resultsDir "Build" ["Configuration", "Testing"]
    |> Log "Build-Output (testing): "

    !! "/**/*.sln"
    |> MSBuildRelease "" "Build"
    |> Log "Build-Output (nuget): "
)

Target "FSharp.Tools Nuget" (fun _ ->
    
    let grahamInfo = !! @"/**/graham.nuspec" |> Seq.exactlyOne
    let grahamInfo = (ReadFileAsString >> getNuspecProperties) grahamInfo
    
    let fsharpToolsNuget = !! "/**/Fsharp.Tools.nuspec" |> Seq.exactlyOne
    
    let nugetVersion = grahamInfo.Version
    let workingDir = nugetTemp @@ (filenameWithouExt fsharpToolsNuget)
    
    ensureDirectory (workingDir @@ "build")
    ensureDirectory (workingDir @@ "lib" @@ "net40")
    
    !! "/**/FSharp.Tools.Tasks/bin/Release/*.dll"
    ++ "/**/FSharp.Tools.Tasks/bin/Release/*.exe"
    ++ "/**/FSharp.Tools.Tasks/bin/Release/*.config"
    ++ "/**/fsharp*.exe.config"
    |> CopyFiles (workingDir @@ "build")

    !! "/**/bin/Release/FSharp.Tools.targets"
    |> CopyFiles (workingDir @@ "build")
    
    !! "/**/LegacyInterpreters/bin/Release/*.*"
    -- "/**/FSharp.Core.*"
    |> CopyFiles (workingDir @@ "lib" @@ "net40")

    NuGet (fun p -> 
        { p with
            WorkingDir = workingDir
            OutputPath = resultsDir
            Version = grahamInfo.Version })
        fsharpToolsNuget
)

Target "Tests" DoNothing // TODO: implement something meaningful

Target "Default" DoNothing

"Clean"
    ==> "Build"
    =?> ("Tests", not <| hasBuildParam "NoTests")
    ==> "FSharp.Tools Nuget"
    ==> "Default"

RunTargetOrDefault "Default"
{'fraction_non_alphanumeric': 0.1734806629834254, 'fraction_numerical': 0.0011049723756906078, 'mean_word_length': 2.8893662728249194, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '4372014', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1222, 'n_words': 242}