Skip to content

Commit

Permalink
Merge branch 'develop/maintenance' into develop/Gendarme
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Dec 1, 2022
2 parents 182245c + 85955e4 commit ea8c5d9
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 27 deletions.
59 changes: 36 additions & 23 deletions Build/targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,9 @@ module Targets =
{ o with MSBuildParams = cliArguments }

let currentBranch =
let env =
Environment.environVar "APPVEYOR_REPO_BRANCH"

if env |> String.IsNullOrWhiteSpace then
"."
|> Path.getFullName
|> Information.getBranchName
else
env
"."
|> Path.getFullName
|> Information.getBranchName

let packageGendarme =
if currentBranch.Contains "VsWhat" then
Expand Down Expand Up @@ -258,9 +252,6 @@ module Targets =

let SetVersion =
(fun _ ->
let appveyor =
Environment.environVar "APPVEYOR_BUILD_NUMBER"

let github =
Environment.environVar "GITHUB_RUN_NUMBER"

Expand All @@ -275,13 +266,10 @@ module Targets =
printfn "Raw version %s" version

let ci =
if String.IsNullOrWhiteSpace appveyor then
if String.IsNullOrWhiteSpace github then
String.Empty
else
version.Replace("{build}", github + "-github")
if String.IsNullOrWhiteSpace github then
String.Empty
else
version.Replace("{build}", appveyor)
version.Replace("{build}", github)

let (v, majmin, y) =
Actions.LocalVersion ci version
Expand Down Expand Up @@ -686,14 +674,13 @@ module Targets =
"--commitBranch"
Information.getBranchName (".")
"--commitAuthor"
maybe "APPVEYOR_REPO_COMMIT_AUTHOR" ""
maybe "COMMIT_AUTHOR" "" // TODO
"--commitEmail"
maybe "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL" ""
maybe "COMMIT_AUTHOR_EMAIL" "" //
"--commitMessage"
commit
"--jobId"
maybe "APPVEYOR_JOB_ID"
<| DateTime.UtcNow.ToString("yyMMdd-HHmmss") ])
DateTime.UtcNow.ToString("yyMMdd-HHmmss") ])
"Coveralls upload failed"

(report @@ "Summary.xml")
Expand Down Expand Up @@ -944,6 +931,32 @@ module Targets =
ReportTypes = [ ReportGenerator.ReportType.Html ]
TargetDir = "_Reports/_BulkReport" }))

let All =
(fun _ ->
if
Environment.isWindows
&& currentBranch.StartsWith "release/"
&& "NUGET_API_TOKEN"
|> Environment.environVar
|> String.IsNullOrWhiteSpace
|> not
then
(!! "./_Packagin*/*.nupkg")
|> Seq.iter (fun f ->
printfn "Publishing %A from %A" f currentBranch

Actions.Run
("dotnet",
".",
[ "nuget"
"push"
f
"--api-key"
Environment.environVar "NUGET_API_TOKEN"
"--source"
"https://api.nuget.org/v3/index.json" ])
("NuGet upload failed " + f)))

let resetColours _ =
Console.ForegroundColor <- consoleBefore |> fst
Console.BackgroundColor <- consoleBefore |> snd
Expand Down Expand Up @@ -976,7 +989,7 @@ module Targets =
_Target "AltCodeVsWhatGlobalIntegration" AltCodeVsWhatGlobalIntegration
_Target "Deployment" ignore
_Target "BulkReport" BulkReport
_Target "All" ignore
_Target "All" All

// Dependencies
"Clean" ==> "SetVersion" ==> "Preparation"
Expand Down
12 changes: 8 additions & 4 deletions ReleaseNotes.Gendarme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# 5.23.0.39
* Support for .net7.0
* Support only Fake ≥ 5.23.0

# 5.19.1.28
* [Dependency change] Uses Fake >= 5.19.1 rather than >= 5.18.1
* [Dependency change] Uses Fake 5.19.1 rather than 5.18.1
* [API change] The Fake`ToolType` of the `Params` object defaults to `GlobalTool` with tool name `gendarme` : see https://www.nuget.org/packages/altcode.gendarme-tool for your global tool.

# 5.18.1.24
* [Dependency change] Uses Fake >= 5.18.1 rather than >= 5.9.3
* [Dependency change] Uses Fake 5.18.1 rather than 5.9.3
* [API change] Update to add a Fake `ToolType` to the `Params` object. If you use the `Create` method, this should be transparent to you, as it defaults to `FullFramework`.
* [API change] In `Params.Create`, use the updated Fake Process APIs to look for Gendarme, which means it will look in PATH first, then locally, and default the `ToolPath` to just plain `gendarme` if nothing is found.

# 5.9.3.10
* [BUGFIX] As "--limit 0" means "report nothing" not "report all", make zero limit emit nothing to the command line
* [Enhancement] `FailBuildOnDefect` parameter, default `true`, to determine if defect detection will fail the build.
* **NOTE** whether --limit is set > 0 or omitted, if there are > 0 defects reported Gendarme exits with return code 1. It limit is set zero, or there are no defects against the rules engaged, then it returns 0. Failing the build on >= N defects for N > 0 does not come for free, but would require parsing one form of output or another, and no form of output is guaranteed -- they can all be switched off.
* **NOTE** whether --limit is set > 0 or omitted, if there are > 0 defects reported Gendarme exits with return code 1. It limit is set zero, or there are no defects against the rules engaged, then it returns 0. Failing the build on N defects for N > 0 does not come for free, but would require parsing one form of output or another, and no form of output is guaranteed -- they can all be switched off.

# 5.9.3.7
* [NEW PACKAGE] `AltCode.Fake.DotNet.Gendarme` containing Gendarme task helper types for FAKE scripts (v5.9.3 or later) : see Wiki entry [The `AltCode.Fake.DotNet.Gendarme` package](https://github.com/SteveGilham/altcode.Fake/wiki/The-AltCode.Fake.DotNet.Gendarme-package)
* [NEW PACKAGE] `AltCode.Fake.DotNet.Gendarme` containing Gendarme task helper types for FAKE scripts (v ≥ 5.9.3) : see Wiki entry [The `AltCode.Fake.DotNet.Gendarme` package](https://github.com/SteveGilham/altcode.Fake/wiki/The-AltCode.Fake.DotNet.Gendarme-package)
3 changes: 3 additions & 0 deletions ReleaseNotes.VsWhat.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 22.12.1.38
* Support for .net7.0

# 20.12.10.26
* Use VsWhere 1.1.0 release
* Support for .net5.0 (actually all runtimes > 2.1)
Expand Down

0 comments on commit ea8c5d9

Please sign in to comment.