Skip to content

Commit

Permalink
fix: some compatible issue in build.ps1 after unify module discovery (#…
Browse files Browse the repository at this point in the history
…15623)

* fix: some compatible issue in build.ps1 after unify module discovery

* chore: remove deprecated converting script for _meta.json

* fix: add NonShipping flag for non-rp package release
  • Loading branch information
tadelesh authored Sep 24, 2021
1 parent 4f444f0 commit 6ff9912
Show file tree
Hide file tree
Showing 28 changed files with 41 additions and 62 deletions.
14 changes: 9 additions & 5 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
parameters:
- name: ServiceDirectory
- name: ServiceDirectory
type: string
default: ''
- name: RunTests
type: string
- name: RunTests
type: boolean
default: false
- name: RunLiveTests
type: string
- name: RunLiveTests
type: boolean
default: false
- name: NonShipping
type: boolean
default: false
- name: Clouds
type: string
Expand Down Expand Up @@ -131,6 +134,7 @@ stages:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
GoWorkspace: $(GO_WORKSPACE_PATH)
LintVersion: $(GoLintCLIVersion)
NonShipping: ${{ parameters.NonShipping }}

# Run live tests for internal only, not public CI builds. This can be triggered manually for via an `/azp run` comment.
- ${{if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.RunLiveTests, 'true'))}}:
Expand Down
11 changes: 7 additions & 4 deletions eng/pipelines/templates/steps/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ parameters:
ServiceDirectory: ''
GoWorkspace: ''
LintVersion: ''
NonShipping: false


steps:

Expand Down Expand Up @@ -56,7 +58,8 @@ steps:

- template: /eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml

- template: /eng/common/pipelines/templates/steps/verify-changelog.yml
parameters:
PackageName: 'sdk/${{parameters.ServiceDirectory}}'
ForRelease: false
- ${{if eq(parameters.NonShipping, 'false')}}:
- template: /eng/common/pipelines/templates/steps/verify-changelog.yml
parameters:
PackageName: 'sdk/${{parameters.ServiceDirectory}}'
ForRelease: false
10 changes: 1 addition & 9 deletions eng/scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,15 @@ function Process-Sdk () {
Write-Host "##[command]Executing autorest.go in " $currentDirectory
$autorestPath = "./" + $config

if (ShouldGenerate-AutorestConfig $autorestPath) {
Generate-AutorestConfig $autorestPath
$removeAutorestFile = $true
}

$autorestVersion = "@autorest/go@4.0.0-preview.27"
if ($outputFolder -eq '') {
$outputFolder = $currentDirectory
}
autorest --use=$autorestVersion --go --track2 --go-sdk-folder=$root --output-folder=$outputFolder --file-prefix="zz_generated_" --clear-output-folder=false $autorestPath
autorest --use=$autorestVersion --go --track2 --output-folder=$outputFolder --file-prefix="zz_generated_" --clear-output-folder=false $autorestPath
if ($LASTEXITCODE) {
Write-Host "##[error]Error running autorest.go"
exit $LASTEXITCODE
}
if ($removeAutorestFile) {
Remove-Item $autorestPath
}
}

if ($format) {
Expand Down
21 changes: 0 additions & 21 deletions eng/scripts/meta_generation.ps1

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/agrifood/armagrifood/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armagrifood
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate agrifood/armagrifood

package armagrifood
2 changes: 1 addition & 1 deletion sdk/apimanagement/armapimanagement/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armapimanagement
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate apimanagement/armapimanagement

package armapimanagement
2 changes: 1 addition & 1 deletion sdk/authorization/armauthorization/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armauthorization
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate authorization/armauthorization

package armauthorization
2 changes: 1 addition & 1 deletion sdk/compute/armcompute/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armcompute
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate compute/armcompute

package armcompute
2 changes: 1 addition & 1 deletion sdk/containerregistry/armcontainerregistry/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armcontainerregistry
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate containerregistry/armcontainerregistry

package armcontainerregistry
2 changes: 1 addition & 1 deletion sdk/containerservice/armcontainerservice/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armcontainerservice
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate containerservice/armcontainerservice

package armcontainerservice
2 changes: 1 addition & 1 deletion sdk/cosmos/armcosmos/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armcosmos
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate cosmos/armcosmos

package armcosmos
2 changes: 1 addition & 1 deletion sdk/eventgrid/armeventgrid/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armeventgrid
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate eventgrid/armeventgrid

package armeventgrid
2 changes: 1 addition & 1 deletion sdk/eventhub/armeventhub/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armeventhub
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate eventhub/armeventhub

package armeventhub
2 changes: 1 addition & 1 deletion sdk/keyvault/armkeyvault/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armkeyvault
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate keyvault/armkeyvault

package armkeyvault
2 changes: 1 addition & 1 deletion sdk/monitor/armmonitor/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armmonitor
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate monitor/armmonitor

package armmonitor
2 changes: 1 addition & 1 deletion sdk/network/armnetwork/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armnetwork
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate network/armnetwork

package armnetwork
2 changes: 1 addition & 1 deletion sdk/operationalinsights/armoperationalinsights/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armoperationalinsights
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate operationalinsights/armoperationalinsights

package armoperationalinsights
2 changes: 1 addition & 1 deletion sdk/postgresql/armpostgresql/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armpostgresql
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate postgresql/armpostgresql

package armpostgresql
2 changes: 1 addition & 1 deletion sdk/postgresql/armpostgresqlflexibleservers/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armpostgresqlflexibleservers
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate postgresqlflexibleservers/armpostgresqlflexibleservers

package armpostgresqlflexibleservers
2 changes: 1 addition & 1 deletion sdk/privatedns/armprivatedns/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armprivatedns
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate privatedns/armprivatedns

package armprivatedns
2 changes: 1 addition & 1 deletion sdk/redis/armredis/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armredis
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate redis/armredis

package armredis
2 changes: 1 addition & 1 deletion sdk/resources/armresources/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armresources
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resources/armresources

package armresources
2 changes: 1 addition & 1 deletion sdk/servicebus/armservicebus/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armservicebus
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate servicebus/armservicebus

package armservicebus
2 changes: 1 addition & 1 deletion sdk/sql/armsql/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armsql
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate sql/armsql

package armsql
2 changes: 1 addition & 1 deletion sdk/storage/armstorage/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armstorage
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate storage/armstorage

package armstorage
2 changes: 1 addition & 1 deletion sdk/web/armweb/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armweb
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate web/armweb

package armweb
1 change: 1 addition & 0 deletions tools/generator/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ stages:
- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: '../tools/generator'
NonShipping: true
2 changes: 1 addition & 1 deletion tools/generator/template/rpName/packageName/build.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate {{packageName}}
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate {{rpName}}/{{packageName}}

package {{packageName}}

0 comments on commit 6ff9912

Please sign in to comment.