From f8ef7063b7043777d2aa3da89b5269e813474ad9 Mon Sep 17 00:00:00 2001 From: ArcturusZhang Date: Fri, 30 Jul 2021 15:08:10 +0800 Subject: [PATCH 1/2] enhance build.ps1 script --- eng/scripts/build.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eng/scripts/build.ps1 b/eng/scripts/build.ps1 index 64a71dccb5b6..276889b57509 100644 --- a/eng/scripts/build.ps1 +++ b/eng/scripts/build.ps1 @@ -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 @@ -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 ./... From 62a58a9033338bc1f06de1aa2db24913763d1bf2 Mon Sep 17 00:00:00 2001 From: ArcturusZhang Date: Mon, 2 Aug 2021 12:46:57 +0800 Subject: [PATCH 2/2] fix typo --- eng/scripts/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/scripts/build.ps1 b/eng/scripts/build.ps1 index 276889b57509..37bcc25e8402 100644 --- a/eng/scripts/build.ps1 +++ b/eng/scripts/build.ps1 @@ -1,5 +1,5 @@ #Requires -Version 7.0 -param([string]$filter, [switch]$clean, [switch]$vet, [switch]$generate, [switch]$skipBuild, [switch]$format, [switch]tidy, [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