@@ -132,6 +132,35 @@ stages:
132132 # (cd "$dir" && npx ig upgrade-packages --skip-install)
133133 # fi
134134 # done
135+
136+ - task : PowerShell@2
137+ displayName : ' Replace references to IG trial packages with licensed ones'
138+ inputs :
139+ failOnStderr : true
140+ showWarnings : true
141+ workingDirectory : ' $(Build.SourcesDirectory)'
142+ targetType : ' inline'
143+ script : |
144+ $packageJson = Get-Content -Raw .\package.json | ConvertFrom-Json
145+ $properties = $packageJson.dependencies.PSObject.Properties `
146+ | where-object { $_.Name.StartsWith("igniteui-react") -or $_.Name.StartsWith("igniteui-dockmanager") }
147+
148+ foreach( $property in $properties )
149+ {
150+ $oldName = $property.Name;
151+ $newName = "@infragistics/" + $oldName
152+
153+ # remember the current value of the old property
154+ $value = $property.Value;
155+
156+ # remove reference to the trial package reference
157+ $packageJson.dependencies.psobject.Properties.Remove($oldName);
158+
159+ # add reference to the licensed package reference
160+ $packageJson.dependencies | Add-Member -NotePropertyName $newName -NotePropertyValue $value;
161+ }
162+
163+ ConvertTo-Json -InputObject $packageJson | Set-Content -Path .\package.json
135164
136165 - task : Npm@1
137166 displayName : ' npm install --legacy-peer-deps'
@@ -141,6 +170,18 @@ stages:
141170 workingDir : ' $(Build.SourcesDirectory)'
142171 customCommand : ' install --legacy-peer-deps'
143172
173+ - task : PowerShell@2
174+ displayName : ' Replace references to IG trial packages with licensed ones in TSX files'
175+ inputs :
176+ failOnStderr : true
177+ showWarnings : true
178+ workingDirectory : ' $(Build.SourcesDirectory)'
179+ targetType : ' inline'
180+ script : |
181+ Get-ChildItem -Include "*.tsx","*.ts" -Recurse | `
182+ ForEach { (Get-Content $_.PSPath | ForEach { ($_ -replace '([from|import])\s?[''"](igniteui-[react|dockmanager].*)[''"]', '$1 "@infragistics/$2"') }) | `
183+ Set-Content $_.PSPath }
184+
144185 - task : Npm@1
145186 displayName : ' npm run build'
146187 inputs :
0 commit comments