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
1716Param (
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}
6665else {
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