@@ -663,7 +663,7 @@ function Invoke-GenerateAndBuildSDK () {
663663 # $packageName = $package.packageName
664664 Write-Host " projectFolder:$projectFolder "
665665
666- GeneratePackage - projectFolder $projectFolder - sdkRootPath $sdkRootPath - path $path - downloadUrlPrefix $downloadUrlPrefix - generatedSDKPackages $generatedSDKPackages
666+ GeneratePackage - projectFolder $projectFolder - sdkRootPath $sdkRootPath - path $path - downloadUrlPrefix $downloadUrlPrefix - serviceType $serviceType - generatedSDKPackages $generatedSDKPackages
667667 }
668668}
669669
@@ -674,6 +674,7 @@ function GeneratePackage()
674674 [string ]$sdkRootPath ,
675675 [string ]$path ,
676676 [string ]$downloadUrlPrefix = " " ,
677+ [string ]$serviceType = " data-plane" ,
677678 [switch ]$skipGenerate ,
678679 [object ]$generatedSDKPackages
679680 )
@@ -768,9 +769,13 @@ function GeneratePackage()
768769 full = $full
769770 lite = $full
770771 }
772+ $ciFilePath = " sdk/$service /ci.yml"
773+ if ( $serviceType -eq " resource-manager" ) {
774+ $ciFilePath = " sdk/$service /ci.mgmt.yml"
775+ }
771776 $generatedSDKPackages.Add (@ {packageName = " $packageName " ;
772777 result = $result ;
773- path = @ (" $path " , " sdk/ $service /ci.yml " );
778+ path = @ (" $path " , " $ciFilePath " );
774779 packageFolder = " $projectFolder " ;
775780 artifacts = $artifacts ;
776781 apiViewArtifact = $apiViewArtifact ;
@@ -792,7 +797,7 @@ function UpdateExistingSDKByInputFiles()
792797 $autorestFilesPath = Get-ChildItem - Path " $sdkRootPath /sdk" - Filter autorest.md - Recurse | Resolve-Path - Relative
793798 Write-Host " Updating autorest.md files for all the changed swaggers."
794799
795- $sdksInfo = @ ()
800+ $sdksInfo = @ {}
796801 $regexToFindSha = " https:\/\/[^`" ]*[\/][0-9a-f]{4,40}[\/]"
797802 foreach ($path in $autorestFilesPath ) {
798803 $fileContent = Get-Content $path
@@ -805,8 +810,8 @@ function UpdateExistingSDKByInputFiles()
805810 $fileContent -replace $regexToFindSha , " $repoHttpsUrl /blob/$headSha /" | Set-Content - Path $path
806811
807812 $sdkpath = (get-item $path ).Directory.Parent.FullName | Resolve-Path - Relative
808- if (! $sdksInfo.Contains ($sdkpath )) {
809- $sdksInfo += @ ($sdkpath )
813+ if (! $sdksInfo.ContainsKey ($sdkpath )) {
814+ $sdksInfo.Add ($sdkpath , $inputFilePath )
810815 }
811816 break
812817 }
@@ -815,11 +820,14 @@ function UpdateExistingSDKByInputFiles()
815820 }
816821
817822 # generate SDK
818- foreach ($sdkpath in $sdksInfo ) {
823+ foreach ($sdkPath in $sdksInfo.Keys ) {
819824 $path = , $sdkPath
825+ $inputFile = $sdksInfo [" $sdkPath " ]
826+ $inputFile -match " specification/(?<service>.*)/(?<serviceType>.*)"
827+ $serviceType = $matches [" serviceType" ]
820828 $projectFolder = Join-Path $sdkRootPath $sdkPath
821829 $projectFolder = Resolve-Path - Path $projectFolder
822- GeneratePackage - projectFolder $projectFolder - sdkRootPath $sdkRootPath - path $path - downloadUrlPrefix " $downloadUrlPrefix " - generatedSDKPackages $generatedSDKPackages
830+ GeneratePackage - projectFolder $projectFolder - sdkRootPath $sdkRootPath - path $path - downloadUrlPrefix " $downloadUrlPrefix " - serviceType $serviceType - generatedSDKPackages $generatedSDKPackages
823831 }
824832
825833}
0 commit comments