Skip to content

Commit 6f87c0b

Browse files
authored
Merge branch 'dev' into feature/math-dep-remove
2 parents c4e8d99 + 8adaed2 commit 6f87c0b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Scripts/validateMavenVersion.ps1

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,22 @@
99
Retrieves the local, Maven, and Bintray versions of the Java-Core build.
1010
Checks that the Maven and Bintray versions are aligned, trigger warning if not.
1111
Checks that the current local version is greater than those currently deployed.
12+
.Parameter propertiesPath
1213
#>
1314

14-
.Parameter packageName
15-
.Parameter propertiesPath
1615

1716
Param(
18-
[parameter(Mandatory = $true)]
19-
[string]$packageName,
20-
21-
[parameter(Mandatory = $true)]
2217
[string]$propertiesPath
2318
)
2419

2520
#Find the local version from the Gradle.Properties file
21+
if($propertiesPath -eq "" -or $null -eq $propertiesPath) {
22+
$propertiesPath = Join-Path -Path $PSScriptRoot -ChildPath "../gradle.properties"
23+
}
2624
$file = get-item $propertiesPath
2725
$findLocalVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
2826
$findLocalVersions = $findLocalVersions -split "`r`n"
27+
$packageName = ($file | Select-String -Pattern "mavenArtifactId").Line.Split("=")[1].Trim()
2928

3029
$localMajor = $findLocalVersions[0].Substring($findLocalVersions[0].Length-1)
3130
$localMinor = $findLocalVersions[1].Substring($findLocalVersions[1].Length-1)
@@ -60,9 +59,9 @@ if($mavenVersion -ne $bintrayVersion){
6059
Write-Warning "The current Maven and Bintray versions are not the same"
6160
}
6261
#Success if Local version has been updated, Error otherwise.
63-
if($localVersion -gt $bintrayVersion){
62+
if($localVersion -gt $bintrayVersion -and $localVersion -gt $mavenVersion){
6463
Write-Host "The current pull request is of a greater version"
6564
}
6665
else{
6766
Write-Error "The current local version is not updated. Please update the local version in the Gradle.Properties file."
68-
}
67+
}

0 commit comments

Comments
 (0)