Skip to content

Commit

Permalink
Fix version parsing (#8897)
Browse files Browse the repository at this point in the history
The previous check assumed that we could only find `-SNAPSHOT`, but for a release,
we may have `-M1` or `-beta-1`, etc.

Fixes error seen at https://ge.micronaut.io/s/aenwsqygoz6ik
  • Loading branch information
melix authored Mar 7, 2023
1 parent da54ede commit 7f62cc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ micronautBom {

micronautBuild {
binaryCompatibility {
def (major, minor, patch) = (version - '-SNAPSHOT').split('[.]').collect { it.toInteger() }
def dash = version.indexOf('-')
def v = dash > 0 ? version.substring(0, dash) : version
def (major, minor, patch) = v.split('[.]').collect { it.toInteger() }
enabled = major > 4 || (major == 4 && minor > 0) || (major == 4 && minor == 0 && patch > 0)
}
}

0 comments on commit 7f62cc5

Please sign in to comment.