From 7c3dd426c9e15c384911c1bbf929f15fe0a4fffa Mon Sep 17 00:00:00 2001 From: Brett Hewitson Date: Thu, 29 Dec 2022 15:21:59 +1000 Subject: [PATCH] pipeline file changes --- ...ly-semantic-versioning-to-assembyinfo-files.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.azure/pipelines/apply-semantic-versioning-to-assembyinfo-files.yml b/.azure/pipelines/apply-semantic-versioning-to-assembyinfo-files.yml index ebf9f530..832b8820 100644 --- a/.azure/pipelines/apply-semantic-versioning-to-assembyinfo-files.yml +++ b/.azure/pipelines/apply-semantic-versioning-to-assembyinfo-files.yml @@ -39,4 +39,18 @@ steps: $version = Get-VersionString -numberOfVersions $VersionNumbersInVersion -extractedBuildNumbers $extractedBuildNumbers $fileVersion = Get-VersionString -numberOfVersions $VersionNumbersInVersion -extractedBuildNumbers $extractedBuildNumbers Write-Host "Using version $version and file version $fileVersion" + + # iterate the search path (and sub directories) looking for files that match the search filter + Get-ChildItem -Path $PathToSearch -Filter $SearchFilter -Recurse | % { + Write-Host " -> Checking $($_.FullName)" + + # remove the read-only bit on the file + Set-ItemProperty $_.FullName -name IsReadOnly -value $false + + # run the regex replace + $content = Get-Content $_.FullName + $content = Replace-Version -content $content -version $version -attribute 'AssemblyVersion' + $content = Replace-Version -content $content -version $fileVersion -attribute 'AssemblyFileVersion' + $content | Set-Content $_.FullName -Encoding UTF8 + } pwsh: true