Skip to content

Commit

Permalink
BUILD bugfix: target Java 17 in picocli-spring-boot-starter build whe…
Browse files Browse the repository at this point in the history
…n possible
  • Loading branch information
remkop committed Aug 26, 2023
1 parent 2f4c35c commit 96fb7cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 2 additions & 12 deletions picocli-shell-jline3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,8 @@ description 'Picocli Shell JLine3 - easily build interactive shell applications
version "$projectVersion"
ext.moduleName = 'info.picocli.shell.jline3'

// 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
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
api rootProject
Expand Down
14 changes: 12 additions & 2 deletions picocli-spring-boot-starter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ description 'Picocli Spring Boot Starter - Enables Spring Dependency Injection a
version "$projectVersion"
ext.moduleName = 'info.picocli.spring.boot'

sourceCompatibility = 1.8
targetCompatibility = 1.8
// Spring 3 requires Java 17
boolean useJava17 = JavaVersion.current().majorVersion.compareTo("17") >= 0;
if (useJava17) {
logger.quiet("picocli-spring-boot-starter/build.gradle: JavaVersion=${JavaVersion.current()}")
logger.quiet("picocli-spring-boot-starter/build.gradle: sourceCompatibility = 17")
logger.quiet("picocli-spring-boot-starter/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 96fb7cc

Please sign in to comment.