File tree Expand file tree Collapse file tree 3 files changed +20
-10
lines changed
PipelineSteps/BatchGeneration Expand file tree Collapse file tree 3 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ $utilFilePath = Join-Path $RepoRoot '.azure-pipelines' 'PipelineSteps' 'BatchGen
88Import-Module $utilFilePath - Force
99
1010$srcPath = Join-Path $RepoRoot ' src'
11- $moduleMap = Get-AutorestV4ModuleMap - srcPath $srcPath
11+ $moduleMap = Get-BatchGenerationModuleMap - srcPath $srcPath
1212Write-Host " Total matched modules: $ ( $moduleMap.Count ) "
1313
1414$modules = @ ($moduleMap.Keys | Sort-Object )
Original file line number Diff line number Diff line change 1- function Get-AutorestV4ModuleMap {
1+ function Get-BatchGenerationModuleMap {
22 param (
33 [string ]$srcPath
44 )
5-
5+ $skippedModules = $ env: SKIPPED_MODULES -split ' , ' | ForEach-Object { $_ .Trim () }
66 $result = @ {}
7+ $modules = Get-ChildItem - Path $srcPath - Directory
78
8- Get-ChildItem - Path $srcPath - Directory | ForEach-Object {
9- $module = $_
10-
11- Get-ChildItem - Path $module.FullName - Directory | Where-Object {
9+ foreach ($module in $modules ) {
10+ if ($skippedModules -contains $module.Name ) {
11+ Write-Warning " Skipping module: $ ( $module.Name ) as it is in the skipped modules list."
12+ continue
13+ }
14+ $subModules = Get-ChildItem - Path $module.FullName - Directory | Where-Object {
1215 $_.Name -like ' *.autorest'
13- } | ForEach-Object {
14- $subModule = $_
15-
16+ }
17+ foreach ($subModule in $subModules ) {
18+ $tspPath = Join-Path $subModule.FullName ' tsp-location.yaml'
19+ if (Test-Path $tspPath ){
20+ Write-Warning " tsp-location.yaml found in $ ( $subModule.FullName ) , skipping."
21+ continue
22+ }
23+
1624 $readmePath = Join-Path $subModule.FullName ' README.md'
1725
1826 if (Test-Path $readmePath ) {
Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ stages:
8484 script : |
8585 $prepareModulesPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'prepare.ps1'
8686 & $prepareModulesPath -RepoRoot "$(Build.SourcesDirectory)" -MaxParallelJobs "${{ variables.MaxParallelGenerateJobs }}"
87+ env :
88+ SKIPPED_MODULES : $(SkippedModules)
8789
8890 - task : PublishPipelineArtifact@1
8991 displayName : ' Upload generated targets'
You can’t perform that action at this time.
0 commit comments