Skip to content

Commit eae025a

Browse files
committed
update the scripts
1 parent 6f42ced commit eae025a

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

Scripts/getLatestVersion.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
<#
5+
.Synopsis
6+
Retrieve the latest version of the library
7+
.Description
8+
Retrieves the latest version specified in the Gradle.Properties file
9+
Uses the retrieved values to update the enviornment variable VERSION_STRING
10+
#>
11+
12+
.Parameter propertiesPath
13+
14+
Param(
15+
[parameter(Mandatory = $true)]
16+
[string]$propertiesPath,
17+
)
18+
19+
#Retrieve the current version from the Gradle.Properties file given the specified path
20+
$file = get-item $propertiesPath
21+
$findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
22+
$findVersions = $findVersions -split "`r`n"
23+
24+
$majorVersion = $findVersions[0].Substring($findVersions[0].Length-1)
25+
$minorVersion = $findVersions[1].Substring($findVersions[1].Length-1)
26+
$patchVersion = $findVersions[2].Substring($findVersions[2].Length-1)
27+
$version = "$majorVersion.$minorVersion.$patchVersion"
28+
29+
#Update the VERSION_STRING env variable and inform the user
30+
Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
31+
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"

Scripts/validateMavenVersion.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ if(($mavenVersion -eq $null) -and ($bintrayVersion -eq $null))
5252
}
5353

5454
#Inform host of current Maven and Bintray versions
55-
write-host 'The current version in the Maven central repository is:' $mavenVersion
56-
write-host 'The current version in the Bintray central repository is:' $bintrayVersion
55+
Write-Host 'The current version in the Maven central repository is:' $mavenVersion
56+
Write-Host 'The current version in the Bintray central repository is:' $bintrayVersion
5757

5858
#Warn in case Maven and Bintray versions are not the same.
5959
if($mavenVersion -ne $bintrayVersion){

0 commit comments

Comments
 (0)