Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
florenzen committed May 24, 2024
1 parent f3114c1 commit f04e800
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions build/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ let githubToken = Environment.environVarOrNone "GITHUB_TOKEN"

let nugetToken = Environment.environVarOrNone "NUGET_TOKEN"


// ----------------------------------------------------------------------------
// Helpers
// ----------------------------------------------------------------------------


let isRelease (targets: Target list) =
targets |> Seq.map (fun t -> t.Name) |> Seq.exists ((=) "PublishToNuGet")

Expand All @@ -123,7 +123,6 @@ let failOnBadExitAndPrint (p: ProcessResult) =

failwithf "failed with exitcode %d" p.ExitCode


let isCI = lazy environVarAsBoolOrDefault "CI" false

// CI Servers can have bizarre failures that have nothing to do with your code
Expand Down Expand Up @@ -165,6 +164,7 @@ module dotnet =

let fantomas args = DotNet.exec id "fantomas" args


module FSharpAnalyzers =
type Arguments =
| Project of string
Expand Down Expand Up @@ -206,7 +206,6 @@ module DocsTool =
"fsdocs-collection-name-link", quoted gitHubRepoUrl ]
Strict = Some true }


let cleanDocsCache () = Fsdocs.cleanCache rootDirectory

let build (configuration) =
Expand All @@ -226,6 +225,7 @@ module DocsTool =
{ p with
BuildCommandParams = Some(buildParams p.BuildCommandParams) })


let allReleaseChecks () =
failOnWrongBranch ()
Changelog.failOnEmptyChangelog latestEntry
Expand All @@ -242,6 +242,7 @@ let allPublishChecks () =
failOnLocalBuild ()
Changelog.failOnEmptyChangelog latestEntry


// ----------------------------------------------------------------------------
// Target Implementations
// ----------------------------------------------------------------------------
Expand All @@ -256,7 +257,6 @@ let clean _ =
|> Seq.collect (fun p -> [ "bin"; "obj" ] |> Seq.map (fun sp -> IO.Path.GetDirectoryName p </> sp))
|> Shell.cleanDirs


let dotnetRestore _ =
[ sln ]
|> Seq.map (fun dir ->
Expand All @@ -282,7 +282,6 @@ let deleteChangelogBackupFile _ =
if String.isNotNullOrEmpty Changelog.changelogBackupFilename then
Shell.rm Changelog.changelogBackupFilename


let dotnetBuild ctx =
let args =
[ sprintf "/p:PackageVersion=%s" latestEntry.NuGetVersion; "--no-restore" ]
Expand All @@ -292,9 +291,7 @@ let dotnetBuild ctx =
{ c with
MSBuildParams = disableBinLog c.MSBuildParams
Configuration = configuration (ctx.Context.AllExecutingTargets)
Common = c.Common |> DotNet.Options.withAdditionalArgs args

})
Common = c.Common |> DotNet.Options.withAdditionalArgs args })
sln

let fsharpAnalyzers _ =
Expand Down Expand Up @@ -367,7 +364,6 @@ let showCoverageReport _ =
|> Proc.start
|> ignore


let watchTests _ =
!!testsGlob
|> Seq.map (fun proj ->
Expand Down Expand Up @@ -530,7 +526,7 @@ let checkFormatCode ctx =
else
Trace.logf "Errors while formatting: %A" result.Errors

let listTargets ctx = Target.listAvailable ()
let listTargets _ = Target.listAvailable ()

let cleanDocsCache _ = DocsTool.cleanDocsCache ()

Expand All @@ -557,10 +553,10 @@ let initTargets () =
// ----------------------------------------------------------------------------
Option.iter (TraceSecrets.register "<GITHUB_TOKEN>") githubToken
Option.iter (TraceSecrets.register "<NUGET_TOKEN>") nugetToken

// ----------------------------------------------------------------------------
// Target Declaration
// ----------------------------------------------------------------------------

Target.create "Clean" clean
Target.create "DotnetRestore" dotnetRestore
Target.create "UpdateChangelog" updateChangelog
Expand Down

0 comments on commit f04e800

Please sign in to comment.