Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance build.ps1 script #15191

Merged
merged 2 commits into from
Aug 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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