Skip to content

Commit

Permalink
BUILD target Java 17 in picocli-shell-jline3 build when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop committed Aug 26, 2023
1 parent 63a2be3 commit 2f4c35c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

// Spring Boot 3.0 requires Java 17 as a minimum version
boolean useSpring3 = JavaVersion.current().majorVersion.compareTo("17") >= 0;
logger.quiet("JavaVersion=${JavaVersion.current()}")
logger.quiet("JavaVersion.majorVersion=${JavaVersion.current().majorVersion}")
logger.quiet("useSpring3=${useSpring3}")
logger.quiet("dependencies.gradle: JavaVersion=${JavaVersion.current()}")
logger.quiet("dependencies.gradle: JavaVersion.majorVersion=${JavaVersion.current().majorVersion}")
logger.quiet("dependencies.gradle: useSpring3=${useSpring3}")

ext {
// PICOCLI VERSION
Expand Down
14 changes: 12 additions & 2 deletions picocli-shell-jline3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ description 'Picocli Shell JLine3 - easily build interactive shell applications
version "$projectVersion"
ext.moduleName = 'info.picocli.shell.jline3'

sourceCompatibility = 1.8
targetCompatibility = 1.8
// Spring 3 requires Java 17
boolean useJava17 = JavaVersion.current().majorVersion.compareTo("17") >= 0;
if (useJava17) {
logger.quiet("picocli-shell-jline3/build.gradle: JavaVersion=${JavaVersion.current()}")
logger.quiet("picocli-shell-jline3/build.gradle: sourceCompatibility = 17")
logger.quiet("picocli-shell-jline3/build.gradle: targetCompatibility = 17")
sourceCompatibility = 17
targetCompatibility = 17
} else { // from Java 9 and up
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

dependencies {
api rootProject
Expand Down

0 comments on commit 2f4c35c

Please sign in to comment.