|
| 1 | +function UpdateTestFrameworkVersion { |
| 2 | + Param( |
| 3 | + [string] $NewVersion, |
| 4 | + [string] $FilePath |
| 5 | + ) |
| 6 | + |
| 7 | + $versionRegex1 = "nanoFramework\.TestFramework\.\s*\d+\.\s*\d+\.\s*\d+" |
| 8 | + $versionRegex2 = "id=\""nanoFramework\.TestFramework\"" version=\""\s*\d+\.\s*\d+\.\s*\d+" |
| 9 | + |
| 10 | + $filecontent = Get-Content($FilePath) |
| 11 | + attrib $FilePath -r |
| 12 | + $filecontent -replace $versionRegex1, "nanoFramework.TestFramework.$NewVersion" | Out-File $FilePath -Encoding utf8 |
| 13 | + $filecontent -replace $versionRegex2, "id=""nanoFramework.TestFramework"" version=""$NewVersion" | Out-File $FilePath -Encoding utf8 |
| 14 | +} |
| 15 | + |
1 | 16 | "Updating dependency at nf-Visual-Studio-extension" | Write-Host |
2 | 17 |
|
3 | 18 | # compute authorization header in format "AUTHORIZATION: basic 'encoded token'" |
@@ -66,6 +81,19 @@ $repoStatus = "$(git status --short --porcelain)" |
66 | 81 |
|
67 | 82 | if ($repoStatus -ne "") |
68 | 83 | { |
| 84 | + # update the extension manifests |
| 85 | + UpdateTestFrameworkVersion -NewVersion $packageTargetVersion -FilePath 'VisualStudio.Extension-2019/source.extension.vsixmanifest' |
| 86 | + UpdateTestFrameworkVersion -NewVersion $packageTargetVersion -FilePath 'VisualStudio.Extension-2022/source.extension.vsixmanifest' |
| 87 | + |
| 88 | + # update the project templates |
| 89 | + UpdateTestFrameworkVersion -NewVersion $packageTargetVersion -FilePath 'CSharp.TestApplication/CS.TestApplication-vs2019.vstemplate' |
| 90 | + UpdateTestFrameworkVersion -NewVersion $packageTargetVersion -FilePath 'CSharp.TestApplication/CS.TestApplication-vs2022.vstemplate' |
| 91 | + UpdateTestFrameworkVersion -NewVersion $packageTargetVersion -FilePath 'CSharp.TestApplication/NFUnitTest.nfproj' |
| 92 | + |
| 93 | + # update remaining project refs |
| 94 | + UpdateTestFrameworkVersion -NewVersion $packageTargetVersion -FilePath 'VisualStudio.Extension-2019/VisualStudio.Extension-vs2019.csproj' |
| 95 | + UpdateTestFrameworkVersion -NewVersion $packageTargetVersion -FilePath 'VisualStudio.Extension-2022/VisualStudio.Extension-vs2022.csproj' |
| 96 | + |
69 | 97 | # create branch to perform updates |
70 | 98 | git branch $newBranchName |
71 | 99 |
|
|
0 commit comments