@@ -177,6 +177,43 @@ function Update-CIYmlFile() {
177
177
}
178
178
}
179
179
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
+ }
180
217
<#
181
218
. SYNOPSIS
182
219
Prepare the SDK pacakge for data-plane.
@@ -334,6 +371,8 @@ function New-MgmtPackageFolder() {
334
371
Push-Location $projectFolder
335
372
dotnet new azuremgmt -- provider $packageName -- includeCI true -- force
336
373
Pop-Location
374
+
375
+ RegisterMgmtSDKToMgmtCoreClient - sdkRepoRootPath $sdkPath
337
376
}
338
377
339
378
# update the readme path.
0 commit comments