Sha256: 1388c0609f1abe421485a8a878233adf961a4721aa1bac74f073484704a728b0

Contents?: true

Size: 1.52 KB

Versions: 14

Compression:

Stored size: 1.52 KB

Contents

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

<#
.Synopsis
    Increment the minor version string in the gradle.properties if the major,
    minor, or patch version hasn't been manually updated.
.Description
    Assumptions:
        This script assumes it is run from the repo root.
        Minor version is typically auto-incremented.

#>

function Update-TelemetryVersion([string]$telemetryFilePath, [version]$version) {
	$telemetryFileContent = Get-Content -Path $telemetryFilePath -Raw
	$telemetryFileContent = $telemetryFileContent -replace "\d{1,}\.\d{1,}\.\d{1,}", $version.ToString()
	Set-Content -Path $telemetryFilePath $telemetryFileContent
}

function Get-CurrentTelemetryVersion([string]$telemetryFilePath) {
	$telemetryFileContent = Get-Content -Path $telemetryFilePath -Raw
	if($telemetryFileContent -match "(\d{1,}\.\d{1,}\.\d{1,})") {
			return [version]::Parse($Matches[1])
	} else {
			Write-Error "Invalid version number format"
			return $null;
	}
}

function Update-MinorVersionNumber([version]$currentVersion) {
	return [version]::new($currentVersion.Major, $currentVersion.Minor + 1, 0);
}

function Update-MinorVersion() {
	$telemetryFilePath = Join-Path -Path $PWD.ToString() -ChildPath "../lib/version_information.rb"
	$currentVersion = Get-CurrentTelemetryVersion -telemetryFilePath $telemetryFilePath
	$nextVersion = Update-MinorVersionNumber -currentVersion $currentVersion
	Update-TelemetryVersion -version $nextVersion -telemetryFilePath $telemetryFilePath
}
Update-MinorVersion

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
microsoft_graph-0.22.2 scripts/incrementMinorVersion.ps1
microsoft_graph_beta-0.11.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.22.1 scripts/incrementMinorVersion.ps1
microsoft_graph-0.21.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.20.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.19.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.18.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.17.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.16.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.15.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.14.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.13.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.12.0 scripts/incrementMinorVersion.ps1
microsoft_graph-0.11.0 scripts/incrementMinorVersion.ps1