|
9 | 9 | Retrieves the local, Maven, and Bintray versions of the Java-Core build. |
10 | 10 | Checks that the Maven and Bintray versions are aligned, trigger warning if not. |
11 | 11 | Checks that the current local version is greater than those currently deployed. |
| 12 | +.Parameter propertiesPath |
12 | 13 | #> |
13 | 14 |
|
14 | | -.Parameter packageName |
15 | | -.Parameter propertiesPath |
16 | 15 |
|
17 | 16 | Param( |
18 | | - [parameter(Mandatory = $true)] |
19 | | - [string]$packageName, |
20 | | - |
21 | | - [parameter(Mandatory = $true)] |
22 | 17 | [string]$propertiesPath |
23 | 18 | ) |
24 | 19 |
|
25 | 20 | #Find the local version from the Gradle.Properties file |
| 21 | +if($propertiesPath -eq "" || $null -eq $propertiesPath) { |
| 22 | + $propertiesPath = Join-Path -Path $PSScriptRoot -ChildPath "../gradle.properties" |
| 23 | +} |
26 | 24 | $file = get-item $propertiesPath |
27 | 25 | $findLocalVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2 |
28 | 26 | $findLocalVersions = $findLocalVersions -split "`r`n" |
| 27 | +$packageName = ($file | Select-String -Pattern "mavenArtifactId").Line.Split("=")[1].Trim() |
29 | 28 |
|
30 | 29 | $localMajor = $findLocalVersions[0].Substring($findLocalVersions[0].Length-1) |
31 | 30 | $localMinor = $findLocalVersions[1].Substring($findLocalVersions[1].Length-1) |
@@ -60,7 +59,7 @@ if($mavenVersion -ne $bintrayVersion){ |
60 | 59 | Write-Warning "The current Maven and Bintray versions are not the same" |
61 | 60 | } |
62 | 61 | #Success if Local version has been updated, Error otherwise. |
63 | | -if($localVersion -gt $bintrayVersion){ |
| 62 | +if($localVersion -gt $bintrayVersion && $localVersion -gt $mavenVersion){ |
64 | 63 | Write-Host "The current pull request is of a greater version" |
65 | 64 | } |
66 | 65 | else{ |
|
0 commit comments