Skip to content

Commit 8dcae52

Browse files
authored
Merge pull request #151 from harti2006/fix/build
Exclude pre-packaged proto files from the build
2 parents 02940a6 + 9ef4101 commit 8dcae52

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,23 @@ dependencies {
106106
implementation "io.grpc:grpc-stub:${grpcVersion}"
107107
runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"
108108
compileOnly "org.apache.tomcat:annotations-api:6.0.53"
109+
110+
implementation "com.google.api.grpc:proto-google-common-protos:2.61.3"
111+
implementation("build.buf:protovalidate:1.0.0")
112+
// In the future this can probably be removed in favor of "protovalidate"
113+
// See https://buf.build/blog/protoc-gen-validate-v1-and-v2
114+
implementation("build.buf.protoc-gen-validate:pgv-java-stub:1.2.1")
115+
}
116+
117+
// There is no pre-packaged JAR available that contains the gRPC Gateway proto files
118+
task gatewayProtos(type: Exec) {
119+
mkdir bufDir
120+
commandLine("buf", "export", "--exclude-imports", "buf.build/grpc-ecosystem/grpc-gateway", "-o", bufDir)
109121
}
110122

111123
task authzedProtos(type: Exec) {
112-
commandLine("buf", "export", "buf.build/authzed/api:${authzedProtoCommit}", "-o", bufDir)
124+
dependsOn gatewayProtos
125+
commandLine("buf", "export", "--exclude-imports", "buf.build/authzed/api:${authzedProtoCommit}", "-o", bufDir)
113126
}
114127

115128
protobuf {

0 commit comments

Comments
 (0)