Skip to content

Commit

Permalink
Add optional build parameter to generate a binlog file (fluentasser…
Browse files Browse the repository at this point in the history
  • Loading branch information
IT-VBFK authored Feb 14, 2023
1 parent 04ee84f commit 55023d5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ packages/**
*.tmp
*.tmp_proj
*.log
*.binlog
*.vspscc
*.vssscc
.builds
Expand Down
4 changes: 4 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
},
"GenerateBinLog": {
"type": "boolean",
"description": "Use this parameter if you encounter build problems in any way, to generate a .binlog file which holds some useful information"
},
"Help": {
"type": "boolean",
"description": "Shows the help text for this build assembly"
Expand Down
7 changes: 7 additions & 0 deletions Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class Build : NukeBuild
string BuildNumber => GitHubActions?.RunNumber.ToString();
string PullRequestBase => GitHubActions?.BaseRef;

[Parameter("Use this parameter if you encounter build problems in any way, " +
"to generate a .binlog file which holds some useful information.")]
readonly bool? GenerateBinLog;

[Parameter("The key to push to Nuget")]
[Secret]
readonly string NuGetApiKey;
Expand Down Expand Up @@ -124,6 +128,9 @@ class Build : NukeBuild
DotNetBuild(s => s
.SetProjectFile(Solution)
.SetConfiguration(Configuration.CI)
.When(GenerateBinLog is true, _ => _
.SetBinaryLog(ArtifactsDirectory / $"{Solution.Core.FluentAssertions.Name}.binlog")
)
.EnableNoLogo()
.EnableNoRestore()
.SetAssemblyVersion(GitVersion.AssemblySemVer)
Expand Down

0 comments on commit 55023d5

Please sign in to comment.