diff --git a/src/Common/Commands.Common.Storage/Properties/AssemblyInfo.cs b/src/Common/Commands.Common.Storage/Properties/AssemblyInfo.cs index 8327bc4dc1db..52c4da5c15cc 100644 --- a/src/Common/Commands.Common.Storage/Properties/AssemblyInfo.cs +++ b/src/Common/Commands.Common.Storage/Properties/AssemblyInfo.cs @@ -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")] diff --git a/src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs b/src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs index 50b5ad188983..e1cdf260da12 100644 --- a/src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs +++ b/src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs @@ -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")] diff --git a/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj b/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj index 79ece160c2c0..623938da3556 100644 --- a/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj +++ b/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj @@ -173,6 +173,7 @@ + diff --git a/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Properties/AssemblyInfo.cs b/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..0bafdf8af67a --- /dev/null +++ b/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Properties/AssemblyInfo.cs @@ -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)] diff --git a/tools/ARMIncrementVersion.ps1 b/tools/ARMIncrementVersion.ps1 index 7577acc96958..0375ee2e90b3 100644 --- a/tools/ARMIncrementVersion.ps1 +++ b/tools/ARMIncrementVersion.ps1 @@ -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 @@ -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] } diff --git a/tools/ASMIncrementVersion.ps1 b/tools/ASMIncrementVersion.ps1 index 81808c41418a..d73744461d64 100644 --- a/tools/ASMIncrementVersion.ps1 +++ b/tools/ASMIncrementVersion.ps1 @@ -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 @@ -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] } diff --git a/tools/CommonIncrementVersion.ps1 b/tools/CommonIncrementVersion.ps1 new file mode 100644 index 000000000000..22bcfa816610 --- /dev/null +++ b/tools/CommonIncrementVersion.ps1 @@ -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 \ No newline at end of file diff --git a/tools/PreparePSRelease.ps1 b/tools/PreparePSRelease.ps1 new file mode 100644 index 000000000000..5fdf068fac8a --- /dev/null +++ b/tools/PreparePSRelease.ps1 @@ -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 \ No newline at end of file diff --git a/tools/SetMsiVersion.ps1 b/tools/SetMsiVersion.ps1 new file mode 100644 index 000000000000..5e33c3eaf421 --- /dev/null +++ b/tools/SetMsiVersion.ps1 @@ -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("", "") + + 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("", "") + + 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 \ No newline at end of file