From 48c196b5d11da8cd2520005b457e7534a3cd0045 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Fri, 19 Oct 2018 15:46:01 -0700 Subject: [PATCH 1/6] Switch to OpenJDK10 in Gradle builds Oracle JDK10 is EOL and is no longer available for download. So switch to OpenJDK10 in Gradle builds. --- .travis.yml | 2 +- common/build.gradle | 36 ++++++++++++++++++++++++++++++++++++ desktop/build.gradle | 28 ++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e398b0a9bc1..ca6bb7fec80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: java -jdk: oraclejdk10 +jdk: openjdk10 before_install: grep -v '^#' src/main/resources/META-INF/services/bisq.asset.Asset | sort --check --dictionary-order --ignore-case notifications: diff --git a/common/build.gradle b/common/build.gradle index 2b65000dc60..fdce13093cb 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,9 +1,22 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0' + } +} + plugins { id 'java' id 'maven' id 'com.google.protobuf' version '0.8.5' } +apply plugin: 'application' +apply plugin: 'com.google.osdetector' +ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os + group = 'network.bisq' version = '-SNAPSHOT' @@ -19,6 +32,7 @@ tasks.withType(JavaCompile) { repositories { jcenter() + mavenCentral() maven { url 'https://jitpack.io' } } @@ -59,4 +73,26 @@ dependencies { compileOnly 'org.projectlombok:lombok:1.18.2' annotationProcessor 'org.projectlombok:lombok:1.18.2' testCompile 'junit:junit:4.12' + + compile "org.openjfx:javafx-base:11:$platform" + compile "org.openjfx:javafx-graphics:11:$platform" + compile "org.openjfx:javafx-controls:11:$platform" +} + +compileJava { + doFirst { + options.compilerArgs = [ + '--module-path', classpath.asPath, + '--add-modules', 'javafx.controls' + ] + } +} + +run { + doFirst { + jvmArgs = [ + '--module-path', classpath.asPath, + '--add-modules', 'javafx.controls' + ] + } } diff --git a/desktop/build.gradle b/desktop/build.gradle index 520d59c6dbf..53a82001eb3 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -1,10 +1,12 @@ buildscript { repositories { jcenter() + mavenCentral() } dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' classpath files('gradle/witness/gradle-witness.jar') + classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0' } } @@ -13,6 +15,9 @@ apply plugin: 'application' apply plugin: 'maven' apply plugin: 'witness' apply plugin: 'com.github.johnrengelman.shadow' +apply plugin: 'com.google.osdetector' + +ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os group = 'network.bisq' version = '0.8.0-SNAPSHOT' @@ -36,6 +41,7 @@ sourceSets.main.resources.srcDirs += ['src/main/java'] // to copy fxml and css f repositories { jcenter() + mavenCentral() maven { url 'https://jitpack.io' } maven { url 'https://raw.githubusercontent.com/JesusMcCloud/tor-binary/master/release/' } maven { url 'https://dl.bintray.com/jerady/maven' } @@ -55,6 +61,11 @@ dependencies { compile 'de.jensd:fontawesomefx-materialdesignfont:2.0.26-9.1.2' compile 'com.googlecode.jcsv:jcsv:1.4.0' compile 'com.github.sarxos:webcam-capture:0.3.12' + compile "org.openjfx:javafx-base:11:$platform" + compile "org.openjfx:javafx-graphics:11:$platform" + compile "org.openjfx:javafx-controls:11:$platform" + compile "org.openjfx:javafx-fxml:11:$platform" + compile "org.openjfx:javafx-swing:11:$platform" compileOnly 'org.projectlombok:lombok:1.18.2' @@ -72,6 +83,23 @@ dependencies { testAnnotationProcessor 'org.projectlombok:lombok:1.18.2' } +compileJava { + doFirst { + options.compilerArgs = [ + '--module-path', classpath.asPath, + '--add-modules', 'javafx.controls' + ] + } +} +run { + doFirst { + jvmArgs = [ + '--module-path', classpath.asPath, + '--add-modules', 'javafx.controls' + ] + } +} + test { systemProperty 'jdk.attach.allowAttachSelf', true From 2be4d3d8aad3649c333d1f82bbfe878c2ccfd4c5 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Fri, 19 Oct 2018 15:54:47 -0700 Subject: [PATCH 2/6] Add mainClassName to common/build.gradle Fix the following error: A problem was found with the configuration of task ':common:startScripts'. > No value has been specified for property 'mainClassName'. --- common/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/build.gradle b/common/build.gradle index fdce13093cb..67e055573b1 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -20,6 +20,8 @@ ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'wi group = 'network.bisq' version = '-SNAPSHOT' +mainClassName = 'bisq.common' + ext { protobufVersion = '3.5.1' } From cff51d5e49bfdfeca3ff4c75c75ff6a3c02e4e2c Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Fri, 19 Oct 2018 16:10:06 -0700 Subject: [PATCH 3/6] Update README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6bf38dc463e..637ba732862 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ For more information, see https://bisq.network/intro and for step-by-step gettin ## Building Bisq -You will need [JDK 10](https://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html) installed to complete the following instructions. +You will need OpenJDK [JDK 10](https://jdk.java.net/10/) installed to complete the following instructions. 1. Clone the Bisq source code and cd into `bisq` @@ -42,11 +42,11 @@ _The following instructions have been tested on IDEA 2018.2_ 1. Go to `Preferences->Plugins`. Search for and install the _Lombok_ plugin. When prompted, do not restart IDEA. 1. Go to `Preferences->Build, Execution, Deployment->Compiler->Annotation Processors` and check the `Enable annotation processing` option (to enable processing of Lombok annotations) 1. Restart IDEA - 1. Go to `Import Project`, select `settings.gradle` and click `Open` + 1. Go to `Import Project`, select the `settings.gradle` file and click `Open` 1. In the `Import Project from Gradle` screen, check the `Use auto-import` option and click `OK` 1. When prompted whether to overwrite the existing `.idea` directory, click `Yes` 1. In the `Project` tool window, right click on the root-level `.idea` folder, select `Git->Revert...` and click OK in the dialog that appears (to restore source-controlled `.idea` configuration files that get overwritten during project import) - 1. Go to `Build->Build project`. Everything should build cleanly. You should be able to run tests, run `main` methods in any component, etc. + 1. Go to `Build->Build Project`. Everything should build cleanly. You should be able to run tests, run `main` methods in any component, etc. -> TIP: If you encounter compilation errors related to the `io.bisq.generated.protobuffer.PB` class, it is probably because you didn't run the full Gradle build above. You need to run the `generateProto` task in the `common` project. You can do this via the Gradle tool window in IDEA, or you can do it the command line with `cd common; ./gradlew generateProto`. Once you've done that, run `Build->Build project` again and you should have no errors. +> TIP: If you encounter compilation errors related to the `io.bisq.generated.protobuffer.PB` class, it is probably because you didn't run the full Gradle build above. You need to run the `generateProto` task in the `common` project. You can do this via the Gradle tool window in IDEA, or you can do it the command line with `cd common; ./gradlew generateProto`. Once you've done that, run `Build->Build Project` again and you should have no errors. From 5ae96b74b181255b9b0f9b987f0077baeb516ab2 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Sat, 20 Oct 2018 08:25:17 -0700 Subject: [PATCH 4/6] Remove unnecessary content from build.gradle --- common/build.gradle | 21 ++++----------------- desktop/build.gradle | 2 -- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 67e055573b1..ab455b3b3d3 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -13,19 +13,16 @@ plugins { id 'com.google.protobuf' version '0.8.5' } -apply plugin: 'application' apply plugin: 'com.google.osdetector' -ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os - -group = 'network.bisq' -version = '-SNAPSHOT' - -mainClassName = 'bisq.common' ext { protobufVersion = '3.5.1' + platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os } +group = 'network.bisq' +version = '-SNAPSHOT' + sourceCompatibility = 1.10 tasks.withType(JavaCompile) { @@ -34,7 +31,6 @@ tasks.withType(JavaCompile) { repositories { jcenter() - mavenCentral() maven { url 'https://jitpack.io' } } @@ -89,12 +85,3 @@ compileJava { ] } } - -run { - doFirst { - jvmArgs = [ - '--module-path', classpath.asPath, - '--add-modules', 'javafx.controls' - ] - } -} diff --git a/desktop/build.gradle b/desktop/build.gradle index 53a82001eb3..1cc00597473 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -1,7 +1,6 @@ buildscript { repositories { jcenter() - mavenCentral() } dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' @@ -41,7 +40,6 @@ sourceSets.main.resources.srcDirs += ['src/main/java'] // to copy fxml and css f repositories { jcenter() - mavenCentral() maven { url 'https://jitpack.io' } maven { url 'https://raw.githubusercontent.com/JesusMcCloud/tor-binary/master/release/' } maven { url 'https://dl.bintray.com/jerady/maven' } From 861d8143acdfce1aebe0cada5e5fac0ce739ce5c Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Sat, 20 Oct 2018 08:45:08 -0700 Subject: [PATCH 5/6] Add comment to clarify usage of buildscript block --- common/build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/build.gradle b/common/build.gradle index ab455b3b3d3..f7e229cceea 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,6 +1,9 @@ +// Note, version 1.6.0 of osdetector-gradle-plugin cannot be applied with a plugins block +// So a buildscript block is used +// See https://github.com/google/osdetector-gradle-plugin/issues/15 buildscript { repositories { - mavenCentral() + jcenter() } dependencies { classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0' From c231187daa5a828198268836a2ee68163b5d1d56 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Mon, 22 Oct 2018 09:42:35 +0200 Subject: [PATCH 6/6] Add checksums for new openjfx libraries --- desktop/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop/build.gradle b/desktop/build.gradle index 1cc00597473..2f308c9a966 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -127,6 +127,14 @@ dependencyVerification { 'de.jensd:fontawesomefx-commons:5539bb3335ecb822dbf928546f57766eeb9f1516cc1417a064b5709629612149', 'com.googlecode.jcsv:jcsv:73ca7d715e90c8d2c2635cc284543b038245a34f70790660ed590e157b8714a2', 'com.github.sarxos:webcam-capture:d960b7ea8ec3ddf2df0725ef214c3fccc9699ea7772df37f544e1f8e4fd665f6', + 'org.openjfx:javafx-fxml:ef5b10aa0b985e3bece34629bcaf4f462d3a60e1139a83edd116f69c1a36e0e8', + 'org.openjfx:javafx-controls:689626346d7b390a46c7acd7741af19f91567110a6611cad50c60d8c611ac59f', + 'org.openjfx:javafx-controls:dec3f34ca06ca9be71ce8c72646a31eb751b1df5a2b354dcd10fb64df842da4f', + 'org.openjfx:javafx-swing:885a5ac37b82913dbfe2ed0742315b6275e8137f19b1135893cae42c4483591b', + 'org.openjfx:javafx-graphics:753031848484aceead7d8d326be840b592a8de8e5938baabd477847b769eeef4', + 'org.openjfx:javafx-graphics:6b846071b1fdae103f1b0e80c988d9d0b9cae37391b00f8ea3dc11e1e8e021b0', + 'org.openjfx:javafx-base:2b062455f2792c2fc6406bb62d092593c490336584a74d283f8560b58a8eec07', + 'org.openjfx:javafx-base:df7ef2e994be4a86153be0aaf0dcafa697ba4be0db55caefb8bda85e02d66ead', 'com.github.JesusMcCloud.netlayer:tor.native:de44e782b21838d3426dbff99abbfd1cbb8e5d3f6d5e997441ff4fd8354934fa', 'org.apache.httpcomponents:httpclient:db3d1b6c2d6a5e5ad47577ad61854e2f0e0936199b8e05eb541ed52349263135', 'net.sf.jopt-simple:jopt-simple:6f45c00908265947c39221035250024f2caec9a15c1c8cf553ebeecee289f342',