File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ [CmdletBinding ()]
2
+ Param (
3
+ [Parameter (Mandatory = $True , Position = 0 )]
4
+ [String ]$Version ,
5
+ [Parameter (Mandatory = $False , Position = 1 )]
6
+ [String ]$Folder
7
+ )
8
+
9
+ function SetCommandsCommonVersion ([string ]$FilePath , [string ]$Version )
10
+ {
11
+ $powershellCs = Join-Path $FilePath " Common\Commands.Common\AzurePowerShell.cs"
12
+
13
+ Write-Output " Updating File: $powershellCs "
14
+ $content = Get-Content $powershellCs
15
+ $content = $content -replace " public const string AssemblyVersion = `" ([\d\.]+)`" ;" , " public const string AssemblyVersion = `" $Version `" ;"
16
+ $content = $content -replace " public const string AssemblyFileVersion = `" ([\d\.]+)`" ;" , " public const string AssemblyFileVersion = `" $Version `" ;"
17
+
18
+ Set-Content - Path $powershellCs - Value $content - Encoding UTF8
19
+ }
20
+
21
+ function SetArmCommonVersion ([string ]$FilePath , [string ]$Version )
22
+ {
23
+ $assemblyConfig = Join-Path $FilePath " ResourceManager\Common\Commands.ResourceManager.Common\Properties\AssemblyInfo.cs"
24
+
25
+ Write-Output " Updating File: $assemblyConfig "
26
+ $content = Get-Content $assemblyConfig
27
+ $content = $content -replace " \[assembly: AssemblyVersion\([\w\`" \.]+\)\]" , " [assembly: AssemblyVersion(`" $Version `" )]"
28
+ $content = $content -replace " \[assembly: AssemblyFileVersion\([\w\`" \.]+\)\]" , " [assembly: AssemblyFileVersion(`" $Version `" )]"
29
+
30
+ Set-Content - Path $assemblyConfig - Value $content - Encoding UTF8
31
+ }
32
+
33
+ if (! $Folder )
34
+ {
35
+ $Folder = " $PSScriptRoot \..\src"
36
+ }
37
+
38
+ SetCommandsCommonVersion $Folder $Version
39
+ SetArmCommonVersion $Folder $Version
Original file line number Diff line number Diff line change 22
22
.\ARMIncrementVersion.ps1 " $PSScriptRoot \..\src\Common\Storage" - Major $Major.IsPresent - Minor $Minor.IsPresent - Patch $Patch.IsPresent
23
23
.\ARMSyncVersion.ps1 " $PSScriptRoot \..\src\Common\Storage"
24
24
.\ARMIncrementVersion.ps1 " $PSScriptRoot \AzureRM" - Major $Major.IsPresent - Minor $Minor.IsPresent - Patch $Patch.IsPresent
25
+ .\CommonIncrementVersion.ps1 $Version $Folder
25
26
.\SetMsiVersion.ps1 $Version $Release $Folder
You can’t perform that action at this time.
0 commit comments