From cd142b272109b542f524f5ee84b523b8f1d62461 Mon Sep 17 00:00:00 2001 From: Edwin Betancourt Date: Thu, 25 Jan 2024 12:26:57 -0400 Subject: [PATCH] fix: Descriptor `*.pb` path. (#5) --- build.gradle | 62 +++++++++++++++++++----------------- docker/grpc_proxy.Dockerfile | 2 +- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/build.gradle b/build.gradle index 2167a9d..ce788d9 100644 --- a/build.gradle +++ b/build.gradle @@ -41,39 +41,41 @@ repositories { } } } + protobuf { - protoc { - artifact = "com.google.protobuf:protoc:3.12.0" - } - plugins { - grpc { - artifact = 'io.grpc:protoc-gen-grpc-java:1.34.1' - } - } - generateProtoTasks { - all()*.plugins { - grpc {} - } - all().configureEach { task -> - // If true, will generate a descriptor_set.desc file under - // task.outputBaseDir. Default is false. - // See --descriptor_set_out in protoc documentation about what it is. - task.generateDescriptorSet = true - + protoc { + artifact = "com.google.protobuf:protoc:3.12.0" + } + plugins { + grpc { + artifact = 'io.grpc:protoc-gen-grpc-java:1.34.1' + } + } + generateProtoTasks { + all()*.plugins { + grpc {} + } + all().configureEach { task -> + // If true, will generate a descriptor_set.desc file under + // task.outputBaseDir. Default is false. + // See --descriptor_set_out in protoc documentation about what it is. + task.generateDescriptorSet = true + // Allows to override the default for the descriptor set location - task.descriptorSetOptions.path = - "${projectDir}/build/descriptors/adempiere-grpc-template-service-service.pb" - - // If true, the descriptor set will contain line number information - // and comments. Default is false. - task.descriptorSetOptions.includeSourceInfo = true - - // If true, the descriptor set will contain all transitive imports and - // is therefore self-contained. Default is false. - task.descriptorSetOptions.includeImports = true - } - } + task.descriptorSetOptions.path = + "${projectDir}/build/descriptors/adempiere-grpc-template-service.pb" + + // If true, the descriptor set will contain line number information + // and comments. Default is false. + task.descriptorSetOptions.includeSourceInfo = true + + // If true, the descriptor set will contain all transitive imports and + // is therefore self-contained. Default is false. + task.descriptorSetOptions.includeImports = true + } + } } + sourceSets { main { java { diff --git a/docker/grpc_proxy.Dockerfile b/docker/grpc_proxy.Dockerfile index 05036b4..a5225e8 100644 --- a/docker/grpc_proxy.Dockerfile +++ b/docker/grpc_proxy.Dockerfile @@ -23,7 +23,7 @@ WORKDIR /etc/envoy/ COPY docker/envoy_template.yaml /etc/envoy/envoy_template.yaml # Proto gRPC descriptor -COPY docker/adempiere-grpc-template-service-service.pb /data/descriptor.pb +COPY docker/adempiere-grpc-template-service.pb /data/descriptor.pb COPY docker/start_grpc_proxy.sh /etc/envoy/start.sh