From 78a742695c726a670badded7fb4f913121010f98 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Sun, 2 Jul 2023 18:28:25 +0200 Subject: [PATCH] Declare global protobuf-java in Java Platform Plugin The constraints in the platform module apply to all libraries (including to transitively included libraries). --- build.gradle | 16 ++++++---------- platform/build.gradle | 9 +++++++++ proto/build.gradle | 1 + settings.gradle | 1 + 4 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 platform/build.gradle diff --git a/build.gradle b/build.gradle index 407c14ea8e..a9ce58f05d 100644 --- a/build.gradle +++ b/build.gradle @@ -130,6 +130,7 @@ configure(project(':common')) { "Implementation-Version": getHash()) dependencies { + implementation enforcedPlatform(project(':platform')) implementation project(':proto') annotationProcessor libs.lombok compileOnly libs.javax.annotation @@ -142,7 +143,6 @@ configure(project(':common')) { exclude(module: 'jsr305') exclude(module: 'okhttp') exclude(module: 'okio') - exclude(module: 'protobuf-java') exclude(module: 'slf4j-api') } implementation libs.google.findbugs @@ -151,7 +151,6 @@ configure(project(':common')) { implementation(libs.google.guice) { exclude(module: 'guava') } - implementation libs.protobuf.java implementation libs.commons.io implementation libs.jopt implementation libs.apache.commons.lang3 @@ -176,12 +175,12 @@ configure(project(':p2p')) { } dependencies { + implementation enforcedPlatform(project(':platform')) implementation project(':proto') implementation project(':common') annotationProcessor libs.lombok compileOnly libs.lombok implementation libs.google.guava - implementation libs.protobuf.java implementation libs.fxmisc.easybind implementation libs.slf4j.api implementation(libs.netlayer.tor.external) { @@ -196,7 +195,6 @@ configure(project(':p2p')) { exclude(module: 'jsr305') exclude(module: 'okhttp') exclude(module: 'okio') - exclude(module: 'protobuf-java') exclude(module: 'slf4j-api') } implementation(libs.google.guice) { @@ -223,6 +221,7 @@ configure(project(':core')) { } dependencies { + implementation enforcedPlatform(project(':platform')) implementation project(':proto') implementation project(':assets') implementation project(':common') @@ -237,7 +236,6 @@ configure(project(':core')) { implementation libs.google.findbugs implementation libs.google.gson implementation libs.google.guava - implementation libs.protobuf.java implementation libs.commons.codec implementation libs.commons.io implementation libs.jopt @@ -261,7 +259,6 @@ configure(project(':core')) { exclude(module: 'jsr305') exclude(module: 'okhttp') exclude(module: 'okio') - exclude(module: 'protobuf-java') exclude(module: 'slf4j-api') } implementation(libs.jsonrpc4j) { @@ -313,6 +310,7 @@ configure(project(':desktop')) { sourceSets.main.resources.srcDirs += ['src/main/java'] // to copy fxml and css files dependencies { + implementation enforcedPlatform(project(':platform')) implementation project(':assets') implementation project(':common') implementation project(':proto') @@ -324,7 +322,6 @@ configure(project(':desktop')) { implementation libs.logback.core implementation libs.google.gson implementation libs.google.guava - implementation libs.protobuf.java implementation libs.jcsv implementation libs.jfoenix implementation libs.commons.io @@ -343,7 +340,6 @@ configure(project(':desktop')) { exclude(module: 'jsr305') exclude(module: 'okhttp') exclude(module: 'okio') - exclude(module: 'protobuf-java') exclude(module: 'slf4j-api') } implementation(libs.google.guice) { @@ -373,6 +369,7 @@ configure(project(':seednode')) { mainClassName = 'bisq.seednode.SeedNodeMain' dependencies { + implementation enforcedPlatform(project(':platform')) implementation project(':common') implementation project(':proto') implementation project(':p2p') @@ -465,6 +462,7 @@ configure(project(':apitest')) { } dependencies { + implementation enforcedPlatform(project(':platform')) implementation project(':proto') implementation project(':common') implementation project(':core') @@ -479,7 +477,6 @@ configure(project(':apitest')) { implementation libs.logback.core implementation libs.google.gson implementation libs.google.guava - implementation libs.protobuf.java implementation libs.jopt implementation libs.apache.commons.lang3 implementation libs.slf4j.api @@ -489,7 +486,6 @@ configure(project(':apitest')) { exclude(module: 'jsr305') exclude(module: 'okhttp') exclude(module: 'okio') - exclude(module: 'protobuf-java') exclude(module: 'slf4j-api') } implementation(libs.grpc.protobuf) { diff --git a/platform/build.gradle b/platform/build.gradle new file mode 100644 index 0000000000..5036fd8e6a --- /dev/null +++ b/platform/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'java-platform' +} + +dependencies { + constraints { + api libs.protobuf.java + } +} diff --git a/proto/build.gradle b/proto/build.gradle index a52ad806fa..215197d6b4 100644 --- a/proto/build.gradle +++ b/proto/build.gradle @@ -5,6 +5,7 @@ plugins { apply plugin: 'com.google.protobuf' dependencies { + implementation enforcedPlatform(project(':platform')) annotationProcessor libs.lombok compileOnly libs.javax.annotation compileOnly libs.lombok diff --git a/settings.gradle b/settings.gradle index 530d25e2f1..0446e19e70 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,5 +16,6 @@ include 'desktop' include 'seednode' include 'statsnode' include 'apitest' +include 'platform' rootProject.name = 'bisq'