Skip to content

[#112641071] Update tools to update module dependencies in the rollup module #1933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Common/Commands.Common.Storage/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
[assembly: Guid("c565107e-98a9-4703-85cd-a7efc3d8da7b")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyVersion("1.0.5")]
[assembly: AssemblyFileVersion("1.0.5")]
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4")]
[assembly: AssemblyFileVersion("1.0.4")]
[assembly: AssemblyVersion("1.0.5")]
[assembly: AssemblyFileVersion("1.0.5")]

#if SIGN
[assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Storage.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Billing\GetAzureRemoteAppPlan.cs" />
<Compile Include="Collection\GetAzureRemoteAppCollectionUsageDetails.cs" />
<Compile Include="Collection\GetAzureRemoteAppCollectionUsageSummary.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft Azure Powershell")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft Azure Powershell")]
[assembly: AssemblyCopyright("Copyright © Microsoft")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("1.0.5")]
[assembly: AssemblyFileVersion("1.0.5")]
[assembly: CLSCompliant(false)]
18 changes: 9 additions & 9 deletions tools/ARMIncrementVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Param(
[Parameter(Mandatory=$False, Position=0)]
[String]$Folder,
[Parameter(ParameterSetName="Major", Mandatory=$True)]
[Switch]$Major,
[Parameter(ParameterSetName="Minor", Mandatory=$True)]
[Switch]$Minor,
[Parameter(ParameterSetName="Patch", Mandatory=$True)]
[Switch]$Patch
[Parameter(Mandatory=$False)]
[bool]$Major,
[Parameter(Mandatory=$False)]
[bool]$Minor,
[Parameter(Mandatory=$False)]
[bool]$Patch
)

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

if ($cMajor)
if ($cMajor -eq $true)
{
$version[0] = 1 + $version[0]
$version[1] = "0"
$version[2] = "0"
}

if ($cMinor)
if ($cMinor -eq $true)
{
$version[1] = 1 + $version[1]
$version[2] = "0"
}

if ($cPatch)
if ($cPatch -eq $true)
{
$version[2] = 1 + $version[2]
}
Expand Down
18 changes: 9 additions & 9 deletions tools/ASMIncrementVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Param(
[Parameter(Mandatory=$False, Position=0)]
[String]$Folder,
[Parameter(ParameterSetName="Major", Mandatory=$True)]
[Switch]$Major,
[Parameter(ParameterSetName="Minor", Mandatory=$True)]
[Switch]$Minor,
[Parameter(ParameterSetName="Patch", Mandatory=$True)]
[Switch]$Patch
[Parameter(Mandatory=$False)]
[bool]$Major,
[Parameter(Mandatory=$False)]
[bool]$Minor,
[Parameter(Mandatory=$False)]
[bool]$Patch
)

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

if ($cMajor)
if ($cMajor -eq $true)
{
$version[0] = 1 + $version[0]
$version[1] = "0"
$version[2] = "0"
}

if ($cMinor)
if ($cMinor -eq $true)
{
$version[1] = 1 + $version[1]
$version[2] = "0"
}

if ($cPatch)
if ($cPatch -eq $true)
{
$version[2] = 1 + $version[2]
}
Expand Down
39 changes: 39 additions & 0 deletions tools/CommonIncrementVersion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$Version,
[Parameter(Mandatory=$False, Position=1)]
[String]$Folder
)

function SetCommandsCommonVersion([string]$FilePath, [string]$Version)
{
$powershellCs = Join-Path $FilePath "Common\Commands.Common\AzurePowerShell.cs"

Write-Output "Updating File: $powershellCs"
$content = Get-Content $powershellCs
$content = $content -replace "public const string AssemblyVersion = `"([\d\.]+)`";", "public const string AssemblyVersion = `"$Version`";"
$content = $content -replace "public const string AssemblyFileVersion = `"([\d\.]+)`";", "public const string AssemblyFileVersion = `"$Version`";"

Set-Content -Path $powershellCs -Value $content -Encoding UTF8
}

function SetArmCommonVersion([string]$FilePath, [string]$Version)
{
$assemblyConfig = Join-Path $FilePath "ResourceManager\Common\Commands.ResourceManager.Common\Properties\AssemblyInfo.cs"

Write-Output "Updating File: $assemblyConfig"
$content = Get-Content $assemblyConfig
$content = $content -replace "\[assembly: AssemblyVersion\([\w\`"\.]+\)\]", "[assembly: AssemblyVersion(`"$Version`")]"
$content = $content -replace "\[assembly: AssemblyFileVersion\([\w\`"\.]+\)\]", "[assembly: AssemblyFileVersion(`"$Version`")]"

Set-Content -Path $assemblyConfig -Value $content -Encoding UTF8
}

if (!$Folder)
{
$Folder = "$PSScriptRoot\..\src"
}

SetCommandsCommonVersion $Folder $Version
SetArmCommonVersion $Folder $Version
26 changes: 26 additions & 0 deletions tools/PreparePSRelease.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# e.g. .\PreparePSRelease.ps1 9.10.11 "Spring 2018" -Patch
#
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$Version,
[Parameter(Mandatory=$True, Position=1)]
[String]$Release,
[Parameter(Mandatory=$False, Position=2)]
[String]$Folder,
[Parameter(ParameterSetName="Major")]
[Switch]$Major,
[Parameter(ParameterSetName="Minor")]
[Switch]$Minor,
[Parameter(ParameterSetName="Patch")]
[Switch]$Patch
)

.\ASMIncrementVersion.ps1 $Folder -Major $Major.IsPresent -Minor $Minor.IsPresent -Patch $Patch.IsPresent
.\ARMIncrementVersion.ps1 $Folder -Major $Major.IsPresent -Minor $Minor.IsPresent -Patch $Patch.IsPresent
.\ARMSyncVersion.ps1 $Folder
.\ARMIncrementVersion.ps1 "$PSScriptRoot\..\src\Common\Storage" -Major $Major.IsPresent -Minor $Minor.IsPresent -Patch $Patch.IsPresent
.\ARMSyncVersion.ps1 "$PSScriptRoot\..\src\Common\Storage"
.\ARMIncrementVersion.ps1 "$PSScriptRoot\AzureRM" -Major $Major.IsPresent -Minor $Minor.IsPresent -Patch $Patch.IsPresent
.\CommonIncrementVersion.ps1 $Version $Folder
.\SetMsiVersion.ps1 $Version $Release $Folder
77 changes: 77 additions & 0 deletions tools/SetMsiVersion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$Version,
[Parameter(Mandatory=$True, Position=1)]
[String]$Release,
[Parameter(Mandatory=$False, Position=2)]
[String]$Folder
)

function SetMsiVersion([string]$FilePath, [string]$MsiVersion)
{
$wxsPath = Join-Path $FilePath "setup\azurecmd.wxs"

Write-Output "Updating File: $wxsPath"
$content = Get-Content $wxsPath
$matches = ([regex]::matches($content, '\<\?define version="([\d\.]+)" \?\>'))

$prevousVersion = $matches.Groups[1].Value

$content = $content.Replace("<?define version=`"$prevousVersion`" ?>", "<?define version=`"$MsiVersion`" ?>")

Set-Content -Path $wxsPath -Value $content -Encoding UTF8
}

function SetMsiReleaseString([string]$FilePath, [string]$MsiRelease)
{
$wxsPath = Join-Path $FilePath "setup\azurecmd.wxs"

Write-Output "Updating File: $wxsPath"
$content = Get-Content $wxsPath
$matches = ([regex]::matches($content, '\<\?define productName="Microsoft Azure PowerShell - ([a-zA-z]+\s[\d]+)" \?\>'))

$prevousVersion = $matches.Groups[1].Value

$content = $content.Replace("<?define productName=`"Microsoft Azure PowerShell - $prevousVersion`" ?>", "<?define productName=`"Microsoft Azure PowerShell - $MsiRelease`" ?>")

Set-Content -Path $wxsPath -Value $content -Encoding UTF8
}

function AlignAsmPsdReleaseVersion([string]$FilePath, [string]$MsiVersion)
{
$psd1Path = Join-Path $FilePath "src\ServiceManagement\Services\Commands.Utilities\Azure.psd1"

$content = Get-Content $psd1Path
$matches = ([regex]::matches($content, "ModuleVersion = '([\d\.]+)'\s+"))

$packageVersion = $matches.Groups[1].Value
Write-Output "Updating version of $psd1Path from $packageVersion to $MsiVersion"
$content = $content.Replace("ModuleVersion = '$packageVersion'", "ModuleVersion = '$MsiVersion'")

Set-Content -Path $psd1Path -Value $content -Encoding UTF8
}

function AlignArmPsdReleaseVersion([string]$FilePath, [string]$MsiVersion)
{
$psd1Path = Join-Path $FilePath "tools\AzureRM\AzureRM.psd1"

$content = Get-Content $psd1Path
$matches = ([regex]::matches($content, "ModuleVersion = '([\d\.]+)'\s+"))

$packageVersion = $matches.Groups[1].Value
Write-Output "Updating version of $psd1Path from $packageVersion to $MsiVersion"
$content = $content.Replace("ModuleVersion = '$packageVersion'", "ModuleVersion = '$MsiVersion'")

Set-Content -Path $psd1Path -Value $content -Encoding UTF8
}

if (!$Folder)
{
$Folder = "$PSScriptRoot\.."
}

SetMsiVersion $Folder $Version
SetMsiReleaseString $Folder $Release
AlignAsmPsdReleaseVersion $Folder $Version
AlignArmPsdReleaseVersion $Folder $Version