File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ param (
2+ [Parameter (Mandatory = $true )][string ]$VersionStr
3+ )
4+
5+ # Some basic validation
6+ $Version = [System.Version ]::Parse($VersionStr )
7+
8+ $NuspecPath = " $PSScriptRoot /CloudinaryDotNet.nuspec"
9+
10+ $CsProjPaths = @ (
11+ " $PSScriptRoot /Cloudinary/Cloudinary.csproj" ,
12+ " $PSScriptRoot /Core/CloudinaryDotNet.Core.csproj"
13+ )
14+
15+ function Set-Nuspec-Version ($NuspecPath , $Version ) {
16+ $Text = [IO.File ]::ReadAllText($NuspecPath ) -replace " <version>\d+\.\d+\.?\d*</version>" , " <version>$Version </version>"
17+ [IO.File ]::WriteAllText($NuspecPath , $Text )
18+ }
19+
20+ function Set-CsProj-Version ($CsProjPath , $Version ) {
21+ $Text = [IO.File ]::ReadAllText($CsProjPath ) `
22+ -replace " <Version>\d+\.\d+\.?\d*</Version>" , " <Version>$Version </Version>" `
23+ -replace " <FileVersion>\d+\.\d+\.?\d*</FileVersion>" , " <FileVersion>$Version </FileVersion>"
24+ [IO.File ]::WriteAllText($CsProjPath , $Text )
25+ }
26+
27+ Set-Nuspec - Version $NuspecPath $Version
28+
29+ foreach ($CsProjPath in $CsProjPaths ) {
30+ Set-CsProj - Version $CsProjPath $Version
31+ }
You can’t perform that action at this time.
0 commit comments