From 4daf6de1eb1357ccee7124ac2d090a053be3a4dd Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Sat, 23 Feb 2019 10:49:00 -0800 Subject: [PATCH] settings.gradle: If at least Java 11 and Gradle 4.10 are detected, wallet-template is being built again. This also means wallet-template is under continuous integration by Travis again. --- .travis.yml | 3 +-- README.md | 21 ++++++++++++--------- settings.gradle | 11 ++++++++++- wallettemplate/build.gradle | 19 +++++++++++++++---- 4 files changed, 38 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f4c33cd..5b6c55d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,7 @@ jdk: - openjdk11 install: true script: - # excluding wallet-template because of the unreliable JavaFX dependency - - gradle clean build -x :wallettemplate:compileJava + - gradle clean build notifications: irc: diff --git a/README.md b/README.md index 5192ef6c..cc4beff0 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,10 @@ The bitcoinj library is a Java implementation of the Bitcoin protocol, which all ### Technologies -* Java 7 for the core modules, Java 8 for everything else -* [Gradle 3.4+](https://gradle.org/) - for building the project +* Java 7+ and Gradle 3.4+ for the `core` module +* Java 8+ and Gradle 3.4+ for `tools` and `examples` +* Java 11+ and Gradle 4.10+ for the JavaFX-based `wallettemplate` +* [Gradle](https://gradle.org/) - for building the project * [Google Protocol Buffers](https://github.com/google/protobuf) - for use with serialization and hardware communications ### Getting started @@ -18,17 +20,18 @@ To get started, it is best to have the latest JDK and Gradle installed. The HEAD #### Building from the command line -To perform a full build use +Official builds are currently using with JDK 8, even though the `core` module is compatible with JDK 7 and later. + +To perform a full build (*including* JavaDocs and unit/integration *tests*) use JDK 8+ ``` gradle clean build ``` -You can also run -``` -gradle javadoc -``` -to generate the JavaDocs. +If you are running JDK 11 or later and Gradle 4.10 or later, the build will automatically include the JavaFX-based `wallettemplate` module. The outputs are under the `build` directory. -The outputs are under the `build` directory. +To perform a full build *without* unit/integration *tests* use: +``` +gradle clean assemble +``` #### Building from an IDE diff --git a/settings.gradle b/settings.gradle index e540a69a..7fb0bdfa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,13 @@ +import org.gradle.util.GradleVersion + include 'core' include 'tools' include 'examples' -include 'wallettemplate' + +def minGradleVersion = GradleVersion.version("4.10") +if (GradleVersion.current().compareTo(minGradleVersion) >= 0 && JavaVersion.current().isJava11Compatible()) { + println "Including wallettemplate because ${GradleVersion.current()} and Java ${JavaVersion.current()}" + include 'wallettemplate' +} else { + println "Skipping wallettemplate: ${GradleVersion.current()} and Java ${JavaVersion.current()}" +} diff --git a/wallettemplate/build.gradle b/wallettemplate/build.gradle index 2e432622..9e0fe15d 100644 --- a/wallettemplate/build.gradle +++ b/wallettemplate/build.gradle @@ -1,5 +1,11 @@ +plugins { + id 'org.openjfx.javafxplugin' version '0.0.7' apply false +} + apply plugin: 'java' apply plugin: 'eclipse' +apply plugin: 'application' +apply plugin: 'org.openjfx.javafxplugin' eclipse.project.name = 'bitcoinj-wallettemplate' @@ -12,11 +18,16 @@ dependencies { implementation 'org.slf4j:slf4j-jdk14:1.7.25' } -sourceCompatibility = 1.8 +javafx { + modules = [ 'javafx.controls', 'javafx.fxml' ] +} + +sourceCompatibility = 1.11 compileJava.options.encoding = 'UTF-8' compileTestJava.options.encoding = 'UTF-8' -task wallet_template(type: JavaExec) { - main = 'wallettemplate.Main' - classpath = sourceSets.main.runtimeClasspath +mainClassName = 'wallettemplate.Main' + +// task wallet_template can be replaced with the 'run' task +task wallet_template(dependsOn: 'run') { }