File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -244,4 +244,9 @@ if ($existingCsprojPath) {
244244<#
245245 Create or refresh generate-info.json for submodule
246246#>
247- New-GenerateInfoJson - GeneratedDirectory $subModulePath
247+ New-GenerateInfoJson - GeneratedDirectory $subModulePath
248+
249+ <#
250+ Update module in tools\CreateMappings_rules.json
251+ #>
252+ Update-MappingJson - RepoRoot $RepoRoot - ModuleName $ModuleRootName
Original file line number Diff line number Diff line change @@ -226,4 +226,25 @@ function New-GenerateInfoJson {
226226 Write-Host " Generating generate-info.json file: $generateInfoJsonPath "
227227 $generateInfoJson | Set-Content - Path $generateInfoJsonPath - Force
228228 }
229+ }
230+
231+ function Update-MappingJson {
232+ Param (
233+ [string ]
234+ ${ModuleName} ,
235+ [string ]
236+ ${RepoRoot}
237+ )
238+ process {
239+ Write-Host " Updating MappingJson: CreateMappings_rules.json." - ForegroundColor Yellow
240+ $MappingPath = Join-Path $RepoRoot " tools" " CreateMappings_rules.json"
241+ $MappingObject = Get-Content - Path $MappingPath | ConvertFrom-Json
242+ Foreach ($Item in $MappingObject ) {
243+ If ($ModuleName -eq $Item.regex -or $ModuleName -eq $Item.module ) {
244+ return
245+ }
246+ }
247+ $MappingObject = $MappingObject + @ {module = $ModuleName ; alias = $ModuleName }
248+ ConvertTo-Json $MappingObject - Depth 1 | Set-Content - Path $MappingPath
249+ }
229250}
Original file line number Diff line number Diff line change 947947 {
948948 "module" : " DeviceRegistry" ,
949949 "alias" : " DeviceRegistry"
950+ },
951+ {
952+ "module" : " IoTOperationsService" ,
953+ "alias" : " IoTOperationsService"
950954 }
951955]
You can’t perform that action at this time.
0 commit comments