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
8
8
Import-Module $utilFilePath - Force
9
9
10
10
$srcPath = Join-Path $RepoRoot ' src'
11
- $moduleMap = Get-AutorestV4ModuleMap - srcPath $srcPath
11
+ $moduleMap = Get-BatchGenerationModuleMap - srcPath $srcPath
12
12
Write-Host " Total matched modules: $ ( $moduleMap.Count ) "
13
13
14
14
$modules = @ ($moduleMap.Keys | Sort-Object )
Original file line number Diff line number Diff line change 1
- function Get-AutorestV4ModuleMap {
1
+ function Get-BatchGenerationModuleMap {
2
2
param (
3
3
[string ]$srcPath
4
4
)
5
-
5
+ $skippedModules = $ env: SKIPPED_MODULES -split ' , ' | ForEach-Object { $_ .Trim () }
6
6
$result = @ {}
7
+ $modules = Get-ChildItem - Path $srcPath - Directory
7
8
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 {
12
15
$_.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
+
16
24
$readmePath = Join-Path $subModule.FullName ' README.md'
17
25
18
26
if (Test-Path $readmePath ) {
Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ stages:
84
84
script : |
85
85
$prepareModulesPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'prepare.ps1'
86
86
& $prepareModulesPath -RepoRoot "$(Build.SourcesDirectory)" -MaxParallelJobs "${{ variables.MaxParallelGenerateJobs }}"
87
+ env :
88
+ SKIPPED_MODULES : $(SkippedModules)
87
89
88
90
- task : PublishPipelineArtifact@1
89
91
displayName : ' Upload generated targets'
You can’t perform that action at this time.
0 commit comments