Skip to content

Commit 7ab10e8

Browse files
committed
chore: update Web.config in update_version pwsh script
1 parent b4c5d55 commit 7ab10e8

File tree

1 file changed

+56
-1
lines changed

1 file changed

+56
-1
lines changed

scripts/update_versions.ps1

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,56 @@ function Update_ProjectVersions {
162162
}
163163
}
164164

165+
function Update_IconsWebConfig {
166+
param(
167+
[string] $webConfigContent,
168+
[string[]] $iconPackages
169+
)
170+
171+
foreach($iconPackage in $iconPackages) {
172+
$webConfigContent = Replace_Reference -fileContent $webConfigContent -oldReference "<assemblyIdentity(.+)name=""${iconPackage}""(.+)\n(.+)oldVersion=""(\d).(\d).(\d).(\d)-(\d+).(\d+).(\d+)" -newReference "<assemblyIdentity name=""${iconPackage}"" publicKeyToken=""20b4b0547069c4f8"" culture=""neutral"" />
173+
<bindingRedirect oldVersion=""0.0.0.0-${newIconsVersion}"
174+
175+
$webConfigContent = Replace_Reference -fileContent $webConfigContent -oldReference "<assemblyIdentity(.+)name=""${iconPackage}""(.+)\n(.+)newVersion=""(\d+).(\d+).(\d+)" -newReference "<assemblyIdentity name=""${iconPackage}"" publicKeyToken=""20b4b0547069c4f8"" culture=""neutral"" />
176+
<bindingRedirect oldVersion=""0.0.0.0-${newIconsVersion}"" newVersion=""${newIconsVersion}"
177+
}
178+
179+
return $webConfigContent
180+
}
181+
182+
function Update_LicensingWebConfig {
183+
param(
184+
[string] $webConfigContent
185+
)
186+
187+
$webConfigContent = Replace_Reference -fileContent $webConfigContent -oldReference "<assemblyIdentity(.+)name=""Telerik.Licensing.Runtime""(.+)\n(.+)oldVersion=""(\d).(\d).(\d).(\d)-(\d+).(\d+).(\d+)" -newReference "<assemblyIdentity name=""Telerik.Licensing.Runtime"" publicKeyToken=""98bb5b04e55c09ef"" culture=""neutral"" />
188+
<bindingRedirect oldVersion=""0.0.0.0-${newLicensingVersion}"
189+
190+
191+
$webConfigContent = Replace_Reference -fileContent $webConfigContent -oldReference "<assemblyIdentity(.+)name=""Telerik.Licensing.Runtime""(.+)\n(.+)newVersion=""(\d+).(\d+).(\d+)" -newReference "<assemblyIdentity name=""Telerik.Licensing.Runtime"" publicKeyToken=""98bb5b04e55c09ef"" culture=""neutral"" />
192+
<bindingRedirect oldVersion=""0.0.0.0-${newLicensingVersion}"" newVersion=""${newLicensingVersion}"
193+
194+
return $webConfigContent
195+
}
196+
197+
function Update_WebConfig {
198+
param(
199+
[string[]]$webConfigPathsToUpdate
200+
)
201+
202+
foreach($webConfigPath in $webConfigPathsToUpdate) {
203+
if(Test-Path $webConfigPath) {
204+
$webConfigContent = Get-Content -Path $webConfigPath -Raw
205+
206+
$webConfigContent = Update_IconsWebConfig -webConfigContent $webConfigContent -iconPackages $iconPackages
207+
$webConfigContent = Update_LicensingWebConfig -webConfigContent $webConfigContent
208+
}
209+
210+
211+
$webConfigContent | Set-Content -Path $webConfigPath -NoNewline
212+
}
213+
}
214+
165215
$layoutPathsToUpdate = @(
166216
'Telerik.Examples.Mvc\Telerik.Examples.Mvc\Views\Shared\_Layout.cshtml'
167217
)
@@ -174,6 +224,10 @@ $packagesConfigPathsToUpdate = @(
174224
'Telerik.Examples.Mvc\Telerik.Examples.Mvc\packages.config'
175225
)
176226

227+
$webConfigPathsToUpdate = @(
228+
'Telerik.Examples.Mvc\Web.config'
229+
)
230+
177231
$dplPackages = @(
178232
'Telerik.Documents.Core',
179233
'Telerik.Documents.Core',
@@ -192,4 +246,5 @@ $iconPackages = @(
192246

193247
Update_LayoutVersions -layoutPathsToUpdate $layoutPathsToUpdate
194248
Update_PackagesConfig -packagesConfigPathsToUpdate $packagesConfigPathsToUpdate
195-
Update_ProjectVersions -csprojPathsToUpdate $csprojPathsToUpdate
249+
Update_ProjectVersions -csprojPathsToUpdate $csprojPathsToUpdate
250+
Update_WebConfig -webConfigPathsToUpdate $webConfigPathsToUpdate

0 commit comments

Comments
 (0)