Skip to content

Commit

Permalink
Add check preventing the build with Groovy 2.5 and Java 17+ ...
Browse files Browse the repository at this point in the history
this prevents an unintuitive error message in the Spock build
  • Loading branch information
leonard84 committed Feb 16, 2022
1 parent a6c71f7 commit 4d5c0de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ext {
baseVersion = "2.2"
snapshotVersion = true
milestone = 0
javaVersions = [8, 11, 17] // ensure that latest version is actually build on travis, otherwise no docs get published
javaVersion = (System.getProperty("javaVersion") ?: 8) as int
variants = [2.5, 3.0, 4.0]
variant = System.getProperty("variant") as BigDecimal ?: variants.first()
buildScan.tag "groovy-$variant"
Expand All @@ -23,6 +25,9 @@ ext {
groovyVersion = "2.5.15"
minGroovyVersion = "2.5.0"
maxGroovyVersion = "2.9.99"
if(javaVersion >= 17) {
throw new InvalidUserDataException("Groovy $variant is not compatible with Java $javaVersion")
}
} else if (variant == 3.0) {
groovyGroup = "org.codehaus.groovy"
groovyVersion = "3.0.9"
Expand Down Expand Up @@ -51,8 +56,6 @@ ext {
}
fullVersion = baseVersion + ((!snapshotVersion && milestone) ? "-M$milestone" : "") + "-groovy-$variant" + (snapshotVersion ? "-SNAPSHOT" : '')
variantLessVersion = baseVersion + (snapshotVersion ? "-SNAPSHOT" : (milestone ? "-M$milestone" : ""))
javaVersions = [8, 11, 17] // ensure that latest version is actually build on travis, otherwise no docs get published
javaVersion = (System.getProperty("javaVersion") ?: 8) as int
buildScan.tag "Java $javaVersion"

libs = [
Expand Down

0 comments on commit 4d5c0de

Please sign in to comment.