Skip to content

Commit

Permalink
enhance build.ps1 script (#15191)
Browse files Browse the repository at this point in the history
* enhance build.ps1 script

* fix typo
  • Loading branch information
ArcturusZhang authored Aug 3, 2021
1 parent b6def71 commit b381748
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion eng/scripts/build.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Requires -Version 7.0
param([string]$filter, [switch]$clean, [switch]$vet, [switch]$generate, [switch]$skipBuild, [string]$config = "autorest.md", [string]$outputFolder)
param([string]$filter, [switch]$clean, [switch]$vet, [switch]$generate, [switch]$skipBuild, [switch]$format, [switch]$tidy, [string]$config = "autorest.md", [string]$outputFolder)

. $PSScriptRoot/meta_generation.ps1
. $PSScriptRoot/get_module_dirs.ps1
Expand Down Expand Up @@ -34,6 +34,16 @@ function Process-Sdk ($path) {
}
}

if ($format) {
Write-Host "##[command]Executing gofmt -s -w . in " $path
gofmt -s -w $path
}

if ($tidy) {
Write-Host "##[command]Executing go mod tidy in " $path
go mod tidy
}

if (!$skipBuild) {
Write-Host "##[command]Executing go build -x -v ./... in " $path
go build -x -v ./...
Expand Down

0 comments on commit b381748

Please sign in to comment.