From 8dcdd0c8c8c9c0817695200c462ad53a82a6afa9 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Tue, 20 Feb 2024 16:52:32 +0100 Subject: [PATCH] Fix 'protobuf-javalite' vs 'protobuf-java' Signed-off-by: Jendrik Johannes --- ...com.hedera.gradlebuild.patch-modules.gradle.kts | 5 +++++ ....hedera.gradlebuild.sdk.full-variant.gradle.kts | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.patch-modules.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.patch-modules.gradle.kts index 4f8290350d..d68a299d9e 100644 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.patch-modules.gradle.kts +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.patch-modules.gradle.kts @@ -97,6 +97,11 @@ extraJavaModuleInfo { requireAllDefinedDependencies() requires("java.logging") } + module("com.google.protobuf:protobuf-javalite", "com.google.protobuf") { + exportAllPackages() + requireAllDefinedDependencies() + requires("java.logging") + } module("io.grpc:grpc-netty-shaded", "grpc.netty.shaded") module("io.grpc:grpc-protobuf-lite", "grpc.protobuf.lite") module("io.grpc:grpc-protobuf", "grpc.protobuf") diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.sdk.full-variant.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.sdk.full-variant.gradle.kts index 938cac6fff..9c3e69d682 100644 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.sdk.full-variant.gradle.kts +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradlebuild.sdk.full-variant.gradle.kts @@ -34,11 +34,15 @@ protobuf.generateProtoTasks { } } -val protobufVariant = if (publishFull) "protobuf-java" else "protobuf-javalite" -extraJavaModuleInfo.module("com.google.protobuf:$protobufVariant", "com.google.protobuf") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") +if (publishFull) { + extraJavaModuleInfo { + module("com.google.protobuf:protobuf-javalite", "com.google.protobuf.UNUSED") + module("com.google.protobuf:protobuf-java", "com.google.protobuf") { + exportAllPackages() + requireAllDefinedDependencies() + requires("java.logging") + } + } } publishing.publications.named("mavenJava") {