Skip to content

Commit d6e1b93

Browse files
author
Hovsep
committed
Merge pull request Azure#1933 from hovsepm/dev
[#112641071] Update tools to update module dependencies in the rollup module
2 parents c3bd04c + 6e4c94d commit d6e1b93

File tree

9 files changed

+200
-22
lines changed

9 files changed

+200
-22
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
[assembly: ComVisible(false)]
2525
[assembly: CLSCompliant(false)]
2626
[assembly: Guid("c565107e-98a9-4703-85cd-a7efc3d8da7b")]
27-
[assembly: AssemblyVersion("1.0.0")]
28-
[assembly: AssemblyFileVersion("1.0.0")]
27+
[assembly: AssemblyVersion("1.0.5")]
28+
[assembly: AssemblyFileVersion("1.0.5")]

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("1.0.4")]
48-
[assembly: AssemblyFileVersion("1.0.4")]
47+
[assembly: AssemblyVersion("1.0.5")]
48+
[assembly: AssemblyFileVersion("1.0.5")]
4949

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

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
</ProjectReference>
174174
</ItemGroup>
175175
<ItemGroup>
176+
<Compile Include="Properties\AssemblyInfo.cs" />
176177
<Compile Include="Billing\GetAzureRemoteAppPlan.cs" />
177178
<Compile Include="Collection\GetAzureRemoteAppCollectionUsageDetails.cs" />
178179
<Compile Include="Collection\GetAzureRemoteAppCollectionUsageSummary.cs" />
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Reflection;
17+
using System.Runtime.CompilerServices;
18+
using System.Runtime.InteropServices;
19+
20+
// General Information about an assembly is controlled through the following
21+
// set of attributes. Change these attribute values to modify the information
22+
// associated with an assembly.
23+
[assembly: AssemblyTitle("Microsoft Azure Powershell")]
24+
[assembly: AssemblyCompany("Microsoft")]
25+
[assembly: AssemblyProduct("Microsoft Azure Powershell")]
26+
[assembly: AssemblyCopyright("Copyright © Microsoft")]
27+
28+
// Setting ComVisible to false makes the types in this assembly not visible
29+
// to COM components. If you need to access a type in this assembly from
30+
// COM, set the ComVisible attribute to true on that type.
31+
[assembly: ComVisible(false)]
32+
33+
[assembly: AssemblyVersion("1.0.5")]
34+
[assembly: AssemblyFileVersion("1.0.5")]
35+
[assembly: CLSCompliant(false)]

tools/ARMIncrementVersion.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Param(
33
[Parameter(Mandatory=$False, Position=0)]
44
[String]$Folder,
5-
[Parameter(ParameterSetName="Major", Mandatory=$True)]
6-
[Switch]$Major,
7-
[Parameter(ParameterSetName="Minor", Mandatory=$True)]
8-
[Switch]$Minor,
9-
[Parameter(ParameterSetName="Patch", Mandatory=$True)]
10-
[Switch]$Patch
5+
[Parameter(Mandatory=$False)]
6+
[bool]$Major,
7+
[Parameter(Mandatory=$False)]
8+
[bool]$Minor,
9+
[Parameter(Mandatory=$False)]
10+
[bool]$Patch
1111
)
1212

1313
# Function to update nuspec file
@@ -27,20 +27,20 @@ function IncrementVersion([string]$FilePath)
2727
$cMinor = $Minor
2828
$cPatch = $Patch
2929

30-
if ($cMajor)
30+
if ($cMajor -eq $true)
3131
{
3232
$version[0] = 1 + $version[0]
3333
$version[1] = "0"
3434
$version[2] = "0"
3535
}
3636

37-
if ($cMinor)
37+
if ($cMinor -eq $true)
3838
{
3939
$version[1] = 1 + $version[1]
4040
$version[2] = "0"
4141
}
4242

43-
if ($cPatch)
43+
if ($cPatch -eq $true)
4444
{
4545
$version[2] = 1 + $version[2]
4646
}

tools/ASMIncrementVersion.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Param(
33
[Parameter(Mandatory=$False, Position=0)]
44
[String]$Folder,
5-
[Parameter(ParameterSetName="Major", Mandatory=$True)]
6-
[Switch]$Major,
7-
[Parameter(ParameterSetName="Minor", Mandatory=$True)]
8-
[Switch]$Minor,
9-
[Parameter(ParameterSetName="Patch", Mandatory=$True)]
10-
[Switch]$Patch
5+
[Parameter(Mandatory=$False)]
6+
[bool]$Major,
7+
[Parameter(Mandatory=$False)]
8+
[bool]$Minor,
9+
[Parameter(Mandatory=$False)]
10+
[bool]$Patch
1111
)
1212

1313
# Function to update nuspec file
@@ -27,20 +27,20 @@ function IncrementVersion([string]$FilePath)
2727
$cMinor = $Minor
2828
$cPatch = $Patch
2929

30-
if ($cMajor)
30+
if ($cMajor -eq $true)
3131
{
3232
$version[0] = 1 + $version[0]
3333
$version[1] = "0"
3434
$version[2] = "0"
3535
}
3636

37-
if ($cMinor)
37+
if ($cMinor -eq $true)
3838
{
3939
$version[1] = 1 + $version[1]
4040
$version[2] = "0"
4141
}
4242

43-
if ($cPatch)
43+
if ($cPatch -eq $true)
4444
{
4545
$version[2] = 1 + $version[2]
4646
}

tools/CommonIncrementVersion.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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

tools/PreparePSRelease.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# e.g. .\PreparePSRelease.ps1 9.10.11 "Spring 2018" -Patch
2+
#
3+
[CmdletBinding()]
4+
Param(
5+
[Parameter(Mandatory=$True, Position=0)]
6+
[String]$Version,
7+
[Parameter(Mandatory=$True, Position=1)]
8+
[String]$Release,
9+
[Parameter(Mandatory=$False, Position=2)]
10+
[String]$Folder,
11+
[Parameter(ParameterSetName="Major")]
12+
[Switch]$Major,
13+
[Parameter(ParameterSetName="Minor")]
14+
[Switch]$Minor,
15+
[Parameter(ParameterSetName="Patch")]
16+
[Switch]$Patch
17+
)
18+
19+
.\ASMIncrementVersion.ps1 $Folder -Major $Major.IsPresent -Minor $Minor.IsPresent -Patch $Patch.IsPresent
20+
.\ARMIncrementVersion.ps1 $Folder -Major $Major.IsPresent -Minor $Minor.IsPresent -Patch $Patch.IsPresent
21+
.\ARMSyncVersion.ps1 $Folder
22+
.\ARMIncrementVersion.ps1 "$PSScriptRoot\..\src\Common\Storage" -Major $Major.IsPresent -Minor $Minor.IsPresent -Patch $Patch.IsPresent
23+
.\ARMSyncVersion.ps1 "$PSScriptRoot\..\src\Common\Storage"
24+
.\ARMIncrementVersion.ps1 "$PSScriptRoot\AzureRM" -Major $Major.IsPresent -Minor $Minor.IsPresent -Patch $Patch.IsPresent
25+
.\CommonIncrementVersion.ps1 $Version $Folder
26+
.\SetMsiVersion.ps1 $Version $Release $Folder

tools/SetMsiVersion.ps1

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[CmdletBinding()]
2+
Param(
3+
[Parameter(Mandatory=$True, Position=0)]
4+
[String]$Version,
5+
[Parameter(Mandatory=$True, Position=1)]
6+
[String]$Release,
7+
[Parameter(Mandatory=$False, Position=2)]
8+
[String]$Folder
9+
)
10+
11+
function SetMsiVersion([string]$FilePath, [string]$MsiVersion)
12+
{
13+
$wxsPath = Join-Path $FilePath "setup\azurecmd.wxs"
14+
15+
Write-Output "Updating File: $wxsPath"
16+
$content = Get-Content $wxsPath
17+
$matches = ([regex]::matches($content, '\<\?define version="([\d\.]+)" \?\>'))
18+
19+
$prevousVersion = $matches.Groups[1].Value
20+
21+
$content = $content.Replace("<?define version=`"$prevousVersion`" ?>", "<?define version=`"$MsiVersion`" ?>")
22+
23+
Set-Content -Path $wxsPath -Value $content -Encoding UTF8
24+
}
25+
26+
function SetMsiReleaseString([string]$FilePath, [string]$MsiRelease)
27+
{
28+
$wxsPath = Join-Path $FilePath "setup\azurecmd.wxs"
29+
30+
Write-Output "Updating File: $wxsPath"
31+
$content = Get-Content $wxsPath
32+
$matches = ([regex]::matches($content, '\<\?define productName="Microsoft Azure PowerShell - ([a-zA-z]+\s[\d]+)" \?\>'))
33+
34+
$prevousVersion = $matches.Groups[1].Value
35+
36+
$content = $content.Replace("<?define productName=`"Microsoft Azure PowerShell - $prevousVersion`" ?>", "<?define productName=`"Microsoft Azure PowerShell - $MsiRelease`" ?>")
37+
38+
Set-Content -Path $wxsPath -Value $content -Encoding UTF8
39+
}
40+
41+
function AlignAsmPsdReleaseVersion([string]$FilePath, [string]$MsiVersion)
42+
{
43+
$psd1Path = Join-Path $FilePath "src\ServiceManagement\Services\Commands.Utilities\Azure.psd1"
44+
45+
$content = Get-Content $psd1Path
46+
$matches = ([regex]::matches($content, "ModuleVersion = '([\d\.]+)'\s+"))
47+
48+
$packageVersion = $matches.Groups[1].Value
49+
Write-Output "Updating version of $psd1Path from $packageVersion to $MsiVersion"
50+
$content = $content.Replace("ModuleVersion = '$packageVersion'", "ModuleVersion = '$MsiVersion'")
51+
52+
Set-Content -Path $psd1Path -Value $content -Encoding UTF8
53+
}
54+
55+
function AlignArmPsdReleaseVersion([string]$FilePath, [string]$MsiVersion)
56+
{
57+
$psd1Path = Join-Path $FilePath "tools\AzureRM\AzureRM.psd1"
58+
59+
$content = Get-Content $psd1Path
60+
$matches = ([regex]::matches($content, "ModuleVersion = '([\d\.]+)'\s+"))
61+
62+
$packageVersion = $matches.Groups[1].Value
63+
Write-Output "Updating version of $psd1Path from $packageVersion to $MsiVersion"
64+
$content = $content.Replace("ModuleVersion = '$packageVersion'", "ModuleVersion = '$MsiVersion'")
65+
66+
Set-Content -Path $psd1Path -Value $content -Encoding UTF8
67+
}
68+
69+
if (!$Folder)
70+
{
71+
$Folder = "$PSScriptRoot\.."
72+
}
73+
74+
SetMsiVersion $Folder $Version
75+
SetMsiReleaseString $Folder $Release
76+
AlignAsmPsdReleaseVersion $Folder $Version
77+
AlignArmPsdReleaseVersion $Folder $Version

0 commit comments

Comments
 (0)