diff --git a/.editorconfig b/.editorconfig index 63a3c0f..acce62b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,7 +2,6 @@ indent_size=2 max_line_length=90 insert_final_newline=false -fsharp_semicolon_at_end_of_line=false fsharp_space_before_parameter=true fsharp_space_before_lowercase_invocation=true fsharp_space_before_uppercase_invocation=false @@ -12,12 +11,9 @@ fsharp_space_before_colon=false fsharp_space_after_comma=true fsharp_space_before_semicolon=false fsharp_space_after_semicolon=true -fsharp_indent_on_try_with=false fsharp_space_around_delimiter=true fsharp_max_if_then_else_short_width=40 fsharp_max_infix_operator_expression=50 -fsharp_max_newline_infix_operator_expression_number_of_items=1 -fsharp_multiline_infix_multiline_formatter=character_width fsharp_max_record_width=40 fsharp_max_record_number_of_items=1 fsharp_record_multiline_formatter=character_width @@ -26,14 +22,7 @@ fsharp_max_array_or_list_number_of_items=1 fsharp_array_or_list_multiline_formatter=character_width fsharp_max_value_binding_width=40 fsharp_max_function_binding_width=40 -fsharp_max_dot_get_expression_width=50 -fsharp_multiline_block_brackets_on_same_column=false fsharp_newline_between_type_definition_and_members=false -fsharp_keep_if_then_in_same_line=false -fsharp_max_elmish_width=40 -fsharp_single_argument_web_mode=false fsharp_align_function_signature_to_indentation=false fsharp_alternative_long_member_definitions=false -fsharp_disable_elmish_syntax=false -fsharp_multi_line_lambda_closing_newline=false -fsharp_strict_mode=false \ No newline at end of file +fsharp_multi_line_lambda_closing_newline=false \ No newline at end of file diff --git a/AltCode.Fake.Tests/AltCode.Fake.DotNet.Gendarme.fs b/AltCode.Fake.Tests/AltCode.Fake.DotNet.Gendarme.fs index 4090016..086219f 100644 --- a/AltCode.Fake.Tests/AltCode.Fake.DotNet.Gendarme.fs +++ b/AltCode.Fake.Tests/AltCode.Fake.DotNet.Gendarme.fs @@ -12,7 +12,8 @@ open Expecto.ExpectoFsCheck let serializingObject = Object() let testCases = - [ testCase "Test that default arguments are processed as expected" + [ + testCase "Test that default arguments are processed as expected" <| fun _ -> let p = Gendarme.Params.Create() let args = Gendarme.composeCommandLine p @@ -20,11 +21,13 @@ let testCases = Expect.equal args - [ "--console" + [ + "--console" "--severity" "medium+" "--confidence" - "normal+" ] + "normal+" + ] "The defaults should be simple" testCase "Test that string arguments are processed as expected" <| fun _ -> @@ -33,12 +36,16 @@ let testCases = let log = Guid.NewGuid().ToString() let ignore = - [ Guid.NewGuid().ToString() - Guid.NewGuid().ToString() ] + [ + Guid.NewGuid().ToString() + Guid.NewGuid().ToString() + ] let targets = - [ Guid.NewGuid().ToString() - Guid.NewGuid().ToString() ] + [ + Guid.NewGuid().ToString() + Guid.NewGuid().ToString() + ] let p = { Gendarme.Params.Create() with @@ -46,121 +53,141 @@ let testCases = RuleSet = rules Log = log Ignore = ignore - Targets = targets } + Targets = targets + } let args = Gendarme.composeCommandLine p Expect.equal args - ([ "--config" - config - "--set" - rules - "--html" - log - "--ignore" - ignore |> Seq.head - "--ignore" - ignore |> Seq.last - "--console" - "--severity" - "medium+" - "--confidence" - "normal+" ] + ([ + "--config" + config + "--set" + rules + "--html" + log + "--ignore" + ignore |> Seq.head + "--ignore" + ignore |> Seq.last + "--console" + "--severity" + "medium+" + "--confidence" + "normal+" + ] @ targets) "The defaults should be simple" testCase "Test that log-kind arguments are processed as expected" <| fun _ -> - [ (Guid.NewGuid().ToString(), Gendarme.LogKind.Text, "--log") + [ + (Guid.NewGuid().ToString(), Gendarme.LogKind.Text, "--log") (Guid.NewGuid().ToString(), Gendarme.LogKind.Html, "--html") - (Guid.NewGuid().ToString(), Gendarme.LogKind.Xml, "--xml") ] + (Guid.NewGuid().ToString(), Gendarme.LogKind.Xml, "--xml") + ] |> Seq.iter (fun (log, kind, name) -> let p = { Gendarme.Params.Create() with Log = log - LogKind = kind } + LogKind = kind + } let args = Gendarme.composeCommandLine p Expect.equal args - [ name + [ + name log "--console" "--severity" "medium+" "--confidence" - "normal+" ] + "normal+" + ] ("The log kind should be " + name)) testCase "Test that limit arguments are processed as expected" <| fun _ -> let p = { Gendarme.Params.Create() with - Limit = uint8 (23 + DateTime.Now.Second) } + Limit = uint8 (23 + DateTime.Now.Second) + } let args = Gendarme.composeCommandLine p Expect.equal args - [ "--limit" + [ + "--limit" (sprintf "%A" p.Limit).Replace("uy", String.Empty) "--console" "--severity" "medium+" "--confidence" - "normal+" ] + "normal+" + ] (sprintf "The limit should be %A" p.Limit) testCase "Test that console may be switched off" <| fun _ -> let p = { Gendarme.Params.Create() with - Console = false } + Console = false + } let args = Gendarme.composeCommandLine p Expect.equal args - [ "--severity" + [ + "--severity" "medium+" "--confidence" - "normal+" ] + "normal+" + ] "The console should be gone" testCase "Test that output may be hushed" <| fun _ -> let p = { Gendarme.Params.Create() with - Quiet = true } + Quiet = true + } let args = Gendarme.composeCommandLine p Expect.equal args - [ "--console" + [ + "--console" "--quiet" "--severity" "medium+" "--confidence" - "normal+" ] + "normal+" + ] "The output should be quieted" testProperty "Test that verbosity may be set" <| fun (x: uint8) -> let p = { Gendarme.Params.Create() with - Verbosity = x } + Verbosity = x + } let args = Gendarme.composeCommandLine p Expect.equal args - ([ "--console" - "--severity" - "medium+" - "--confidence" - "normal+" ] + ([ + "--console" + "--severity" + "medium+" + "--confidence" + "normal+" + ] @ (Seq.initInfinite (fun _ -> "--v") |> Seq.take (int x) |> Seq.toList)) @@ -168,7 +195,8 @@ let testCases = testCase "Test that severity may be set" <| fun _ -> - [ Gendarme.Severity.All, "all" + [ + Gendarme.Severity.All, "all" Gendarme.Severity.Audit Gendarme.Grade.Plus, "audit+" Gendarme.Severity.Audit Gendarme.Grade.Neutral, "audit" Gendarme.Severity.Audit Gendarme.Grade.Minus, "audit-" @@ -183,26 +211,31 @@ let testCases = Gendarme.Severity.High Gendarme.Grade.Minus, "high-" Gendarme.Severity.Critical Gendarme.Grade.Plus, "critical+" Gendarme.Severity.Critical Gendarme.Grade.Neutral, "critical" - Gendarme.Severity.Critical Gendarme.Grade.Minus, "critical-" ] + Gendarme.Severity.Critical Gendarme.Grade.Minus, "critical-" + ] |> List.iter (fun (s, m) -> let p = { Gendarme.Params.Create() with - Severity = s } + Severity = s + } let args = Gendarme.composeCommandLine p Expect.equal args - [ "--console" + [ + "--console" "--severity" m "--confidence" - "normal+" ] + "normal+" + ] ("The severity should be " + m)) testCase "Test that confidence may be set" <| fun _ -> - [ Gendarme.Confidence.All, "all" + [ + Gendarme.Confidence.All, "all" Gendarme.Confidence.Low Gendarme.Grade.Plus, "low+" Gendarme.Confidence.Low Gendarme.Grade.Neutral, "low" Gendarme.Confidence.Low Gendarme.Grade.Minus, "low-" @@ -214,21 +247,25 @@ let testCases = Gendarme.Confidence.High Gendarme.Grade.Minus, "high-" Gendarme.Confidence.Total Gendarme.Grade.Plus, "total+" Gendarme.Confidence.Total Gendarme.Grade.Neutral, "total" - Gendarme.Confidence.Total Gendarme.Grade.Minus, "total-" ] + Gendarme.Confidence.Total Gendarme.Grade.Minus, "total-" + ] |> List.iter (fun (c, m) -> let p = { Gendarme.Params.Create() with - Confidence = c } + Confidence = c + } let args = Gendarme.composeCommandLine p Expect.equal args - [ "--console" + [ + "--console" "--severity" "medium+" "--confidence" - m ] + m + ] ("The severity should be " + m)) testCase "Test that command arguments are processed as expected" @@ -260,7 +297,8 @@ let testCases = { Gendarme.Params.Create() with ToolPath = fake ToolType = - Fake.DotNet.ToolType.CreateFullFramework().WithDefaultToolCommandName fake } + Fake.DotNet.ToolType.CreateFullFramework().WithDefaultToolCommandName fake + } let args = Gendarme.composeCommandLine p let proc = Gendarme.createProcess args p @@ -277,7 +315,8 @@ let testCases = let p = { Gendarme.Params.Create() with - WorkingDirectory = fake } + WorkingDirectory = fake + } let args = Gendarme.composeCommandLine p let proc = Gendarme.createProcess args p @@ -298,7 +337,8 @@ let testCases = ToolPath = fake ToolType = Fake.DotNet.ToolType.CreateFullFramework().WithDefaultToolCommandName fake - Targets = [ fake ] } + Targets = [ fake ] + } Expect.equal (Gendarme.run args) () "Should be silent" @@ -317,7 +357,8 @@ let testCases = ToolType = Fake.DotNet.ToolType.CreateFullFramework().WithDefaultToolCommandName fake Targets = [ fake + ".nonesuch" ] - FailBuildOnDefect = false } + FailBuildOnDefect = false + } Expect.equal (Gendarme.run args) () "Should be silent" @@ -347,7 +388,8 @@ let testCases = ToolPath = fake ToolType = Fake.DotNet.ToolType.CreateFullFramework().WithDefaultToolCommandName fake - Targets = [ fake + ".nonesuch" ] } + Targets = [ fake + ".nonesuch" ] + } Expect.throwsC (fun () -> Gendarme.run args) (fun ex -> Expect.equal @@ -370,18 +412,22 @@ let testCases = RuleSet = null Log = null Ignore = null - Targets = null } + Targets = null + } let args = Gendarme.composeCommandLine p Expect.equal args - [ "--console" + [ + "--console" "--severity" "medium+" "--confidence" - "normal+" ] - "The defaults should be simple" ] + "normal+" + ] + "The defaults should be simple" + ] [] let tests = diff --git a/Build/Gendarme.fs b/Build/Gendarme.fs index 2a87464..944236c 100644 --- a/Build/Gendarme.fs +++ b/Build/Gendarme.fs @@ -87,7 +87,8 @@ type Params = /// Default parameters. static member Create() = - { ToolPath = "gendarme" + { + ToolPath = "gendarme" ToolType = Fake.DotNet.ToolType.CreateGlobalTool().WithDefaultToolCommandName("gendarme") WorkingDirectory = String.Empty @@ -109,7 +110,8 @@ type Params = /// Filter defects for the specified confidence levels. /// Default is 'normal+' Confidence = Confidence.Normal Grade.Plus - FailBuildOnDefect = true } + FailBuildOnDefect = true + } /// Builds the arguments for the Gendarme task /// [omit] @@ -135,7 +137,8 @@ let internal composeCommandLine parameters = let flag a predicate = if predicate then [ a ] else [] - [ item "--config" parameters.Configuration + [ + item "--config" parameters.Configuration item "--set" parameters.RuleSet (match parameters.LogKind with | Text -> item "--log" @@ -153,17 +156,17 @@ let internal composeCommandLine parameters = item "--severity" <| (sprintf "%A" parameters.Severity) - .ToLowerInvariant() - .Replace(" plus", "+") - .Replace(" minus", "-") - .Replace(" neutral", String.Empty) + .ToLowerInvariant() + .Replace(" plus", "+") + .Replace(" minus", "-") + .Replace(" neutral", String.Empty) item "--confidence" <| (sprintf "%A" parameters.Confidence) - .ToLowerInvariant() - .Replace(" plus", "+") - .Replace(" minus", "-") - .Replace(" neutral", String.Empty) + .ToLowerInvariant() + .Replace(" plus", "+") + .Replace(" minus", "-") + .Replace(" neutral", String.Empty) (if parameters.Verbosity > 0uy then seq { 1 .. int parameters.Verbosity } |> Seq.map (fun _ -> "--v") @@ -172,7 +175,8 @@ let internal composeCommandLine parameters = []) ((itemList String.Empty parameters.Targets) - |> List.filter (String.isNullOrWhiteSpace >> not)) ] + |> List.filter (String.isNullOrWhiteSpace >> not)) + ] |> List.concat let internal withWorkingDirectory parameters c = diff --git a/Build/actions.fs b/Build/actions.fs index 56c0d68..8b51945 100644 --- a/Build/actions.fs +++ b/Build/actions.fs @@ -98,18 +98,20 @@ open System.Runtime.CompilerServices do ()""" let prefix = - [| 0x00uy - 0x24uy - 0x00uy - 0x00uy - 0x04uy - 0x80uy - 0x00uy - 0x00uy - 0x94uy - 0x00uy - 0x00uy - 0x00uy |] + [| + 0x00uy + 0x24uy + 0x00uy + 0x00uy + 0x04uy + 0x80uy + 0x00uy + 0x00uy + 0x94uy + 0x00uy + 0x00uy + 0x00uy + |] let GetPublicKey (stream: Stream) = // see https://social.msdn.microsoft.com/Forums/vstudio/en-US/d9ef264e-1a74-4f48-b93f-3e2c7902f660/determine-contents-of-a-strong-name-key-file-snk?forum=netfxbcl @@ -287,9 +289,11 @@ a:hover {color: #ecc;} xmlform.Descendants(XName.Get "body") let eliminate = - [ "Continuous Integration" + [ + "Continuous Integration" "Building" - "Thanks to" ] + "Thanks to" + ] let keep = ref true diff --git a/Build/setup.fs b/Build/setup.fs index 3bcf8ed..b950794 100644 --- a/Build/setup.fs +++ b/Build/setup.fs @@ -33,7 +33,8 @@ module Setup = ConsoleLogParameters = [] DistributedLoggers = None Properties = [] - DisableInternalBinLog = true } + DisableInternalBinLog = true + } let dotnetOptions (o: DotNet.Options) = match dotnetPath with @@ -45,7 +46,8 @@ module Setup = { o with Packages = [ "./packages" ] MSBuildParams = cliArguments - Common = dotnetOptions o.Common }) + Common = dotnetOptions o.Common + }) "./Build/NuGet.csproj" let toolPackages = diff --git a/Build/targets.fs b/Build/targets.fs index e0eb65d..f6d7d69 100644 --- a/Build/targets.fs +++ b/Build/targets.fs @@ -54,7 +54,8 @@ module Targets = LocalSource = true TypeFilter = [ @"System\."; "Microsoft" ] - @ (p.TypeFilter |> Seq.toList) } + @ (p.TypeFilter |> Seq.toList) + } let dotnetOptions (o: DotNet.Options) = match dotnetPath with @@ -103,16 +104,19 @@ module Targets = ConsoleLogParameters = [] DistributedLoggers = None Properties = [ ("CheckEolTargetFramework", "false") ] - DisableInternalBinLog = true } + DisableInternalBinLog = true + } let withWorkingDirectoryVM dir o = { dotnetOptions o with WorkingDirectory = Path.getFullName dir - Verbosity = Some DotNet.Verbosity.Minimal } + Verbosity = Some DotNet.Verbosity.Minimal + } let withWorkingDirectoryOnly dir o = { dotnetOptions o with - WorkingDirectory = Path.getFullName dir } + WorkingDirectory = Path.getFullName dir + } let withCLIArgs (o: Fake.DotNet.DotNet.TestOptions) = { o with MSBuildParams = cliArguments } @@ -197,7 +201,8 @@ module Targets = DotNet.build (fun p -> { p.WithCommon dotnetOptions with - Configuration = DotNet.BuildConfiguration.Release } + Configuration = DotNet.BuildConfiguration.Release + } |> buildWithCLIArguments) (Path.GetFullPath proj) @@ -205,7 +210,8 @@ module Targets = DotNet.build (fun p -> { p.WithCommon dotnetOptions with - Configuration = DotNet.BuildConfiguration.Debug } + Configuration = DotNet.BuildConfiguration.Debug + } |> buildWithCLIArguments) (Path.GetFullPath proj) @@ -282,18 +288,22 @@ module Targets = Actions.InternalsVisibleTo(Version.Value) let v' = Version.Value - [ "./_Generated/AssemblyVersion.fs" - "./_Generated/AssemblyVersion.cs" ] + [ + "./_Generated/AssemblyVersion.fs" + "./_Generated/AssemblyVersion.cs" + ] |> List.iter (fun file -> AssemblyInfoFile.create file - [ AssemblyInfo.Product "AltCode.Fake" + [ + AssemblyInfo.Product "AltCode.Fake" AssemblyInfo.Version(majmin + ".0.0") AssemblyInfo.FileVersion v' AssemblyInfo.Company "Steve Gilham" AssemblyInfo.Trademark "" AssemblyInfo.InformationalVersion(infoV) - AssemblyInfo.Copyright copy ] + AssemblyInfo.Copyright copy + ] (Some AssemblyInfoFileConfig.Default)) let hack = @@ -386,11 +396,17 @@ module Targets = let rules = Path.getFullName "./Build/rules-fake.xml" - [ (rules, - [ "_Binaries/AltCode.Fake.DotNet.Gendarme/Debug+AnyCPU/netstandard2.0/AltCode.Fake.DotNet.Gendarme.dll" ]) + [ + (rules, + [ + "_Binaries/AltCode.Fake.DotNet.Gendarme/Debug+AnyCPU/netstandard2.0/AltCode.Fake.DotNet.Gendarme.dll" + ]) (Path.getFullName "./Build/build-rules.xml", - [ "$Binaries/Build/Debug+AnyCPU/net10.0/Build.dll" - "$Binaries/Setup/Debug+AnyCPU/net10.0/Setup.dll" ]) ] + [ + "$Binaries/Build/Debug+AnyCPU/net10.0/Build.dll" + "$Binaries/Setup/Debug+AnyCPU/net10.0/Setup.dll" + ]) + ] |> Seq.iter (fun (ruleset, files) -> Gendarme.run { Gendarme.Params.Create() with @@ -403,7 +419,8 @@ module Targets = LogKind = Gendarme.LogKind.Html Targets = files ToolType = ToolType.CreateLocalTool() - FailBuildOnDefect = true })) + FailBuildOnDefect = true + })) let FxCop = (fun _ -> // Needs debug because release is compiled --standalone which contaminates everything @@ -426,9 +443,13 @@ module Targets = printfn "Failed to get %A" x reraise () - [ ([ "_Binaries/AltCode.Fake.DotNet.Gendarme/Debug+AnyCPU/netstandard2.0/AltCode.Fake.DotNet.Gendarme.dll" ], + [ + ([ + "_Binaries/AltCode.Fake.DotNet.Gendarme/Debug+AnyCPU/netstandard2.0/AltCode.Fake.DotNet.Gendarme.dll" + ], [], - [ "-Microsoft.Design#CA1006" + [ + "-Microsoft.Design#CA1006" "-Microsoft.Design#CA1011" "-Microsoft.Design#CA1020" "-Microsoft.Design#CA1062" @@ -439,7 +460,9 @@ module Targets = "-Microsoft.Naming#CA1724" "-Microsoft.Usage#CA2208" "-Microsoft.Performance#CA1809:AvoidExcessiveLocals" // compiler nonsense - "-Microsoft.Usage#CA2243:AttributeStringLiteralsShouldParseCorrectly" ]) ] + "-Microsoft.Usage#CA2243:AttributeStringLiteralsShouldParseCorrectly" + ]) + ] |> Seq.iter (fun (files, types, ruleset) -> files |> FxCop.run @@ -448,7 +471,8 @@ module Targets = ToolPath = Option.get dixon PlatformDirectory = Option.get refdir DependencyDirectories = - [ nugetCache + [ + nugetCache @@ "fake.core.process/" + (ddItem "fake.core.process") + "/lib/netstandard2.0" @@ -467,14 +491,16 @@ module Targets = nugetCache @@ "fsharp.core/" + (ddItem "fsharp.core") - + "/lib/netstandard2.0" ] + + "/lib/netstandard2.0" + ] UseGAC = true Verbose = false ReportFileName = "_Reports/FxCopReport.xml" Types = types Rules = ruleset FailOnError = FxCop.ErrorLevel.Warning - IgnoreGeneratedCode = true })) + IgnoreGeneratedCode = true + })) // Unit Test @@ -496,7 +522,8 @@ module Targets = |> Seq.iter ( DotNet.build (fun p -> { p.WithCommon dotnetOptions with - Configuration = DotNet.BuildConfiguration.Debug } + Configuration = DotNet.BuildConfiguration.Debug + } |> withMSBuildParams) )) @@ -510,7 +537,8 @@ module Targets = DotNet.test (fun p -> { p.WithCommon dotnetOptions with Configuration = DotNet.BuildConfiguration.Debug - NoBuild = true } + NoBuild = true + } |> withCLIArgs) ) with x -> @@ -523,7 +551,8 @@ module Targets = |> Seq.iter ( DotNet.build (fun p -> { p.WithCommon dotnetOptions with - Configuration = DotNet.BuildConfiguration.Debug } + Configuration = DotNet.BuildConfiguration.Debug + } |> withMSBuildParams) )) @@ -556,7 +585,8 @@ module Targets = let setBaseOptions (o: DotNet.Options) = { o with WorkingDirectory = Path.getFullName testDirectory - Verbosity = Some DotNet.Verbosity.Minimal } + Verbosity = Some DotNet.Verbosity.Minimal + } let collect = AltCover.CollectOptions.Primitive(Primitive.CollectOptions.Create()) // FSApi @@ -564,7 +594,8 @@ module Targets = let prepare = AltCover.PrepareOptions.Primitive( { Primitive.PrepareOptions.Create() with - Report = altReport } + Report = altReport + } |> AltCoverFilter ) @@ -584,7 +615,8 @@ module Targets = (fun to' -> { (to'.WithCommon(setBaseOptions)) with Framework = Some "net10.0" - MSBuildParams = cliArguments } + MSBuildParams = cliArguments + } .WithAltCoverOptions prepare collect @@ -602,9 +634,12 @@ module Targets = { p with ToolType = ToolType.CreateLocalTool() ReportTypes = - [ ReportGenerator.ReportType.Html - ReportGenerator.ReportType.XmlSummary ] - TargetDir = report }) + [ + ReportGenerator.ReportType.Html + ReportGenerator.ReportType.XmlSummary + ] + TargetDir = report + }) coverage let reportLines = @@ -659,7 +694,8 @@ module Targets = Actions.Run ("dotnet", "_Reports", - [ "csmacnz.Coveralls" + [ + "csmacnz.Coveralls" "--opencover" "-i" coverage @@ -676,7 +712,8 @@ module Targets = "--commitMessage" commit "--jobId" - DateTime.UtcNow.ToString("yyMMdd-HHmmss") ]) + DateTime.UtcNow.ToString("yyMMdd-HHmmss") + ]) "Coveralls upload failed" (report @@ "Summary.xml") @@ -693,10 +730,12 @@ module Targets = Path.getFullName "_Binaries/AltCode.Fake.DotNet.Gendarme/Release+AnyCPU" let gendarmeFiles = - [ (Path.getFullName "./LICENS*", Some "", None) + [ + (Path.getFullName "./LICENS*", Some "", None) (Path.getFullName "./Build/AltCode.Fake_128.*g", Some "", None) (Path.getFullName "./Build/README.Fake.md", Some "", None) - (Path.getFullName "./_Binaries/README.Fake.html", Some "", None) ] + (Path.getFullName "./_Binaries/README.Fake.html", Some "", None) + ] let gendarmeNetcoreFiles = (!!(gendarmeDir @@ -719,12 +758,15 @@ module Targets = |> Seq.toList let whatPack = - [ (Path.getFullName "./LICENS*", Some "", None) + [ + (Path.getFullName "./LICENS*", Some "", None) (Path.getFullName "./Build/AltCode.VsWhat_128.*g", Some "", None) (Path.getFullName "./Build/README.What.md", Some "", None) - (Path.getFullName "./_Binaries/README.What.html", Some "", None) ] + (Path.getFullName "./_Binaries/README.What.html", Some "", None) + ] - [ (List.concat [ gendarmeFiles; gendarmeNetcoreFiles ], + [ + (List.concat [ gendarmeFiles; gendarmeNetcoreFiles ], packageGendarme, "./_Generated/altcode.fake.dotnet.gendarme.nuspec", "AltCode.Fake.DotNet.Gendarme", @@ -734,16 +776,20 @@ module Targets = ("Fake.Core.Environment", "5.23.0") ("Fake.DotNet.Cli", "5.23.0") ("FSharp.Core", "4.7") - ("System.Collections.Immutable", "1.6.0") ]) + ("System.Collections.Immutable", "1.6.0") + ]) (List.concat - [ whatFiles "tools/netcoreapp2.1/any" - whatPack ], + [ + whatFiles "tools/netcoreapp2.1/any" + whatPack + ], packageVsWhat, "./_Generated/altcode.vswhat.nuspec", "AltCode.VsWhat", "A tool to list Visual Studio instances and their installed packages", "VsWhat", - []) ] + []) + ] |> List.iter (fun (files, output, nuspec, project, description, what, dependencies) -> let outputPath = "./" + output @@ -771,7 +817,8 @@ module Targets = ("./packages/" + (packageVersion "NuGet.CommandLine") + "/tools/NuGet.exe") - |> Path.getFullName }) + |> Path.getFullName + }) nuspec)) let PrepareDotNetBuild = @@ -784,10 +831,12 @@ module Targets = MSBuildParams = cliArguments OutputPath = Some(publish + ".vsWhat") Configuration = DotNet.BuildConfiguration.Release - Framework = Some "net10.0" }) + Framework = Some "net10.0" + }) (Path.getFullName "./AltCode.VsWhat/AltCode.VsWhat.fsproj") - [ (String.Empty, + [ + (String.Empty, "./_Generated/altcode.fake.dotnet.gendarme.nuspec", "AltCode.Fake.DotNet.Gendarme (FAKE task helper)", None, @@ -798,7 +847,8 @@ module Targets = "AltCode.VsWhat (Visual Studio package listing tool)", Some "Build/AltCode.VsWhat_128.png", Some "Visual Studio", - "README.What.md") ] + "README.What.md") + ] |> List.iter (fun (ptype, path, caption, icon, tags, readme) -> let x s = XName.Get(s, "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd") @@ -853,8 +903,10 @@ module Targets = let c = Copyright.Value.Replace("©", "©").Replace("<", "<").Replace(">", ">") - [ "./Build/README.Fake.md" - "./Build/README.What.md" ] + [ + "./Build/README.Fake.md" + "./Build/README.What.md" + ] |> Seq.iter (Actions.PrepareReadMe c)) // Post-packaging deployment touch test @@ -873,7 +925,8 @@ module Targets = Actions.RunDotnet (fun o' -> { dotnetOptions o' with - WorkingDirectory = working }) + WorkingDirectory = working + }) "tool" ("install -g altcode.vswhat --add-source " + (Path.getFullName packageVsWhat) @@ -884,7 +937,8 @@ module Targets = Actions.RunDotnet (fun o' -> { dotnetOptions o' with - WorkingDirectory = working }) + WorkingDirectory = working + }) "tool" ("list -g ") "Checked" @@ -901,7 +955,8 @@ module Targets = Actions.RunDotnet (fun o' -> { dotnetOptions o' with - WorkingDirectory = working }) + WorkingDirectory = working + }) "tool" ("uninstall -g altcode.vswhat") "uninstalled" @@ -928,7 +983,8 @@ module Targets = { p with ToolType = ToolType.CreateLocalTool() ReportTypes = [ ReportGenerator.ReportType.Html ] - TargetDir = "_Reports/_BulkReport" })) + TargetDir = "_Reports/_BulkReport" + })) let All = (fun _ -> @@ -947,13 +1003,15 @@ module Targets = Actions.Run ("dotnet", ".", - [ "nuget" + [ + "nuget" "push" f "--api-key" Environment.environVar "NUGET_API_TOKEN" "--source" - "https://api.nuget.org/v3/index.json" ]) + "https://api.nuget.org/v3/index.json" + ]) ("NuGet upload failed " + f))) let resetColours _ = diff --git a/Directory.Packages.props b/Directory.Packages.props index 8c2e814..1065662 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -17,9 +17,9 @@ - + - + @@ -29,7 +29,7 @@ - +