Skip to content

Commit

Permalink
Add dotnet-format to build.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
natemcmaster committed Sep 13, 2020
1 parent c4547a6 commit 14db834
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"commands": [
"reportgenerator"
]
},
"dotnet-format": {
"version": "4.1.131201",
"commands": [
"dotnet-format"
]
}
}
}
8 changes: 8 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ $artifacts = "$PSScriptRoot/artifacts/"
Remove-Item -Recurse $artifacts -ErrorAction Ignore

exec dotnet tool restore

[string[]] $formatArgs=@()
if ($ci) {
$formatArgs += '--check'
}

exec dotnet tool run dotnet-format -- -v detailed @formatArgs "$PSScriptRoot/CommandLineUtils.sln"
exec dotnet tool run dotnet-format -- -v detailed @formatArgs "$PSScriptRoot/docs/samples/samples.sln"
exec dotnet build --configuration $Configuration '-warnaserror:CS1591' @MSBuildArgs
exec dotnet pack --no-restore --no-build --configuration $Configuration -o $artifacts @MSBuildArgs
exec dotnet build --configuration $Configuration "$PSScriptRoot/docs/samples/samples.sln"
Expand Down

0 comments on commit 14db834

Please sign in to comment.