Skip to content

Commit ed15ba3

Browse files
committed
Work CI-CD
- Improve udpate PS1 so it takes care of all the changes in all the files. ***NO_CI***
1 parent 34b006a commit ed15ba3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

azure-pipelines/update-dependents.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
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+
116
"Updating dependency at nf-Visual-Studio-extension" | Write-Host
217

318
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
@@ -66,6 +81,19 @@ $repoStatus = "$(git status --short --porcelain)"
6681

6782
if ($repoStatus -ne "")
6883
{
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+
6997
# create branch to perform updates
7098
git branch $newBranchName
7199

0 commit comments

Comments
 (0)