Skip to content

Commit 6e4bc47

Browse files
author
Hovsep Mkrtchyan
committed
* fixed version increment script for ARM packages.
* Fixed AssemblyInfo.cs for Storage dataplane
1 parent d623b3f commit 6e4bc47

File tree

2 files changed

+39
-35
lines changed

2 files changed

+39
-35
lines changed

src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
// You can specify all the values or you can default the Build and Revision Numbers
4545
// by using the '*' as shown below:
4646
// [assembly: AssemblyVersion("1.0.*")]
47-
[assembly: AssemblyVersion(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyVersion)]
48-
[assembly: AssemblyFileVersion(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyFileVersion)]
47+
[assembly: AssemblyVersion("1.0.3")]
48+
[assembly: AssemblyFileVersion("1.0.3")]
4949

5050
#if SIGN
5151
[assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Storage.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]

tools/ARMIncrementVersion.ps1

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,44 @@ Param(
1414
function IncrementVersion([string]$FilePath)
1515
{
1616
Write-Output "Updating File: $FilePath"
17-
$content = Get-Content $FilePath
18-
$matches = ([regex]::matches($content, "ModuleVersion = '([\d\.]+)'"))
17+
(Get-Content $FilePath) |
18+
ForEach-Object {
19+
$matches = ([regex]::matches($_, "ModuleVersion = '([\d\.]+)'"))
1920

20-
$packageVersion = $matches.Groups[1].Value
21-
$version = $packageVersion.Split(".")
22-
23-
$cMajor = $Major
24-
$cMinor = $Minor
25-
$cPatch = $Patch
26-
27-
if ($cMajor)
28-
{
29-
$version[0] = 1 + $version[0]
30-
$version[1] = "0"
31-
$version[2] = "0"
32-
}
33-
34-
if ($cMinor)
35-
{
36-
$version[1] = 1 + $version[1]
37-
$version[2] = "0"
38-
}
39-
40-
if ($cPatch)
41-
{
42-
$version[2] = 1 + $version[2]
43-
}
44-
45-
$version = [String]::Join(".", $version)
46-
47-
Write-Output "Updating version of $FilePath from $packageVersion to $version"
48-
$content = $content.Replace("ModuleVersion = '$packageVersion'", "ModuleVersion = '$version'")
49-
50-
Set-Content -Path $FilePath -Value $content -Encoding UTF8
21+
if($matches.Count -eq 1)
22+
{
23+
$packageVersion = $matches.Groups[1].Value
24+
$version = $packageVersion.Split(".")
25+
26+
$cMajor = $Major
27+
$cMinor = $Minor
28+
$cPatch = $Patch
29+
30+
if ($cMajor)
31+
{
32+
$version[0] = 1 + $version[0]
33+
$version[1] = "0"
34+
$version[2] = "0"
35+
}
36+
37+
if ($cMinor)
38+
{
39+
$version[1] = 1 + $version[1]
40+
$version[2] = "0"
41+
}
42+
43+
if ($cPatch)
44+
{
45+
$version[2] = 1 + $version[2]
46+
}
47+
48+
$version = [String]::Join(".", $version)
49+
$_.Replace("ModuleVersion = '$packageVersion'", "ModuleVersion = '$version'")
50+
} else {
51+
$_
52+
}
53+
54+
} | Set-Content -Path $FilePath -Encoding UTF8
5155
}
5256

5357
if (!$Folder)

0 commit comments

Comments
 (0)