88. Description
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.
11- Checks that the current local version is greater than those currently deployed.
12- . Parameter packageName
13- The package name to search in the Maven and JCenter repositories.
11+ Checks that the current local version is greater than those currently deployed.
1412. Parameter propertiesPath
1513 The path pointing to the Gradle.Properties file.
1614#>
1715
18- Param (
19- [parameter (Mandatory = $true )]
20- [string ]$packageName ,
2116
22- [ parameter ( Mandatory = $true )]
17+ Param (
2318 [string ]$propertiesPath
2419)
2520
2621# Find the local version from the Gradle.Properties file
22+ if ($propertiesPath -eq " " -or $null -eq $propertiesPath ) {
23+ $propertiesPath = Join-Path - Path $PSScriptRoot - ChildPath " ../gradle.properties"
24+ }
2725$file = get-item $propertiesPath
2826$findLocalVersions = $file | Select-String - Pattern " mavenMajorVersion" - Context 0 , 2
2927$findLocalVersions = $findLocalVersions -split " `r`n "
28+ $packageName = ($file | Select-String - Pattern " mavenArtifactId" ).Line.Split(" =" )[1 ].Trim()
3029
3130$localMajor = $findLocalVersions [0 ].Substring($findLocalVersions [0 ].Length- 1 )
3231$localMinor = $findLocalVersions [1 ].Substring($findLocalVersions [1 ].Length- 1 )
@@ -61,9 +60,9 @@ if($mavenVersion -ne $bintrayVersion){
6160 Write-Warning " The current Maven and Bintray versions are not the same"
6261}
6362# Success if Local version has been updated, Error otherwise.
64- if ($localVersion -gt $bintrayVersion ){
63+ if ($localVersion -gt $bintrayVersion -and $localVersion -gt $mavenVersion ){
6564 Write-Host " The current pull request is of a greater version"
6665}
6766else {
6867 Write-Error " The current local version is not updated. Please update the local version in the Gradle.Properties file."
69- }
68+ }
0 commit comments