diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 9d1731cec75..619ac290d19 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,6 +3,16 @@ // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ + { + "label": "dotnet:restore:fake.sln", + "group": "build", + "command": "dotnet restore FAKE.sln", + "type": "shell", + "presentation": { + "reveal": "always" + }, + "problemMatcher": "$msCompile" + }, { "label": "dotnet:build:fake.sln", "group": "build", @@ -11,7 +21,10 @@ "presentation": { "reveal": "always" }, - "problemMatcher": "$msCompile" + "problemMatcher": "$msCompile", + "dependsOn": [ + "dotnet:restore:fake.sln" + ] }, { "label": "dotnet:run:unitTests", @@ -22,6 +35,40 @@ "reveal": "always" }, "problemMatcher": "$msCompile" + }, + { + "label": "dotnet:run:commandLineUnitTests", + "group": "test", + "command": "dotnet run -p src/test/Fake.Core.CommandLine.UnitTests/Fake.Core.CommandLine.UnitTests.fsproj", + "type": "shell", + "presentation": { + "reveal": "always" + }, + "problemMatcher": "$msCompile" + }, + { + "label": "dotnet:run:integrationTests", + "group": "test", + "command": "dotnet run -p src/test/Fake.Core.IntegrationTests/Fake.Core.IntegrationTests.fsproj", + "type": "shell", + "presentation": { + "reveal": "always" + }, + "problemMatcher": "$msCompile" + }, + { + "label": "dotnet:run:allTests", + "group": "test", + "dependsOn": [ + "dotnet:run:integrationTests", + "dotnet:run:commandLineUnitTests", + "dotnet:run:unitTests" + ], + "type": "shell", + "presentation": { + "reveal": "always" + }, + "problemMatcher": "$msCompile" } ] } diff --git a/Fake.sln b/Fake.sln index d2c6c236474..592d83f7310 100644 --- a/Fake.sln +++ b/Fake.sln @@ -1,4 +1,5 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27130.2026 MinimumVisualStudioVersion = 15.0.26124.0 @@ -6,6 +7,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{7BFFAE76-DEE EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Context", "src/app/Fake.Core.Context/Fake.Core.Context.fsproj", "{D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB}" EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.FakeVar", "src/app/Fake.Core.FakeVar/Fake.Core.FakeVar.fsproj", "{1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}" +EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Environment", "src/app/Fake.Core.Environment/Fake.Core.Environment.fsproj", "{A2C4A85F-24C4-4FFA-B165-4807B1127C4E}" EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Process", "src/app/Fake.Core.Process/Fake.Core.Process.fsproj", "{DB09FF66-8750-40B8-9E25-70FADD9CF0BD}" @@ -126,10 +129,10 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Tools.Pickles", "src/a EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{03CB61B6-EBB8-4C4A-B6A3-0D84D1F78A92}" ProjectSection(SolutionItems) = preProject + .gitlab-ci.yml = .gitlab-ci.yml build.fsx = build.fsx - paket.lock = paket.lock paket.dependencies = paket.dependencies - .gitlab-ci.yml = .gitlab-ci.yml + paket.lock = paket.lock RELEASE_NOTES.md = RELEASE_NOTES.md EndProjectSection EndProject @@ -139,9 +142,9 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Windows.Registry", "sr EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Fsc", "src/app/Fake.DotNet.Fsc/Fake.DotNet.Fsc.fsproj", "{32A82EF2-BB35-40A2-9418-904ECFC1EF47}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fake.BuildServer.GitLab", "src/app/Fake.BuildServer.GitLab/Fake.BuildServer.GitLab.fsproj", "{F778A9E5-FC1A-4934-A6B9-98C84BE9A667}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.BuildServer.GitLab", "src/app/Fake.BuildServer.GitLab/Fake.BuildServer.GitLab.fsproj", "{F778A9E5-FC1A-4934-A6B9-98C84BE9A667}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "fake-cli", "src/app/fake-cli/fake-cli.fsproj", "{9E26B2AE-856A-42B6-9670-8766919F7D25}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fake-cli", "src/app/fake-cli/fake-cli.fsproj", "{9E26B2AE-856A-42B6-9670-8766919F7D25}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -165,6 +168,18 @@ Global {D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB}.Release|x64.Build.0 = Release|Any CPU {D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB}.Release|x86.ActiveCfg = Release|Any CPU {D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB}.Release|x86.Build.0 = Release|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Debug|x64.ActiveCfg = Debug|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Debug|x64.Build.0 = Debug|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Debug|x86.ActiveCfg = Debug|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Debug|x86.Build.0 = Debug|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Release|Any CPU.Build.0 = Release|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Release|x64.ActiveCfg = Release|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Release|x64.Build.0 = Release|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Release|x86.ActiveCfg = Release|Any CPU + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF}.Release|x86.Build.0 = Release|Any CPU {A2C4A85F-24C4-4FFA-B165-4807B1127C4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A2C4A85F-24C4-4FFA-B165-4807B1127C4E}.Debug|Any CPU.Build.0 = Debug|Any CPU {A2C4A85F-24C4-4FFA-B165-4807B1127C4E}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -863,16 +878,16 @@ Global {32A82EF2-BB35-40A2-9418-904ECFC1EF47}.Release|x86.Build.0 = Release|Any CPU {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|x64.ActiveCfg = Debug|x64 - {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|x64.Build.0 = Debug|x64 - {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|x86.ActiveCfg = Debug|x86 - {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|x86.Build.0 = Debug|x86 + {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|x64.ActiveCfg = Debug|Any CPU + {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|x64.Build.0 = Debug|Any CPU + {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|x86.ActiveCfg = Debug|Any CPU + {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Debug|x86.Build.0 = Debug|Any CPU {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|Any CPU.ActiveCfg = Release|Any CPU {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|Any CPU.Build.0 = Release|Any CPU - {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x64.ActiveCfg = Release|x64 - {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x64.Build.0 = Release|x64 - {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x86.ActiveCfg = Release|x86 - {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x86.Build.0 = Release|x86 + {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x64.ActiveCfg = Release|Any CPU + {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x64.Build.0 = Release|Any CPU + {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x86.ActiveCfg = Release|Any CPU + {F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x86.Build.0 = Release|Any CPU {9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|Any CPU.Build.0 = Debug|Any CPU {9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -891,6 +906,7 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} + {1CEE1FC0-41F4-4F6C-A409-3849B30D57EF} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} {A2C4A85F-24C4-4FFA-B165-4807B1127C4E} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} {DB09FF66-8750-40B8-9E25-70FADD9CF0BD} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} {FEDE1F15-C0A5-4DA1-B20D-0A0C28F6858E} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} diff --git a/src/app/Fake.Azure.Kudu/Kudu.fs b/src/app/Fake.Azure.Kudu/Kudu.fs index 1bd01e37fb7..6826d3940c3 100644 --- a/src/app/Fake.Azure.Kudu/Kudu.fs +++ b/src/app/Fake.Azure.Kudu/Kudu.fs @@ -26,7 +26,7 @@ type WebJobType = Scheduled | Continuous do Directory.ensure deploymentTemp |> ignore Directory.ensure deploymentTarget |> ignore - Shell.CleanDir deploymentTemp + Shell.cleanDir deploymentTemp /// /// Stages a folder and all subdirectories into the temp deployment area, ready for deployment into the website. @@ -34,7 +34,7 @@ do /// The source folder to copy. /// A predicate which includes files from the folder. If the entire directory should be copied, this predicate should always return true. let stageFolder source shouldInclude = - Shell.CopyRecursive source deploymentTemp true + Shell.copyRecursive source deploymentTemp true |> Seq.filter (not << shouldInclude) |> Seq.iter File.Delete @@ -47,7 +47,7 @@ let getWebJobPath webJobType webJobName = let stageWebJob webJobType webJobName files = let webJobPath = getWebJobPath webJobType webJobName Directory.ensure webJobPath |> ignore - files |> Shell.CopyFiles webJobPath + files |> Shell.copyFiles webJobPath /// Synchronises all staged files from the temporary deployment to the actual deployment, removing /// any obsolete files, updating changed files and adding new files. diff --git a/src/app/Fake.Core.Context/Context.fs b/src/app/Fake.Core.Context/Context.fs index cc4bf602d33..38ba8cf0a69 100644 --- a/src/app/Fake.Core.Context/Context.fs +++ b/src/app/Fake.Core.Context/Context.fs @@ -112,26 +112,31 @@ let forceFakeContext () = invalidOp "no Fake Execution context was found. You can initialize one via Fake.Core.Context.setExecutionContext" | RuntimeContext.Fake e -> e +[] let getFakeVar name = forceFakeContext() |> getFakeContext name |> Option.map (fun o -> o :?> 'a) - + +[] let removeFakeVar name = forceFakeContext() |> removeFakeContext name |> Option.map (fun o -> o :?> 'a) +[] let setFakeVar name (v:'a) = forceFakeContext() |> setFakeContext name v (fun _ -> v :> obj) :?> 'a +[] let fakeVar name = (fun () -> getFakeVar name : 'a option), (fun () -> (removeFakeVar name : 'a option) |> ignore), (fun (v : 'a) -> setFakeVar name v |> ignore) +[] let fakeVarAllowNoContext name = let mutable varWithoutContext = None (fun () -> @@ -145,4 +150,4 @@ let fakeVarAllowNoContext name = (fun (v : 'a) -> if isFakeContext() then setFakeVar name v |> ignore - else varWithoutContext <- Some v) \ No newline at end of file + else varWithoutContext <- Some v) diff --git a/src/app/Fake.Core.FakeVar/AssemblyInfo.fs b/src/app/Fake.Core.FakeVar/AssemblyInfo.fs new file mode 100644 index 00000000000..906ad25a585 --- /dev/null +++ b/src/app/Fake.Core.FakeVar/AssemblyInfo.fs @@ -0,0 +1,17 @@ +// Auto-Generated by FAKE; do not edit +namespace System +open System.Reflection + +[] +[] +[] +[] +[] +do () + +module internal AssemblyVersionInformation = + let [] AssemblyTitle = "FAKE - F# Make Core FakeVar" + let [] AssemblyProduct = "FAKE - F# Make" + let [] AssemblyVersion = "5.0.0" + let [] AssemblyInformationalVersion = "5.0.0.0" + let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.Core.FakeVar/Fake.Core.FakeVar.fsproj b/src/app/Fake.Core.FakeVar/Fake.Core.FakeVar.fsproj new file mode 100644 index 00000000000..d0cfa879320 --- /dev/null +++ b/src/app/Fake.Core.FakeVar/Fake.Core.FakeVar.fsproj @@ -0,0 +1,18 @@ + + + net46;netstandard1.6;netstandard2.0 + Fake.Core.FakeVar + Library + + + $(DefineConstants);RELEASE + + + + + + + + + + diff --git a/src/app/Fake.Core.FakeVar/FakeVar.fs b/src/app/Fake.Core.FakeVar/FakeVar.fs new file mode 100644 index 00000000000..9e8bd59a87f --- /dev/null +++ b/src/app/Fake.Core.FakeVar/FakeVar.fs @@ -0,0 +1,62 @@ +/// This module contains helpers for managing build time variables +[] +module Fake.Core.FakeVar + +open Fake.Core.Context + +/// Gets a strongly typed FakeVar by name returning an option type +let get<'a> name = + forceFakeContext() + |> getFakeContext name + |> Option.map (fun o -> try + o :?> 'a + with e -> + raise <| exn(sprintf "Cast error on variable '%s'" name, e) + ) + +/// Gets a strongly typed FakeVar by name will fail if variable is not found +let getOrFail<'a> name = + match get<'a> name with + | Some v -> v + | _ -> failwithf "Unable to find variable '%s'" name + +/// Gets a strongly typed FakeVar by name will return default value if variable is not found +let getOrDefault<'a> name defaultValue = + match get<'a> name with + | Some v -> v + | _ -> defaultValue + +/// Removes a FakeVar by name +let remove name = + forceFakeContext() + |> removeFakeContext name + |> ignore + +/// Sets value of a FakeVar +let set name (v:'a) = + forceFakeContext() + |> setFakeContext name v (fun _ -> v :> obj) + |> ignore + +/// Define a named FakeVar providing the get, remove and set +/// Will fail if there is no context +let define<'a> name = + if isFakeContext() then + (fun () -> get name : 'a option), + (fun () -> remove name), + (fun (v : 'a) -> set name v) + else + failwithf "Cannot define variable '%s' without context" name + +/// Define a named FakeVar providing the get, remove and set +/// Will create a local variable if there is no context +let defineAllowNoContext<'a> name = + if isFakeContext() then + (fun () -> get name : 'a option), + (fun () -> remove name), + (fun (v : 'a) -> set name v) + else + let mutable varWithoutContext = None + (fun () -> varWithoutContext), + (fun () -> varWithoutContext <- None), + (fun (v : 'a) -> varWithoutContext <- Some v) diff --git a/src/app/Fake.Core.FakeVar/paket.references b/src/app/Fake.Core.FakeVar/paket.references new file mode 100644 index 00000000000..2c8a7ddfd73 --- /dev/null +++ b/src/app/Fake.Core.FakeVar/paket.references @@ -0,0 +1,4 @@ +group netcore + +FSharp.Core +NETStandard.Library \ No newline at end of file diff --git a/src/app/Fake.Core.Process/Fake.Core.Process.fsproj b/src/app/Fake.Core.Process/Fake.Core.Process.fsproj index 848c4a6b99e..9d4a3ff7400 100644 --- a/src/app/Fake.Core.Process/Fake.Core.Process.fsproj +++ b/src/app/Fake.Core.Process/Fake.Core.Process.fsproj @@ -22,6 +22,7 @@ + @@ -38,4 +39,4 @@ - \ No newline at end of file + diff --git a/src/app/Fake.Core.Process/Process.fs b/src/app/Fake.Core.Process/Process.fs index 7c98226c95b..90d8bae424d 100644 --- a/src/app/Fake.Core.Process/Process.fs +++ b/src/app/Fake.Core.Process/Process.fs @@ -4,9 +4,6 @@ namespace Fake.Core open System open System.Diagnostics -open System.Collections.Generic -open System.Collections.Generic -open System /// A record type which captures console messages type ConsoleMessage = @@ -250,25 +247,25 @@ module Process = | _ -> () with exn -> Trace.logfn "Killing %d failed with %s" pid exn.Message startedProcesses.Clear() - member x.KillAll() = killProcesses() - member x.Add (pid, startTime) = startedProcesses.Add(pid, startTime) - member x.SetShouldKill (enable) = shouldKillProcesses <- enable - member x.GetShouldKill = shouldKillProcesses + member __.KillAll() = killProcesses() + member __.Add (pid, startTime) = startedProcesses.Add(pid, startTime) + member __.SetShouldKill (enable) = shouldKillProcesses <- enable + member __.GetShouldKill = shouldKillProcesses interface IDisposable with - member x.Dispose() = + member __.Dispose() = if shouldKillProcesses then killProcesses() /// [omit] //let startedProcesses = HashSet() let private startedProcessesVar = "Fake.Core.Process.startedProcesses" let private getStartedProcesses, _, private setStartedProcesses = - Fake.Core.Context.fakeVar startedProcessesVar + Fake.Core.FakeVar.defineAllowNoContext startedProcessesVar let private doWithProcessList f = if Fake.Core.Context.isFakeContext () then match getStartedProcesses () with - | Some (h:ProcessList) -> Some(f h) + | Some h -> Some(f h) | None -> let h = new ProcessList() setStartedProcesses (h) @@ -337,7 +334,7 @@ module Process = //let mutable redirectOutputToTrace = false let private redirectOutputToTraceVar = "Fake.Core.Process.redirectOutputToTrace" let private tryGetRedirectOutputToTrace, _, public setRedirectOutputToTrace = - Fake.Core.Context.fakeVarAllowNoContext redirectOutputToTraceVar + Fake.Core.FakeVar.defineAllowNoContext redirectOutputToTraceVar let getRedirectOutputToTrace () = match tryGetRedirectOutputToTrace() with | Some v -> v @@ -350,7 +347,7 @@ module Process = //let mutable enableProcessTracing = true let private enableProcessTracingVar = "Fake.Core.Process.enableProcessTracing" let private getEnableProcessTracing, private removeEnableProcessTracing, public setEnableProcessTracing = - Fake.Core.Context.fakeVarAllowNoContext enableProcessTracingVar + Fake.Core.FakeVar.defineAllowNoContext enableProcessTracingVar let shouldEnableProcessTracing () = match getEnableProcessTracing() with | Some v -> v @@ -648,7 +645,7 @@ module Process = #if FX_CONFIGURATION_MANAGER try System.Configuration.ConfigurationManager.AppSettings.[key] - with exn -> "" + with _ -> "" #else null #endif @@ -731,11 +728,11 @@ module Process = |> Seq.filter (fun p -> try not p.HasExited - with exn -> false) + with _ -> false) |> Seq.filter (fun p -> try p.ProcessName.ToLower().StartsWith(name.ToLower()) - with exn -> false) + with _ -> false) [] let getProcessesByName name = getAllByName name diff --git a/src/app/Fake.Core.Target/Fake.Core.Target.fsproj b/src/app/Fake.Core.Target/Fake.Core.Target.fsproj index 20be84566c2..a578c5de2f1 100644 --- a/src/app/Fake.Core.Target/Fake.Core.Target.fsproj +++ b/src/app/Fake.Core.Target/Fake.Core.Target.fsproj @@ -17,6 +17,7 @@ + diff --git a/src/app/Fake.Core.Target/Target.fs b/src/app/Fake.Core.Target/Target.fs index 94a6c431ca1..93178615fe1 100644 --- a/src/app/Fake.Core.Target/Target.fs +++ b/src/app/Fake.Core.Target/Target.fs @@ -105,13 +105,13 @@ module Target = //let mutable PrintStackTraceOnError = false let private printStackTraceOnErrorVar = "Fake.Core.Target.PrintStackTraceOnError" let private getPrintStackTraceOnError, _, (setPrintStackTraceOnError:bool -> unit) = - Fake.Core.Context.fakeVar printStackTraceOnErrorVar + Fake.Core.FakeVar.define printStackTraceOnErrorVar /// [omit] //let mutable LastDescription = null let private lastDescriptionVar = "Fake.Core.Target.LastDescription" let private getLastDescription, removeLastDescription, setLastDescription = - Fake.Core.Context.fakeVar lastDescriptionVar + Fake.Core.FakeVar.define lastDescriptionVar /// Sets the Description for the next target. /// [omit] @@ -132,7 +132,7 @@ module Target = let internal getVarWithInit name f = let varName = sprintf "Fake.Core.Target.%s" name let getVar, _, setVar = - Fake.Core.Context.fakeVar varName + Fake.Core.FakeVar.define varName fun () -> match getVar() with | Some d -> d diff --git a/src/app/Fake.Core.Tasks/Fake.Core.Tasks.fsproj b/src/app/Fake.Core.Tasks/Fake.Core.Tasks.fsproj index 7ec1a094ccf..3997c189ddc 100644 --- a/src/app/Fake.Core.Tasks/Fake.Core.Tasks.fsproj +++ b/src/app/Fake.Core.Tasks/Fake.Core.Tasks.fsproj @@ -21,9 +21,7 @@ - - true - + - \ No newline at end of file + diff --git a/src/app/Fake.Core.Trace/Fake.Core.Trace.fsproj b/src/app/Fake.Core.Trace/Fake.Core.Trace.fsproj index b38eab541fd..5f669864df3 100644 --- a/src/app/Fake.Core.Trace/Fake.Core.Trace.fsproj +++ b/src/app/Fake.Core.Trace/Fake.Core.Trace.fsproj @@ -19,6 +19,7 @@ + - \ No newline at end of file + diff --git a/src/app/Fake.Core.Trace/TraceListener.fs b/src/app/Fake.Core.Trace/TraceListener.fs index e17a8a95990..9bc8e0266a5 100644 --- a/src/app/Fake.Core.Trace/TraceListener.fs +++ b/src/app/Fake.Core.Trace/TraceListener.fs @@ -270,7 +270,7 @@ type TraceSecret = module TraceSecrets = let private traceSecretsVar = "Fake.Core.Trace.TraceSecrets" let private getTraceSecrets, _, (setTraceSecrets:TraceSecret list -> unit) = - Fake.Core.Context.fakeVar traceSecretsVar + Fake.Core.FakeVar.define traceSecretsVar let getAll () = match getTraceSecrets() with @@ -302,7 +302,7 @@ module CoreTracing = let private traceListenersVar = "Fake.Core.Trace.TraceListeners" let private getTraceListeners, _, (setTraceListenersPrivate:ITraceListener list -> unit) = - Fake.Core.Context.fakeVar traceListenersVar + Fake.Core.FakeVar.define traceListenersVar let areListenersSet () = match getTraceListeners() with diff --git a/src/app/Fake.Core.Xml/Fake.Core.Xml.fsproj b/src/app/Fake.Core.Xml/Fake.Core.Xml.fsproj index 7afef7693a8..4884d59307d 100644 --- a/src/app/Fake.Core.Xml/Fake.Core.Xml.fsproj +++ b/src/app/Fake.Core.Xml/Fake.Core.Xml.fsproj @@ -21,9 +21,7 @@ - - true - + \ No newline at end of file diff --git a/src/app/Fake.DotNet.AssemblyInfoFile/AssemblyInfoFile.fs b/src/app/Fake.DotNet.AssemblyInfoFile/AssemblyInfoFile.fs index 6cb0fd368d3..001afd21ce7 100644 --- a/src/app/Fake.DotNet.AssemblyInfoFile/AssemblyInfoFile.fs +++ b/src/app/Fake.DotNet.AssemblyInfoFile/AssemblyInfoFile.fs @@ -213,7 +213,6 @@ module AssemblyInfoFile = /// Creates a C# AssemblyInfo file with the given attributes and configuration. /// The generated AssemblyInfo file contains an AssemblyVersionInformation class which can be used to retrieve the current version no. from inside of an assembly. - [] let createCSharpWithConfig outputFileName attributes (config : AssemblyInfoFileConfig) = use __ = Trace.traceTask "AssemblyInfo" outputFileName let generateClass, useNamespace, emitResharperSupressions = config.GenerateClass, config.UseNamespace, config.EmitResharperSuppressions @@ -260,7 +259,6 @@ module AssemblyInfoFile = /// Creates a F# AssemblyInfo file with the given attributes and configuration. /// The generated AssemblyInfo file contains an AssemblyVersionInformation class which can be used to retrieve the current version no. from inside of an assembly. - [] let createFSharpWithConfig outputFileName attributes (config : AssemblyInfoFileConfig) = use __ = Trace.traceTask "AssemblyInfo" outputFileName let generateClass, useNamespace = config.GenerateClass, config.UseNamespace @@ -292,7 +290,6 @@ module AssemblyInfoFile = /// Creates a VB AssemblyInfo file with the given attributes and configuration. /// The generated AssemblyInfo file contains an AssemblyVersionInformation class which can be used to retrieve the current version no. from inside of an assembly. - [] let createVisualBasicWithConfig outputFileName attributes (config : AssemblyInfoFileConfig) = use __ = Trace.traceTask "AssemblyInfo" outputFileName let generateClass, _ = config.GenerateClass, config.UseNamespace @@ -321,7 +318,6 @@ module AssemblyInfoFile = /// Creates a C++/CLI AssemblyInfo file with the given attributes and configuration. /// Does not generate an AssemblyVersionInformation class. - [] let createCppCliWithConfig outputFileName attributes (config : AssemblyInfoFileConfig) = use __ = Trace.traceTask "AssemblyInfo" outputFileName let _, _ = config.GenerateClass, config.UseNamespace @@ -342,24 +338,20 @@ module AssemblyInfoFile = /// Creates a C# AssemblyInfo file with the given attributes. /// The generated AssemblyInfo file contains an AssemblyVersionInformation class which can be used to retrieve the current version no. from inside of an assembly. - [] let createCSharp outputFileName attributes = createCSharpWithConfig outputFileName attributes AssemblyInfoFileConfig.Default /// Creates a F# AssemblyInfo file with the given attributes. /// The generated AssemblyInfo file contains an AssemblyVersionInformation class which can be used to retrieve the current version no. from inside of an assembly. - [] let createFSharp outputFileName attributes = createFSharpWithConfig outputFileName attributes AssemblyInfoFileConfig.Default /// Creates a VB AssemblyInfo file with the given attributes. /// The generated AssemblyInfo file contains an AssemblyVersionInformation class which can be used to retrieve the current version no. from inside of an assembly. - [] let createVisualBasic outputFileName attributes = createVisualBasicWithConfig outputFileName attributes AssemblyInfoFileConfig.Default /// Creates a C++/CLI AssemblyInfo file with the given attributes. - [] let createCppCli outputFileName attributes = createCppCliWithConfig outputFileName attributes AssemblyInfoFileConfig.Default diff --git a/src/app/Fake.DotNet.AssemblyInfoFile/Fake.DotNet.AssemblyInfoFile.fsproj b/src/app/Fake.DotNet.AssemblyInfoFile/Fake.DotNet.AssemblyInfoFile.fsproj index 047abcbde0c..b91d15c230e 100644 --- a/src/app/Fake.DotNet.AssemblyInfoFile/Fake.DotNet.AssemblyInfoFile.fsproj +++ b/src/app/Fake.DotNet.AssemblyInfoFile/Fake.DotNet.AssemblyInfoFile.fsproj @@ -15,9 +15,7 @@ - - true - + \ No newline at end of file diff --git a/src/app/Fake.DotNet.FSFormatting/Fake.DotNet.FSFormatting.fsproj b/src/app/Fake.DotNet.FSFormatting/Fake.DotNet.FSFormatting.fsproj index 0b061c85003..75c9ee7d3e1 100644 --- a/src/app/Fake.DotNet.FSFormatting/Fake.DotNet.FSFormatting.fsproj +++ b/src/app/Fake.DotNet.FSFormatting/Fake.DotNet.FSFormatting.fsproj @@ -21,9 +21,7 @@ - - true - + \ No newline at end of file diff --git a/src/app/Fake.DotNet.Fsc/AssemblyInfo.fs b/src/app/Fake.DotNet.Fsc/AssemblyInfo.fs index 205ef7d1e2c..27cd877ad33 100644 --- a/src/app/Fake.DotNet.Fsc/AssemblyInfo.fs +++ b/src/app/Fake.DotNet.Fsc/AssemblyInfo.fs @@ -5,7 +5,7 @@ open System.Reflection [] [] [] -[] +[] [] do () @@ -13,5 +13,5 @@ module internal AssemblyVersionInformation = let [] AssemblyTitle = "FAKE - F# Make FSC Wrapper" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.DotNet.Mage/AssemblyInfo.fs b/src/app/Fake.DotNet.Mage/AssemblyInfo.fs index de1d4db345e..2a165429700 100644 --- a/src/app/Fake.DotNet.Mage/AssemblyInfo.fs +++ b/src/app/Fake.DotNet.Mage/AssemblyInfo.fs @@ -5,7 +5,7 @@ open System.Reflection [] [] [] -[] +[] [] do () @@ -13,5 +13,5 @@ module internal AssemblyVersionInformation = let [] AssemblyTitle = "FAKE - F# Make Manifest Generation and Editing Tool" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-rc007" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.DotNet.NuGet/Fake.DotNet.NuGet.fsproj b/src/app/Fake.DotNet.NuGet/Fake.DotNet.NuGet.fsproj index ebecaf41be8..d5ea9369379 100644 --- a/src/app/Fake.DotNet.NuGet/Fake.DotNet.NuGet.fsproj +++ b/src/app/Fake.DotNet.NuGet/Fake.DotNet.NuGet.fsproj @@ -28,9 +28,7 @@ - - true - + - \ No newline at end of file + diff --git a/src/app/Fake.DotNet.NuGet/NuGet.fs b/src/app/Fake.DotNet.NuGet/NuGet.fs index 83693a2bc01..722b052b576 100644 --- a/src/app/Fake.DotNet.NuGet/NuGet.fs +++ b/src/app/Fake.DotNet.NuGet/NuGet.fs @@ -134,9 +134,6 @@ let RequireRange breakingPoint version = let private packageFileName parameters = sprintf "%s.%s.nupkg" parameters.Project parameters.Version -[] -let private FullName = Path.getFullName - /// Gets the version no. for a given package in the deployments folder let GetPackageVersion deploymentsDir package = try @@ -331,10 +328,10 @@ let rec private publish parameters = | Some source, Some symSource -> sprintf "-source %s -SymbolSource %s -SymbolApiKey %s" source symSource parameters.SymbolAccessKey - let args = sprintf "push \"%s\" %s %s" (parameters.OutputPath @@ packageFileName parameters |> FullName) + let args = sprintf "push \"%s\" %s %s" (parameters.OutputPath @@ packageFileName parameters |> Path.getFullName) parameters.AccessKey source Trace.tracefn "%s %s in WorkingDir: %s Trials left: %d" parameters.ToolPath args - (FullName parameters.WorkingDir) parameters.PublishTrials + (Path.getFullName parameters.WorkingDir) parameters.PublishTrials try let result = let tracing = Process.shouldEnableProcessTracing() @@ -343,7 +340,7 @@ let rec private publish parameters = Process.execSimple ((fun info -> { info with FileName = parameters.ToolPath - WorkingDirectory = FullName parameters.WorkingDir + WorkingDirectory = Path.getFullName parameters.WorkingDir Arguments = args }) >> Process.withFramework) parameters.TimeOut finally Process.setEnableProcessTracing tracing if result <> 0 then @@ -359,7 +356,7 @@ let rec private publishSymbols parameters = sprintf "push -source %s \"%s\" %s" parameters.PublishUrl (packageFileName parameters) parameters.AccessKey Trace.tracefn "%s %s in WorkingDir: %s Trials left: %d" parameters.ToolPath args - (FullName parameters.WorkingDir) parameters.PublishTrials + (Path.getFullName parameters.WorkingDir) parameters.PublishTrials try let result = let tracing = Process.shouldEnableProcessTracing() @@ -368,7 +365,7 @@ let rec private publishSymbols parameters = Process.execSimple ((fun info -> { info with FileName = parameters.ToolPath - WorkingDirectory = FullName parameters.WorkingDir + WorkingDirectory = Path.getFullName parameters.WorkingDir Arguments = args }) >> Process.withFramework) parameters.TimeOut finally Process.setEnableProcessTracing tracing if result <> 0 then diff --git a/src/app/Fake.DotNet.Paket/Fake.DotNet.Paket.fsproj b/src/app/Fake.DotNet.Paket/Fake.DotNet.Paket.fsproj index 2fb99894579..79da316bfa1 100644 --- a/src/app/Fake.DotNet.Paket/Fake.DotNet.Paket.fsproj +++ b/src/app/Fake.DotNet.Paket/Fake.DotNet.Paket.fsproj @@ -22,9 +22,7 @@ - - true - + \ No newline at end of file diff --git a/src/app/Fake.DotNet.Testing.Expecto/AssemblyInfo.fs b/src/app/Fake.DotNet.Testing.Expecto/AssemblyInfo.fs index 647268e6e47..497c8683ea5 100644 --- a/src/app/Fake.DotNet.Testing.Expecto/AssemblyInfo.fs +++ b/src/app/Fake.DotNet.Testing.Expecto/AssemblyInfo.fs @@ -5,7 +5,7 @@ open System.Reflection [] [] [] -[] +[] [] do () @@ -13,5 +13,5 @@ module internal AssemblyVersionInformation = let [] AssemblyTitle = "FAKE - F# Make Running Expecto test runner" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.DotNet.Testing.Expecto/Fake.DotNet.Testing.Expecto.fsproj b/src/app/Fake.DotNet.Testing.Expecto/Fake.DotNet.Testing.Expecto.fsproj index 7c9595fd0d6..34223c65969 100644 --- a/src/app/Fake.DotNet.Testing.Expecto/Fake.DotNet.Testing.Expecto.fsproj +++ b/src/app/Fake.DotNet.Testing.Expecto/Fake.DotNet.Testing.Expecto.fsproj @@ -21,12 +21,8 @@ - - true - - - true - + + \ No newline at end of file diff --git a/src/app/Fake.DotNet.Testing.MSTest/Fake.DotNet.Testing.MSTest.fsproj b/src/app/Fake.DotNet.Testing.MSTest/Fake.DotNet.Testing.MSTest.fsproj index 9c0324854a6..9d0598e9532 100644 --- a/src/app/Fake.DotNet.Testing.MSTest/Fake.DotNet.Testing.MSTest.fsproj +++ b/src/app/Fake.DotNet.Testing.MSTest/Fake.DotNet.Testing.MSTest.fsproj @@ -21,12 +21,8 @@ - - true - - - true - + + \ No newline at end of file diff --git a/src/app/Fake.DotNet.Testing.MSpec/Fake.DotNet.Testing.MSpec.fsproj b/src/app/Fake.DotNet.Testing.MSpec/Fake.DotNet.Testing.MSpec.fsproj index a1c2ded0120..00d5be55d5f 100644 --- a/src/app/Fake.DotNet.Testing.MSpec/Fake.DotNet.Testing.MSpec.fsproj +++ b/src/app/Fake.DotNet.Testing.MSpec/Fake.DotNet.Testing.MSpec.fsproj @@ -21,12 +21,8 @@ - - true - - - true - + + \ No newline at end of file diff --git a/src/app/Fake.DotNet.Testing.NUnit/Fake.DotNet.Testing.NUnit.fsproj b/src/app/Fake.DotNet.Testing.NUnit/Fake.DotNet.Testing.NUnit.fsproj index 9230e63902a..32c08d40ca6 100644 --- a/src/app/Fake.DotNet.Testing.NUnit/Fake.DotNet.Testing.NUnit.fsproj +++ b/src/app/Fake.DotNet.Testing.NUnit/Fake.DotNet.Testing.NUnit.fsproj @@ -25,12 +25,8 @@ - - true - - - true - + + \ No newline at end of file diff --git a/src/app/Fake.DotNet.Testing.SpecFlow/AssemblyInfo.fs b/src/app/Fake.DotNet.Testing.SpecFlow/AssemblyInfo.fs index 1734f962cd4..969bbbb93ed 100644 --- a/src/app/Fake.DotNet.Testing.SpecFlow/AssemblyInfo.fs +++ b/src/app/Fake.DotNet.Testing.SpecFlow/AssemblyInfo.fs @@ -5,7 +5,7 @@ open System.Reflection [] [] [] -[] +[] [] do () @@ -13,5 +13,5 @@ module internal AssemblyVersionInformation = let [] AssemblyTitle = "FAKE - F# Make BDD with Gherkin and SpecFlow" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.DotNet.Testing.XUnit2/Fake.DotNet.Testing.XUnit2.fsproj b/src/app/Fake.DotNet.Testing.XUnit2/Fake.DotNet.Testing.XUnit2.fsproj index 44c636f4fd3..afa399a134b 100644 --- a/src/app/Fake.DotNet.Testing.XUnit2/Fake.DotNet.Testing.XUnit2.fsproj +++ b/src/app/Fake.DotNet.Testing.XUnit2/Fake.DotNet.Testing.XUnit2.fsproj @@ -21,12 +21,8 @@ - - true - - - true - + + \ No newline at end of file diff --git a/src/app/Fake.DotNet.Xamarin/Xamarin.fs b/src/app/Fake.DotNet.Xamarin/Xamarin.fs index dbcff42ccf4..220738bb225 100644 --- a/src/app/Fake.DotNet.Xamarin/Xamarin.fs +++ b/src/app/Fake.DotNet.Xamarin/Xamarin.fs @@ -300,13 +300,13 @@ let AndroidBuildPackages setParams = rewriteManifestFile manifestFile specificManifest transformVersion target // workaround for xamarin bug: https://bugzilla.xamarin.com/show_bug.cgi?id=30571 let backupFn = (manifestFile |> Path.GetDirectoryName) @@ ("AndroidManifest-original.xml") - Shell.CopyFile backupFn manifestFile - Shell.CopyFile manifestFile specificManifest + Shell.copyFile backupFn manifestFile + Shell.copyFile manifestFile specificManifest try //buildPackages param (Some name) (Some specificManifest) // to uncomment after xamarin fix there bug buildPackages param (Some name) None finally - Shell.CopyFile manifestFile backupFn + Shell.copyFile manifestFile backupFn let translateAbi = function | AndroidAbiTarget.X86 _ -> "x86" diff --git a/src/app/Fake.Installer.InnoSetup/AssemblyInfo.fs b/src/app/Fake.Installer.InnoSetup/AssemblyInfo.fs index f79eabe4372..b1e7a155765 100644 --- a/src/app/Fake.Installer.InnoSetup/AssemblyInfo.fs +++ b/src/app/Fake.Installer.InnoSetup/AssemblyInfo.fs @@ -5,7 +5,7 @@ open System.Reflection [] [] [] -[] +[] [] do () @@ -13,5 +13,5 @@ module internal AssemblyVersionInformation = let [] AssemblyTitle = "FAKE - F# Make Creating installers with InnoSetup" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-rc007" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.Testing.Common/Fake.Testing.Common.fsproj b/src/app/Fake.Testing.Common/Fake.Testing.Common.fsproj index 91b352e6bc2..f150f83b1c3 100644 --- a/src/app/Fake.Testing.Common/Fake.Testing.Common.fsproj +++ b/src/app/Fake.Testing.Common/Fake.Testing.Common.fsproj @@ -1,6 +1,6 @@ - 1.0.0-alpha-10 + 1.0.0 net46;netstandard1.6;netstandard2.0 $(DefineConstants);NO_DOTNETCORE_BOOTSTRAP Fake.Testing.Common @@ -22,9 +22,7 @@ - - true - + - \ No newline at end of file + diff --git a/src/app/Fake.Testing.ReportGenerator/AssemblyInfo.fs b/src/app/Fake.Testing.ReportGenerator/AssemblyInfo.fs index 8f058b53de1..97122e9c08c 100644 --- a/src/app/Fake.Testing.ReportGenerator/AssemblyInfo.fs +++ b/src/app/Fake.Testing.ReportGenerator/AssemblyInfo.fs @@ -5,7 +5,7 @@ open System.Reflection [] [] [] -[] +[] [] do () @@ -13,5 +13,5 @@ module internal AssemblyVersionInformation = let [] AssemblyTitle = "FAKE - F# Make Convert XML coverage output to various formats" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.Tools.Git/CommandHelper.fs b/src/app/Fake.Tools.Git/CommandHelper.fs index 9d175dc41bd..6e6361a84f3 100644 --- a/src/app/Fake.Tools.Git/CommandHelper.fs +++ b/src/app/Fake.Tools.Git/CommandHelper.fs @@ -2,11 +2,7 @@ module Fake.Tools.Git.CommandHelper open System -open System.Diagnostics open System.IO -open System.Threading -open System.Text -open System.Collections.Generic open Fake.Core open Fake.Core.String.Operators open Fake.IO @@ -72,7 +68,7 @@ let gitCommandf repositoryDir fmt = Printf.ksprintf (gitCommand repositoryDir) f /// Runs the given git command, waits for its completion. /// This version doesn't throw an exception if an error occurs. It just traces the error. let showGitCommand repositoryDir command = - let ok,msg,errors = runGitCommand repositoryDir command + let _,msg,errors = runGitCommand repositoryDir command msg |> Seq.iter (Trace.logfn "%s") if errors <> "" then Trace.traceError <| sprintf "Errors: %s" errors @@ -80,7 +76,7 @@ let showGitCommand repositoryDir command = /// Runs the git command and returns the first line of the result. let runSimpleGitCommand repositoryDir command = try - let ok,msg,errors = runGitCommand repositoryDir command + let _,msg,errors = runGitCommand repositoryDir command let errorText = String.toLines msg + Environment.NewLine + errors if errorText.Contains "fatal: " then diff --git a/src/app/Fake.Tools.Git/Fake.Tools.Git.fsproj b/src/app/Fake.Tools.Git/Fake.Tools.Git.fsproj index d9c8ff95446..44af7714cce 100644 --- a/src/app/Fake.Tools.Git/Fake.Tools.Git.fsproj +++ b/src/app/Fake.Tools.Git/Fake.Tools.Git.fsproj @@ -36,9 +36,7 @@ - - true - + \ No newline at end of file diff --git a/src/app/Fake.Tools.Pickles/AssemblyInfo.fs b/src/app/Fake.Tools.Pickles/AssemblyInfo.fs index e1cae8c93b8..adc7efe8371 100644 --- a/src/app/Fake.Tools.Pickles/AssemblyInfo.fs +++ b/src/app/Fake.Tools.Pickles/AssemblyInfo.fs @@ -5,7 +5,7 @@ open System.Reflection [] [] [] -[] +[] [] do () @@ -13,5 +13,5 @@ module internal AssemblyVersionInformation = let [] AssemblyTitle = "FAKE - F# Make Convert Gherkin to HTML" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-rc005" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.Windows.Chocolatey/Fake.Windows.Chocolatey.fsproj b/src/app/Fake.Windows.Chocolatey/Fake.Windows.Chocolatey.fsproj index 075dec1a5af..0b82e17a402 100644 --- a/src/app/Fake.Windows.Chocolatey/Fake.Windows.Chocolatey.fsproj +++ b/src/app/Fake.Windows.Chocolatey/Fake.Windows.Chocolatey.fsproj @@ -22,9 +22,7 @@ - - true - + \ No newline at end of file diff --git a/src/app/Fake.Windows.Registry/AssemblyInfo.fs b/src/app/Fake.Windows.Registry/AssemblyInfo.fs index 904419c9ced..1f524cced0b 100644 --- a/src/app/Fake.Windows.Registry/AssemblyInfo.fs +++ b/src/app/Fake.Windows.Registry/AssemblyInfo.fs @@ -5,7 +5,7 @@ open System.Reflection [] [] [] -[] +[] [] do () @@ -13,5 +13,5 @@ module internal AssemblyVersionInformation = let [] AssemblyTitle = "FAKE - F# CRUD functionality for Windows registry" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.netcore/Fake.netcore.fsproj b/src/app/Fake.netcore/Fake.netcore.fsproj index 0cb01558fc6..742a3056102 100644 --- a/src/app/Fake.netcore/Fake.netcore.fsproj +++ b/src/app/Fake.netcore/Fake.netcore.fsproj @@ -21,15 +21,9 @@ - - true - - - true - - - true - + + + diff --git a/src/app/dotnet-fake/dotnet-fake.fsproj b/src/app/dotnet-fake/dotnet-fake.fsproj index dc0e6c8c44b..480a6ef5efb 100644 --- a/src/app/dotnet-fake/dotnet-fake.fsproj +++ b/src/app/dotnet-fake/dotnet-fake.fsproj @@ -20,12 +20,8 @@ - - true - - - true - + + diff --git a/src/app/fake-cli/fake-cli.fsproj b/src/app/fake-cli/fake-cli.fsproj index 8835669edc2..e60cfa262bc 100644 --- a/src/app/fake-cli/fake-cli.fsproj +++ b/src/app/fake-cli/fake-cli.fsproj @@ -17,12 +17,8 @@ - - true - - - true - + + diff --git a/src/legacy/FAKE/AssemblyInfo.fs b/src/legacy/FAKE/AssemblyInfo.fs index fa4c47c7d3c..a80fe38fe49 100644 --- a/src/legacy/FAKE/AssemblyInfo.fs +++ b/src/legacy/FAKE/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] do () @@ -16,5 +16,5 @@ module internal AssemblyVersionInformation = let [] Guid = "fb2b540f-d97a-4660-972f-5eeff8120fba" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/legacy/Fake.Deploy.Lib/AssemblyInfo.fs b/src/legacy/Fake.Deploy.Lib/AssemblyInfo.fs index 2c2115aaf4b..5e93536c902 100644 --- a/src/legacy/Fake.Deploy.Lib/AssemblyInfo.fs +++ b/src/legacy/Fake.Deploy.Lib/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] do () @@ -16,5 +16,5 @@ module internal AssemblyVersionInformation = let [] Guid = "AA284C42-1396-42CB-BCAC-D27F18D14AC7" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/legacy/Fake.Deploy/AssemblyInfo.fs b/src/legacy/Fake.Deploy/AssemblyInfo.fs index 71e7edd43aa..271ab493301 100644 --- a/src/legacy/Fake.Deploy/AssemblyInfo.fs +++ b/src/legacy/Fake.Deploy/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] do () @@ -16,5 +16,5 @@ module internal AssemblyVersionInformation = let [] Guid = "413E2050-BECC-4FA6-87AA-5A74ACE9B8E1" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/legacy/Fake.Experimental/AssemblyInfo.fs b/src/legacy/Fake.Experimental/AssemblyInfo.fs index a347c1daf0a..11f6cf58acc 100644 --- a/src/legacy/Fake.Experimental/AssemblyInfo.fs +++ b/src/legacy/Fake.Experimental/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] do () @@ -16,5 +16,5 @@ module internal AssemblyVersionInformation = let [] Guid = "5AA28AED-B9D8-4158-A594-32FE5ABC5713" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/legacy/Fake.FluentMigrator/AssemblyInfo.fs b/src/legacy/Fake.FluentMigrator/AssemblyInfo.fs index 7ffdbebdb97..031759534fa 100644 --- a/src/legacy/Fake.FluentMigrator/AssemblyInfo.fs +++ b/src/legacy/Fake.FluentMigrator/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] do () @@ -16,5 +16,5 @@ module internal AssemblyVersionInformation = let [] Guid = "E18BDD6F-1AF8-42BB-AEB6-31CD1AC7E56D" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/legacy/Fake.SQL/AssemblyInfo.fs b/src/legacy/Fake.SQL/AssemblyInfo.fs index 13e402f009b..393f90ab9ad 100644 --- a/src/legacy/Fake.SQL/AssemblyInfo.fs +++ b/src/legacy/Fake.SQL/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] do () @@ -16,5 +16,5 @@ module internal AssemblyVersionInformation = let [] Guid = "A161EAAF-EFDA-4EF2-BD5A-4AD97439F1BE" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/legacy/FakeLib/AssemblyInfo.fs b/src/legacy/FakeLib/AssemblyInfo.fs index 7ea9c621cf9..cf6631ad1da 100644 --- a/src/legacy/FakeLib/AssemblyInfo.fs +++ b/src/legacy/FakeLib/AssemblyInfo.fs @@ -9,7 +9,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] do () @@ -19,5 +19,5 @@ module internal AssemblyVersionInformation = let [] Guid = "d6dd5aec-636d-4354-88d6-d66e094dadb5" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/legacy/FakeLib/FakeLib.fsproj b/src/legacy/FakeLib/FakeLib.fsproj index 9bed927fc95..c3fe72ee94c 100644 --- a/src/legacy/FakeLib/FakeLib.fsproj +++ b/src/legacy/FakeLib/FakeLib.fsproj @@ -63,6 +63,9 @@ Fake.Core.Context/Context.fs + + Fake.Core.FakeVar/FakeVar.fs + Fake.Core.CommandLineParsing/Options.fs diff --git a/src/legacy/deploy.web/Fake.Deploy.Web/AssemblyInfo.fs b/src/legacy/deploy.web/Fake.Deploy.Web/AssemblyInfo.fs index 6847cc67045..2aa4d3080c0 100644 --- a/src/legacy/deploy.web/Fake.Deploy.Web/AssemblyInfo.fs +++ b/src/legacy/deploy.web/Fake.Deploy.Web/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] do () @@ -16,5 +16,5 @@ module internal AssemblyVersionInformation = let [] Guid = "27BA7705-3F57-47BE-B607-8A46B27AE876" let [] AssemblyProduct = "FAKE - F# Make" let [] AssemblyVersion = "5.0.0" - let [] AssemblyInformationalVersion = "5.0.0-beta025" + let [] AssemblyInformationalVersion = "5.0.0.0" let [] AssemblyFileVersion = "5.0.0" diff --git a/src/test/Fake.Core.IntegrationTests/TestHelpers.fs b/src/test/Fake.Core.IntegrationTests/TestHelpers.fs index 01c8b25bbad..06e470e06fa 100644 --- a/src/test/Fake.Core.IntegrationTests/TestHelpers.fs +++ b/src/test/Fake.Core.IntegrationTests/TestHelpers.fs @@ -37,7 +37,7 @@ let prepare scenario = let directFakeInPath command scenarioPath target = let result = - Process.execWithResult (fun (info:Process.ProcStartInfo) -> + Process.execWithResult (fun (info:ProcStartInfo) -> { info with FileName = fakeToolPath WorkingDirectory = scenarioPath @@ -88,4 +88,4 @@ let checkIntellisense scriptName scenario = let fakeRunAndCheck scriptName runArgs scenario = let result = fakeRun runArgs scenario checkIntellisense scriptName scenario - result \ No newline at end of file + result diff --git a/src/test/Fake.Core.UnitTests/Fake.Core.Context.fs b/src/test/Fake.Core.UnitTests/Fake.Core.Context.fs index c427c76c316..3c384017c86 100644 --- a/src/test/Fake.Core.UnitTests/Fake.Core.Context.fs +++ b/src/test/Fake.Core.UnitTests/Fake.Core.Context.fs @@ -1,9 +1,6 @@ module Fake.Core.ContextTests -open System -open Fake.Core open Expecto -open Expecto.Flip [] let tests = @@ -19,5 +16,4 @@ let tests = Fake.Core.Context.forceFakeContext() |> ignore Tests.failtest "Expected exception" with :? System.InvalidOperationException as e -> () - ] diff --git a/src/test/Fake.Core.UnitTests/Fake.Core.FakeVar.fs b/src/test/Fake.Core.UnitTests/Fake.Core.FakeVar.fs new file mode 100644 index 00000000000..75d106967f7 --- /dev/null +++ b/src/test/Fake.Core.UnitTests/Fake.Core.FakeVar.fs @@ -0,0 +1,77 @@ +module Fake.Core.FakeVarTests + +open Fake.Core +open Expecto + +[] +let tests = + testList "Fake.Core.FakeVar.Tests" [ + Fake.ContextHelper.fakeContextTestCase "Ability to set and get fake variables" <| fun _ -> + FakeVar.set "Test" "TestValue" + let value = FakeVar.get "Test" + Expect.isSome value "Variable 'Test' is none" + Expect.equal "TestValue" value.Value "Variable 'Test' is incorrect" + + Fake.ContextHelper.fakeContextTestCase "Ability to remove fake variables after set" <| fun _ -> + FakeVar.set "Test" "TestValue" + FakeVar.remove "Test" + let value = FakeVar.get "Test" + Expect.isNone value "Variable 'Test' is some" + + Fake.ContextHelper.fakeContextTestCase "When type does not match, errors" <| fun _ -> + FakeVar.set "Test" "TestValue" + try + FakeVar.get "Test" |> ignore + Tests.failtest "Expected exception" + with e -> + Expect.equal "Cast error on variable 'Test'" e.Message "Incorrect failure message for variable failure case" + + Fake.ContextHelper.fakeContextTestCase "Ability to set and get fake variables with default - when found" <| fun _ -> + FakeVar.set "Test" "TestValue" + let value = FakeVar.getOrDefault "Test" "DefaultValue" + Expect.equal "TestValue" value "Variable 'Test' is incorrect" + + Fake.ContextHelper.fakeContextTestCase "Ability to set and get fake variables with default - when not found" <| fun _ -> + let value = FakeVar.getOrDefault "Test" "DefaultValue" + Expect.equal "DefaultValue" value "Variable 'Test' is not the default" + + Fake.ContextHelper.fakeContextTestCase "Ability to set and get fake variables with failure - when found" <| fun _ -> + FakeVar.set "Test" "TestValue" + let value = FakeVar.getOrFail "Test" + Expect.equal "TestValue" value "Variable 'Test' is incorrect" + + Fake.ContextHelper.fakeContextTestCase "Ability to set and get fake variables with failure - when not found" <| fun _ -> + try + FakeVar.getOrFail "Test" |> ignore + Tests.failtest "Expected exception" + with e -> + Expect.equal "Unable to find variable 'Test'" e.Message "Incorrect failure message for variable failure case" + + Fake.ContextHelper.fakeContextTestCase "Ability to define variable" <| fun _ -> + let myGet, _, mySet = FakeVar.define "Test" + mySet "TestValue" + let value = myGet() + Expect.isSome value "Variable 'Test' is none" + Expect.equal "TestValue" value.Value "Variable 'Test' is incorrect" + + Fake.ContextHelper.fakeContextTestCase "Ability to define variable allowing non context" <| fun _ -> + let myGet, _, mySet = FakeVar.defineAllowNoContext "Test" + mySet "TestValue" + let value = myGet() + Expect.isSome value "Variable 'Test' is none" + Expect.equal "TestValue" value.Value "Variable 'Test' is incorrect" + + testCase "Ability to define variable with no context" <| fun _ -> + let myGet, _, mySet = FakeVar.defineAllowNoContext "Test" + mySet "TestValue" + let value = myGet() + Expect.isSome value "Variable 'Test' is none" + Expect.equal "TestValue" value.Value "Variable 'Test' is incorrect" + + testCase "Ability to define variable with no context when context required" <| fun _ -> + try + let _, _, _ = FakeVar.define "Test" + Tests.failtest "Expected exception" + with e -> + Expect.equal "Cannot define variable 'Test' without context" e.Message "Incorrect failure message for variable failure case" + ] diff --git a/src/test/Fake.Core.UnitTests/Fake.Core.Process.fs b/src/test/Fake.Core.UnitTests/Fake.Core.Process.fs index b4349afcf90..5e5b0d73fca 100644 --- a/src/test/Fake.Core.UnitTests/Fake.Core.Process.fs +++ b/src/test/Fake.Core.UnitTests/Fake.Core.Process.fs @@ -4,8 +4,6 @@ module Fake.Core.ProcessTests open System open Fake.Core open Expecto -open Expecto.Flip - [] let tests = @@ -17,10 +15,10 @@ let tests = FileName = "FileDoesntExist.exe" Arguments = "arg1 arg2" }) |> ignore - Expect.isTrue "Expected an exception" false + Expect.isTrue false "Expected an exception" with e -> let s = e.Message.Contains "FileDoesntExist.exe" - Expect.isTrue ("Expected file-path as part of the message '" + e.Message + "'") s + Expect.isTrue s ("Expected file-path as part of the message '" + e.Message + "'") testCase "Test that we can read messages correctly" <| fun _ -> let shell, command = @@ -34,6 +32,6 @@ let tests = FileName = shell Arguments = command }) (TimeSpan.FromMinutes 1.) - Expect.equal "Messages are not read correctly" ["1"; "2"] result.Messages + Expect.equal ["1"; "2"] result.Messages "Messages are not read correctly" - ] \ No newline at end of file + ] diff --git a/src/test/Fake.Core.UnitTests/Fake.Core.ReleaseNotes.fs b/src/test/Fake.Core.UnitTests/Fake.Core.ReleaseNotes.fs index b676a18c55b..bd2b18eafdb 100644 --- a/src/test/Fake.Core.UnitTests/Fake.Core.ReleaseNotes.fs +++ b/src/test/Fake.Core.UnitTests/Fake.Core.ReleaseNotes.fs @@ -1,9 +1,7 @@ - module Fake.Core.ReleaseNotesTests open Fake.Core open Expecto -open Expecto.Flip [] @@ -20,7 +18,7 @@ let tests = // For historic reasons notes get appended a "." { AssemblyVersion = "1.1.0"; NugetVersion = "1.1.0"; SemVer = SemVer.parse "1.1.0"; Date = None; Notes = ["First change."] } - Expect.equal "Simple parse failure" expected releaseNotes + Expect.equal expected releaseNotes "Simple parse failure" testCase "Test that we can parse simple release notes (reversed)" <| fun _ -> let releaseNotesLines = [ @@ -33,7 +31,7 @@ let tests = // For historic reasons notes get appended a "." { AssemblyVersion = "1.1.0"; NugetVersion = "1.1.0"; SemVer = SemVer.parse "1.1.0"; Date = None; Notes = ["First change."] } - Expect.equal "Simple parse failure" expected releaseNotes + Expect.equal expected releaseNotes "Simple parse failure" testCase "Test that we can parse complex release notes" <| fun _ -> let releaseNotesLines = [ @@ -50,7 +48,7 @@ let tests = let (expected:ReleaseNotes.ReleaseNotes) = { AssemblyVersion = "1.1.0"; NugetVersion = "1.1.0"; SemVer = SemVer.parse "1.1.0"; Date = Some (System.DateTime(2017,04,12)); Notes = ["- Some change 3"; "- Some change 4"] } - Expect.equal "Simple parse failure" expected releaseNotes + Expect.equal expected releaseNotes "Simple parse failure" testCase "Test that we can parse complex release notes (reversed)" <| fun _ -> let releaseNotesLines = [ @@ -68,7 +66,7 @@ let tests = let (expected:ReleaseNotes.ReleaseNotes) = { AssemblyVersion = "1.1.0"; NugetVersion = "1.1.0"; SemVer = SemVer.parse "1.1.0"; Date = Some (System.DateTime(2017,04,12)); Notes = ["- Some change 3"; "- Some change 4"] } - Expect.equal "Simple parse failure" expected releaseNotes + Expect.equal expected releaseNotes "Simple parse failure" testCase "Test that we can parse complex release notes with header" <| fun _ -> let releaseNotesLines = [ @@ -87,5 +85,5 @@ let tests = let (expected:ReleaseNotes.ReleaseNotes) = { AssemblyVersion = "1.1.0"; NugetVersion = "1.1.0"; SemVer = SemVer.parse "1.1.0"; Date = Some (System.DateTime(2017,04,12)); Notes = ["- Some change 3"; "- Some change 4"] } - Expect.equal "Simple parse failure" expected releaseNotes - ] \ No newline at end of file + Expect.equal expected releaseNotes "Simple parse failure" + ] diff --git a/src/test/Fake.Core.UnitTests/Fake.Core.Target.fs b/src/test/Fake.Core.UnitTests/Fake.Core.Target.fs index 14aba96befc..a687da25745 100644 --- a/src/test/Fake.Core.UnitTests/Fake.Core.Target.fs +++ b/src/test/Fake.Core.UnitTests/Fake.Core.Target.fs @@ -2,7 +2,6 @@ module Fake.Core.TargetTests open Fake.Core open Expecto -open Expecto.Flip let run targetName = try Target.runAndGetContext 1 targetName [] @@ -58,7 +57,7 @@ let tests = // as expected () | _ -> - Expect.isTrue (sprintf "inconsistent order: %A" order) false + Expect.isTrue false (sprintf "inconsistent order: %A" order) Fake.ContextHelper.fakeContextTestCase "issue #1395 example" <| fun _ -> Target.create "T1" DoNothing @@ -450,8 +449,8 @@ let tests = "Dependency" ==> "SimpleTest" |> ignore let context = run "SimpleTest" - Expect.equal "Expected both tasks to succeed" false context.HasError - Expect.equal "Expected context to contain both targets" 2 context.PreviousTargets.Length + Expect.equal false context.HasError "Expected both tasks to succeed" + Expect.equal 2 context.PreviousTargets.Length "Expected context to contain both targets" Fake.ContextHelper.fakeContextTestCase "Test we output targets after failing targets" <| fun _ -> Target.create "SimpleTest" ignore @@ -459,8 +458,8 @@ let tests = "Dependency" ==> "SimpleTest" |> ignore let context = run "SimpleTest" - Expect.equal "Expected failure" true context.HasError - Expect.equal "Expected context to contain both targets" 2 context.PreviousTargets.Length // second one as "skipped" + Expect.equal true context.HasError "Expected failure" + Expect.equal 2 context.PreviousTargets.Length "Expected context to contain both targets" // second one as "skipped" ] @ ( [ @@ -477,9 +476,9 @@ let tests = context.PreviousTargets |> List.map (fun tr -> tr.Target.Name) let expectedOrder = ["a";"b";"c"] - Expect.equal "Expected context to contain 3 targets" 3 context.PreviousTargets.Length - Expect.equal "Expected context to contain 3 targets in right order" expectedOrder actualOrder - Expect.equal "Expected final target to not run" 0 finalTargetResult + Expect.equal 3 context.PreviousTargets.Length "Expected context to contain 3 targets" + Expect.equal expectedOrder actualOrder "Expected context to contain 3 targets in right order" + Expect.equal 0 finalTargetResult "Expected final target to not run" testCaseMultipleRuns "Final targets run after all targets" <| fun myRun _ -> Target.create "a" DoNothing @@ -496,9 +495,9 @@ let tests = context.PreviousTargets |> List.map (fun tr -> tr.Target.Name) let expectedOrder = ["a";"b";"c";"Final";"Final2"] - Expect.equal "Expected context to contain 5 targets" 5 context.PreviousTargets.Length - Expect.equal "Expected context to contain 5 targets in right order" expectedOrder actualOrder - Expect.equal "Expected final targets to run" 2 finalTargetResult + Expect.equal 5 context.PreviousTargets.Length "Expected context to contain 5 targets" + Expect.equal expectedOrder actualOrder "Expected context to contain 5 targets in right order" + Expect.equal 2 finalTargetResult "Expected final targets to run" testCaseMultipleRuns "BuildFailure targets do not run if nothing fails" <| fun myRun _ -> Target.create "a" ignore @@ -513,9 +512,9 @@ let tests = context.PreviousTargets |> List.map (fun tr -> tr.Target.Name) let expectedOrder = ["a";"b";"c"] - Expect.equal "Expected context to contain 3 targets" 3 context.PreviousTargets.Length - Expect.equal "Expected context to contain 3 targets in right order" expectedOrder actualOrder - Expect.equal "Expected buildFailure target to not run" 0 failureTargetResult + Expect.equal 3 context.PreviousTargets.Length "Expected context to contain 3 targets" + Expect.equal expectedOrder actualOrder "Expected context to contain 3 targets in right order" + Expect.equal 0 failureTargetResult "Expected buildFailure target to not run" testCaseMultipleRuns "BuildFailure targets do not run if not activated" <| fun myRun _ -> Target.create "a" ignore @@ -530,9 +529,9 @@ let tests = context.PreviousTargets |> List.map (fun tr -> tr.Target.Name) let expectedOrder = ["a";"b";"c"] - Expect.equal "Expected context to contain 3 targets" 3 context.PreviousTargets.Length - Expect.equal "Expected context to contain 3 targets in right order" expectedOrder actualOrder - Expect.equal "Expected buildFailure target to not run" 0 failureTargetResult + Expect.equal 3 context.PreviousTargets.Length "Expected context to contain 3 targets" + Expect.equal expectedOrder actualOrder "Expected context to contain 3 targets in right order" + Expect.equal 0 failureTargetResult "Expected buildFailure target to not run" testCaseMultipleRuns "BuildFailure targets run after failing targets" <| fun myRun _ -> Target.create "a" DoNothing @@ -555,14 +554,13 @@ let tests = let cResult = context.PreviousTargets |> List.find (fun tr -> tr.Target.Name="c") - Expect.equal "Expected failure" true context.HasError - Expect.equal "Expected second target to skip after failure" true context.HasError - Expect.equal "Expected context to contain 5 targets" 5 context.PreviousTargets.Length - Expect.equal "Expected context to contain 5 targets in right order" expectedOrder actualOrder - Expect.isSome "Expected target b to error" bResult.Error - Expect.isTrue "Expected target c to skip" cResult.WasSkipped - Expect.equal "Expected buildFailure targets to run" 2 failureTargetResult - + Expect.equal true context.HasError "Expected failure" + Expect.equal true context.HasError "Expected second target to skip after failure" + Expect.equal 5 context.PreviousTargets.Length "Expected context to contain 5 targets" + Expect.equal expectedOrder actualOrder "Expected context to contain 5 targets in right order" + Expect.isSome bResult.Error "Expected target b to error" + Expect.isTrue cResult.WasSkipped "Expected target c to skip" + Expect.equal 2 failureTargetResult "Expected buildFailure targets to run" testCaseMultipleRuns "Final targets run after failing targets" <| fun myRun _ -> Target.create "a" DoNothing @@ -585,11 +583,11 @@ let tests = let cResult = context.PreviousTargets |> List.find (fun tr -> tr.Target.Name="c") - Expect.equal "Expected failure" true context.HasError - Expect.equal "Expected second target to skip after failure" true context.HasError - Expect.equal "Expected context to contain 5 targets" 5 context.PreviousTargets.Length - Expect.equal "Expected context to contain 5 targets in right order" expectedOrder actualOrder - Expect.isSome "Expected target b to error" bResult.Error - Expect.isTrue "Expected target c to skip" cResult.WasSkipped - Expect.equal "Expected final targets to run" 2 finalTargetResult + Expect.equal true context.HasError "Expected failure" + Expect.equal true context.HasError "Expected second target to skip after failure" + Expect.equal 5 context.PreviousTargets.Length "Expected context to contain 5 targets" + Expect.equal expectedOrder actualOrder "Expected context to contain 5 targets in right order" + Expect.isSome bResult.Error "Expected target b to error" + Expect.isTrue cResult.WasSkipped "Expected target c to skip" + Expect.equal 2 finalTargetResult "Expected final targets to run" ] |> List.concat)) diff --git a/src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj b/src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj index e8ccd40be42..5497572b258 100644 --- a/src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj +++ b/src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj @@ -10,6 +10,7 @@ + @@ -31,6 +32,7 @@ + diff --git a/src/test/Fake.Core.UnitTests/Fake.Core.Xml.fs b/src/test/Fake.Core.UnitTests/Fake.Core.Xml.fs index 7aba4568d67..6e8903215c4 100644 --- a/src/test/Fake.Core.UnitTests/Fake.Core.Xml.fs +++ b/src/test/Fake.Core.UnitTests/Fake.Core.Xml.fs @@ -2,9 +2,7 @@ module Fake.Core.XmlTests open System.IO open Fake.Core -open Fake.DotNet open Expecto -open Expecto.Flip let normalize (s:string) = s.Replace("\r", "") @@ -34,7 +32,7 @@ let tests = let bundleIdentifier = "whateva" Xml.pokeInnerText tmpFile "plist/dict/key[text()='CFBundleIdentifier']/following-sibling::string" bundleIdentifier let actual = File.ReadAllText tmpFile |> normalize - Expect.equal "expected same xml" expected actual + Expect.equal expected actual "expected same xml" finally File.Delete(tmpFile) ] diff --git a/src/test/Fake.Core.UnitTests/Fake.IO.Globbing.fs b/src/test/Fake.Core.UnitTests/Fake.IO.Globbing.fs index 7542f2bf030..6e14de208c9 100644 --- a/src/test/Fake.Core.UnitTests/Fake.IO.Globbing.fs +++ b/src/test/Fake.Core.UnitTests/Fake.IO.Globbing.fs @@ -1,16 +1,12 @@ module Fake.Core.GlobbingTests open System.IO -open Fake.Core open Fake.IO open Fake.IO.Globbing open Fake.IO.FileSystemOperators open Fake.IO.Globbing.Operators open Expecto -open Expecto.Flip -open System.ComponentModel -open System.ComponentModel -open System.IO + let getFileIncludeWithKnownBaseDir includes : LazyGlobbingPattern= { Fake.IO.Globbing.LazyGlobbingPattern.BaseDirectory = @"C:\Project" Fake.IO.Globbing.LazyGlobbingPattern.Includes = includes @@ -27,20 +23,20 @@ let tests = Fake.IO.Globbing.ResolvedGlobbingPattern.Results = [ "folder/file1.exe" "folder/file2.exe" ] } - Expect.equal "Glob should match relative paths" true (globExe.IsMatch "folder/test.exe") - Expect.equal "Glob should match full paths" true (globExe.IsMatch (Path.GetFullPath "folder/test.exe")) + Expect.equal true (globExe.IsMatch "folder/test.exe") "Glob should match relative paths" + Expect.equal true (globExe.IsMatch (Path.GetFullPath "folder/test.exe")) "Glob should match full paths" testCase "It should resolve multiple directories" <| fun _ -> let fileIncludes = getFileIncludeWithKnownBaseDir [@"test1\bin\*.dll"; @"test2\bin\*.dll"] let dirIncludes = GlobbingPattern.getBaseDirectoryIncludes(fileIncludes) - Expect.equal "Should have 2 dirs" dirIncludes.Length 2 - Expect.contains "Should contain first folder" (Glob.normalizePath(@"C:\Project\test1\bin")) dirIncludes - Expect.contains "Should contain second folder" (Glob.normalizePath(@"C:\Project\test2\bin")) dirIncludes + Expect.equal dirIncludes.Length 2 "Should have 2 dirs" + Expect.contains dirIncludes (Glob.normalizePath(@"C:\Project\test1\bin")) "Should contain first folder" + Expect.contains dirIncludes (Glob.normalizePath(@"C:\Project\test2\bin")) "Should contain second folder" testCase "should only take the most root path when multiple directories share a root" <| fun _ -> let fileIncludes = getFileIncludeWithKnownBaseDir [@"tests\**\test1\bin\*.dll"; @"tests\test2\bin\*.dll"] let dirIncludes = GlobbingPattern.getBaseDirectoryIncludes(fileIncludes) - Expect.equal "Should have only 1 directory" dirIncludes.Length 1 - Expect.contains "Should contain tests folder" (Glob.normalizePath(@"C:\Project\tests")) dirIncludes + Expect.equal dirIncludes.Length 1 "Should have only 1 directory" + Expect.contains dirIncludes (Glob.normalizePath(@"C:\Project\tests")) "Should contain tests folder" testCase "glob should handle substring directories properly" <| fun _ -> let testDir = Path.GetTempFileName() @@ -60,7 +56,7 @@ let tests = |> Seq.map (fun f -> Path.GetFileName f) |> Seq.sort |> Seq.toList - |> Expect.equal "Expected equal lists." ["match1.txt"; "match2.txt"; "match3.txt"] + |> Flip.Expect.equal "Expected equal lists." ["match1.txt"; "match2.txt"; "match3.txt"] finally Directory.Delete(testDir, true) ] diff --git a/src/test/Fake.Core.UnitTests/Fake.IO.Zip.fs b/src/test/Fake.Core.UnitTests/Fake.IO.Zip.fs index 03995a15e0d..b74aff015c8 100644 --- a/src/test/Fake.Core.UnitTests/Fake.IO.Zip.fs +++ b/src/test/Fake.Core.UnitTests/Fake.IO.Zip.fs @@ -1,6 +1,5 @@ module Fake.IO.ZipTests -open Fake.Core open Fake.IO open Fake.IO.FileSystemOperators open Expecto @@ -46,4 +45,4 @@ let tests = @"subfolder/1/file2.dll", @"1""file2.dll" @"subfolder/2/file2.dll", @"2""file2.dll" ] Expect.equal actual expected "FilesAsSpecs failed." - ] \ No newline at end of file + ] diff --git a/src/test/Fake.Core.UnitTests/Fake.Runtime.fs b/src/test/Fake.Core.UnitTests/Fake.Runtime.fs index b3e4c5b2ff4..4841f8166d5 100644 --- a/src/test/Fake.Core.UnitTests/Fake.Runtime.fs +++ b/src/test/Fake.Core.UnitTests/Fake.Runtime.fs @@ -4,7 +4,6 @@ open System.IO open Fake.Runtime open Fake.IO.FileSystemOperators open Expecto -open Expecto.Flip open Fake.IO [] @@ -12,16 +11,16 @@ let tests = testList "Fake.Runtime.Tests" [ testCase "Test that cache helpers work" <| fun _ -> Path.fixPathForCache "build.fsx" "build.fsx" - |> Expect.equal "should detect script itself" "scriptpath:///build.fsx" + |> Flip.Expect.equal "should detect script itself" "scriptpath:///build.fsx" Path.readPathFromCache "build.fsx" "scriptpath:///build.fsx" - |> Expect.equal "should detect script itself" (Path.GetFullPath "build.fsx") + |> Flip.Expect.equal "should detect script itself" (Path.GetFullPath "build.fsx") testCase "Test that cache helpers work for nuget cache" <| fun _ -> let nugetLib = Paket.Constants.UserNuGetPackagesFolder "MyLib" "lib" "mylib.dll" Path.fixPathForCache "build.fsx" nugetLib - |> Expect.equal "should detect script itself" "nugetcache:///MyLib/lib/mylib.dll" + |> Flip.Expect.equal "should detect script itself" "nugetcache:///MyLib/lib/mylib.dll" Path.readPathFromCache "build.fsx" "nugetcache:///MyLib/lib/mylib.dll" - |> Expect.equal "should detect script itself" nugetLib + |> Flip.Expect.equal "should detect script itself" nugetLib testCase "Test that we can properly find type names when the file name contains '.'" <| fun _ -> // Add test if everything works with __SOURCE_FILE__ @@ -31,13 +30,13 @@ let tests = "build.test1.test2.fsx" Expect.equal - "Expected to have correct full type name" ".$Build.test1.test2$fsx" name + "Expected to have correct full type name" testCase "Test that we can tokenize __SOURCE_FILE__" <| fun _ -> // Add test if everything works with __SOURCE_FILE__ - Expect.equal "." "" "" + Expect.equal "" "" "." // Add test if everything works with #ifdefed #r "paket: line" testCase "Test that we find the correct references" <| fun _ -> @@ -52,7 +51,7 @@ nuget Fake.Core.SemVer prerelease //" |> Fake.Runtime.FSharpParser.findInterestingItems let expected = [Fake.Runtime.FSharpParser.InterestingItem.Reference (sprintf "paket:\nnuget Fake.Core.SemVer prerelease //") ] - Expect.equal "Expected to find reference." expected interesting + Expect.equal expected interesting "Expected to find reference." // Add test if everything works with #ifdefed #r "paket: line" testCase "Test that we find the correct references without defines" <| fun _ -> @@ -66,7 +65,7 @@ nuget Fake.Core.SemVer prerelease //" Fake.Runtime.FSharpParser.getTokenized "testfile.fsx" ["DOTNETCORE"; "FAKE"] (scriptText.Split([|'\r';'\n'|])) |> Fake.Runtime.FSharpParser.findInterestingItems let expected = [] - Expect.equal "Expected to find reference." expected interesting + Expect.equal expected interesting "Expected to find reference." // TODO: Add test if everything works with #ifdefed #r "paket: line" @@ -97,7 +96,7 @@ nuget Fake.Core.SemVer prerelease //" tmpDir "paket-files" "test" "octokit.fsx" ] let actual = scripts |> List.map (fun s -> s.Location) - Expect.equal "Expected to find script." expected actual + Expect.equal expected actual "Expected to find script." finally Directory.Delete(tmpDir, true) @@ -133,7 +132,7 @@ printfn "other.fsx" otherScriptPath ] let actual = scripts |> List.map (fun s -> s.Location) - Expect.equal "Expected to find script." expected actual + Expect.equal expected actual "Expected to find script." finally Directory.Delete(tmpDir, true) @@ -150,10 +149,10 @@ printfn "other.fsx" Fake.Runtime.FSharpParser.getTokenized "test.fsx" ["DOTNETCORE"; "FAKE"] (testScript.Split([|'\r';'\n'|])) try let scripts = HashGeneration.getAllScripts [] tokens testScriptPath - Expect.isTrue "Expected an exception" false + Expect.isTrue false "Expected an exception" with e -> (e.Message.Contains "test.fsx(2,1): error FS2302: Directory '" && e.Message.Contains "' doesn't exist") - |> Expect.isTrue (sprintf "Expected a good error message, but got: %s" e.Message) + |> Flip.Expect.isTrue (sprintf "Expected a good error message, but got: %s" e.Message) finally Directory.Delete(tmpDir, true) ]