Skip to content

Commit d8c467b

Browse files
committed
register mgmt sdk to mgmt core client
1 parent cbeef9b commit d8c467b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

eng/scripts/automation/GenerateAndBuildLib.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,43 @@ function Update-CIYmlFile() {
177177
}
178178
}
179179

180+
function RegisterMgmtSDKToMgmtCoreClient () {
181+
param(
182+
[string]$sdkRepoRootPath
183+
)
184+
Write-Host "Updating mgmt core client ci.mgmt.yml"
185+
#add path for each mgmt library into Azure.ResourceManager
186+
$armCiFile = "$sdkRepoRootPath/sdk/resourcemanager/ci.mgmt.yml"
187+
$armLines = Get-Content $armCiFile
188+
$newLines = [System.Collections.ArrayList]::new()
189+
$startIndex = $track2MgmtDirs[0].FullName.IndexOf(("\sdk\")) + 1
190+
$shouldRemove = $false
191+
foreach($line in $armLines) {
192+
if($line.StartsWith(" paths:")) {
193+
$newLines.Add($line) | Out-Null
194+
$newLines.Add(" include:") | Out-Null
195+
$newLines.Add(" - sdk/resourcemanager") | Out-Null
196+
$newLines.Add(" - common/ManagementTestShared") | Out-Null
197+
$newLines.Add(" - common/ManagementCoreShared") | Out-Null
198+
foreach($dir in $track2MgmtDirs) {
199+
$newLine = " - $($dir.FullName.Substring($startIndex, $dir.FullName.Length - $startIndex).Replace('\', '/'))"
200+
$newLines.Add($newLine) | Out-Null
201+
}
202+
$shouldRemove = $true
203+
Continue
204+
}
205+
206+
if($shouldRemove) {
207+
if($line.StartsWith(" ")) {
208+
Continue
209+
}
210+
$shouldRemove = $false
211+
}
212+
213+
$newLines.Add($line) | Out-Null
214+
}
215+
Set-Content -Path $armCiFile $newLines
216+
}
180217
<#
181218
.SYNOPSIS
182219
Prepare the SDK pacakge for data-plane.
@@ -334,6 +371,8 @@ function New-MgmtPackageFolder() {
334371
Push-Location $projectFolder
335372
dotnet new azuremgmt --provider $packageName --includeCI true --force
336373
Pop-Location
374+
375+
RegisterMgmtSDKToMgmtCoreClient -sdkRepoRootPath $sdkPath
337376
}
338377

339378
# update the readme path.

0 commit comments

Comments
 (0)