From 9af3ab82a99438efd837ff9090b1f4bd32e91ba8 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Mon, 17 Jul 2023 18:34:00 +0200 Subject: [PATCH 1/2] Remove com.google.osdetector Gradle Plugin --- build.gradle | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/build.gradle b/build.gradle index 1be40c69ac0..189d4d6a9b4 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,6 @@ buildscript { } dependencies { classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17' - classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0' classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0' classpath 'org.openjfx:javafx-plugin:0.0.10' } @@ -23,12 +22,8 @@ configure(rootProject) { } configure(subprojects) { - apply plugin: 'com.google.osdetector' - ext { // in alphabetical order javafxVersion = '16' - - os = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os } } @@ -95,11 +90,6 @@ configure([project(':cli'), 'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="' + '-Dlogback.configurationFile=apitest/build/resources/main/logback.xml"') } - - if (osdetector.os != 'windows') - delete fileTree(dir: rootProject.projectDir, include: 'bisq-*.bat') - else - delete fileTree(dir: rootProject.projectDir, include: 'bisq-*', exclude: '*.bat') } } From 6b92629b863c8676a64345f26a91e8acf36afc95 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Mon, 17 Jul 2023 18:49:10 +0200 Subject: [PATCH 2/2] Improve build-time: Lazily apply gRPC plugin For details see: https://docs.gradle.org/current/userguide/task_configuration_avoidance.html --- build.gradle | 1 - gradle/verification-metadata.xml | 66 ++++++++++++++++++++++++++++++++ proto/build.gradle | 17 ++++++-- 3 files changed, 79 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 189d4d6a9b4..f7af3edc2fe 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,6 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17' classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0' classpath 'org.openjfx:javafx-plugin:0.0.10' } diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 4e74fc28728..6ccca570f08 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -379,6 +379,14 @@ + + + + + + + + @@ -387,6 +395,22 @@ + + + + + + + + + + + + + + + + @@ -395,6 +419,14 @@ + + + + + + + + @@ -424,6 +456,11 @@ + + + + + @@ -476,6 +513,11 @@ + + + + + @@ -489,6 +531,14 @@ + + + + + + + + @@ -751,6 +801,14 @@ + + + + + + + + @@ -759,6 +817,14 @@ + + + + + + + + diff --git a/proto/build.gradle b/proto/build.gradle index d52577e3fd8..bd6032907c7 100644 --- a/proto/build.gradle +++ b/proto/build.gradle @@ -1,10 +1,9 @@ plugins { id 'bisq.java-conventions' + id 'idea' + id 'com.google.protobuf' version "0.9.3" } -apply plugin: 'com.google.protobuf' -apply plugin: 'idea' - dependencies { implementation enforcedPlatform(project(':platform')) annotationProcessor libs.lombok @@ -29,12 +28,22 @@ protobuf { protoc { artifact = "com.google.protobuf:protoc:3.19.1" } + plugins { grpc { artifact = "io.grpc:protoc-gen-grpc-java:1.42.1" } } + generateProtoTasks { - ofSourceSet('main')*.plugins { grpc {} } + ofSourceSet('main').configureEach { + plugins { + // Apply the "grpc" plugin whose spec is defined above, without + // options. Note the braces cannot be omitted, otherwise the + // plugin will not be added. This is because of the implicit way + // NamedDomainObjectContainer binds the methods. + grpc { } + } + } } }