From 0fe0daba590fe203933d697ebb1c2988d990c97f Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Wed, 6 Sep 2023 13:30:57 -0700 Subject: [PATCH] wallettemplate: require JDK 17+ and Gradle 7.3+ Also update the README for latest build JDK/Gradle information. --- README.adoc | 6 +++--- settings.gradle | 8 ++++---- wallettemplate/build.gradle | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.adoc b/README.adoc index 21e746d5d..639a254fa 100644 --- a/README.adoc +++ b/README.adoc @@ -12,7 +12,7 @@ The bitcoinj library is a Java implementation of the Bitcoin protocol, which all * Java 8+ (needs Java 8 API or Android 8.0 API, compiles to Java 8 bytecode) and Gradle 4.4+ for the `core` module * Java 11+ and Gradle 4.4+ for `tools`, `wallettool` and `examples` -* Java 11+ and Gradle 4.10+ for the JavaFX-based `wallettemplate` +* Java 17+ and Gradle 7.3+ for the JavaFX-based `wallettemplate` * https://gradle.org/[Gradle] - for building the project * https://github.com/google/protobuf[Google Protocol Buffers] - for use with serialization and hardware communications @@ -24,12 +24,12 @@ To get started, it is best to have the latest JDK and Gradle installed. The HEAD Official builds are currently using JDK 11. Our GitHub Actions build and test with JDK 11 and JDK 17. -To perform a full build (_including_ JavaDocs and unit/integration _tests_) use JDK 11+. +To perform a full build (_including_ JavaDocs, unit/integration _tests_, and `wallettemplate`) use JDK 17+. ``` gradle clean build ``` -If you are using Gradle 4.10 or later, the build will automatically include the JavaFX-based `wallettemplate` module. The outputs are under the `build` directory. +If you are using JDK 17+ and Gradle 7.3+, the build will automatically include the JavaFX-based `wallettemplate` module. The outputs are under the `build` directory. To perform a full build _without_ unit/integration _tests_ use: ``` diff --git a/settings.gradle b/settings.gradle index bfb4d26cc..0e015f217 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,8 +5,8 @@ import org.gradle.api.GradleScriptException def minGradleVersion = GradleVersion.version("4.4") // Minimum Gradle version for JUnit5 def minJunit5GradleVersion = GradleVersion.version("4.6") -// Minimum Gradle version for builds of JavaFX 11 module -def minFxGradleVersion = GradleVersion.version("4.10") +// Minimum Gradle version for builds of JavaFX 17 module using JDK 17 +def minFxGradleVersion = GradleVersion.version("7.3") rootProject.name = 'bitcoinj-parent' @@ -30,12 +30,12 @@ project(':wallettool').name = 'bitcoinj-wallettool' include 'examples' project(':examples').name = 'bitcoinj-examples' -if (GradleVersion.current().compareTo(minFxGradleVersion) > 0) { +if (GradleVersion.current().compareTo(minFxGradleVersion) > 0 && JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { System.err.println "Including wallettemplate because ${GradleVersion.current()}" include 'wallettemplate' project(':wallettemplate').name = 'bitcoinj-wallettemplate' } else { - System.err.println "Skipping wallettemplate, requires Gradle ${minFxGradleVersion}+, currently running: ${GradleVersion.current()}" + System.err.println "Skipping wallettemplate, requires Gradle ${minFxGradleVersion}+ and Java 17+, currently running Gradle: ${GradleVersion.current()}, Java ${JavaVersion.current()}" } if (GradleVersion.current().compareTo(minJunit5GradleVersion) >= 0) { diff --git a/wallettemplate/build.gradle b/wallettemplate/build.gradle index 566506fe5..8bad93f9a 100644 --- a/wallettemplate/build.gradle +++ b/wallettemplate/build.gradle @@ -17,13 +17,13 @@ javafx { modules = [ 'javafx.controls', 'javafx.fxml' ] } -sourceCompatibility = 11 +sourceCompatibility = 17 compileJava.options.encoding = 'UTF-8' compileTestJava.options.encoding = 'UTF-8' javadoc.options.encoding = 'UTF-8' compileJava { - options.compilerArgs.addAll(['--release', '11']) + options.compilerArgs.addAll(['--release', '17']) options.compilerArgs << '-Xlint:deprecation' }