From 6fdd8824de3c7a8c34f6212366e047f552ff27f2 Mon Sep 17 00:00:00 2001 From: Stu Hood Date: Thu, 26 May 2022 10:33:35 -0700 Subject: [PATCH] Add `protobuf-java` dependency, and explicitly declare those deps with TODOs for relevant tickets. --- 3rdparty/jvm/com/google/protobuf/BUILD | 5 +++++ 3rdparty/jvm/default.lock | 14 ++++++++++++++ src/jvm/org/pantsbuild/example/lib/BUILD | 4 ++++ src/jvm/org/pantsbuild/example/proto/BUILD | 8 +++++++- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 3rdparty/jvm/com/google/protobuf/BUILD diff --git a/3rdparty/jvm/com/google/protobuf/BUILD b/3rdparty/jvm/com/google/protobuf/BUILD new file mode 100644 index 0000000..9a993c6 --- /dev/null +++ b/3rdparty/jvm/com/google/protobuf/BUILD @@ -0,0 +1,5 @@ +jvm_artifact( + group="com.google.protobuf", + artifact="protobuf-java", + version="3.21.0", +) diff --git a/3rdparty/jvm/default.lock b/3rdparty/jvm/default.lock index 2556663..22eed76 100644 --- a/3rdparty/jvm/default.lock +++ b/3rdparty/jvm/default.lock @@ -7,6 +7,7 @@ # "version": 1, # "generated_with_requirements": [ # "com.google.guava:guava:31.0.1-jre,url=not_provided,jar=not_provided", +# "com.google.protobuf:protobuf-java:3.21.0,url=not_provided,jar=not_provided", # "com.lihaoyi:acyclic_2.13:0.2.1,url=not_provided,jar=not_provided", # "org.scala-lang:scala-library:2.13.8,url=not_provided,jar=not_provided", # "org.scalatest:scalatest_2.13:3.2.10,url=not_provided,jar=not_provided" @@ -165,6 +166,19 @@ serialized_bytes_length = 8781 [[entries]] directDependencies = [] dependencies = [] +file_name = "com.google.protobuf_protobuf-java_3.21.0.jar" + +[entries.coord] +group = "com.google.protobuf" +artifact = "protobuf-java" +version = "3.21.0" +packaging = "jar" +[entries.file_digest] +fingerprint = "3d6bc9e4a87f293cb434b5a95c3011f72881a8517270c231dee035b215eb61df" +serialized_bytes_length = 1692588 +[[entries]] +directDependencies = [] +dependencies = [] file_name = "com.lihaoyi_acyclic_2.13_0.2.1.jar" [entries.coord] diff --git a/src/jvm/org/pantsbuild/example/lib/BUILD b/src/jvm/org/pantsbuild/example/lib/BUILD index 01ec279..4f98311 100644 --- a/src/jvm/org/pantsbuild/example/lib/BUILD +++ b/src/jvm/org/pantsbuild/example/lib/BUILD @@ -3,5 +3,9 @@ java_sources( # Resource dependencies cannot be inferred, so we must explicitly declare that we # depend on them. "src/resources/org/pantsbuild/example/lib", + # TODO: Protobuf dependencies are not currently inferred. + # see https://github.com/pantsbuild/pants/issues/14960 + "src/jvm/org/pantsbuild/example/proto", + "3rdparty/jvm/com/google/protobuf", ], ) diff --git a/src/jvm/org/pantsbuild/example/proto/BUILD b/src/jvm/org/pantsbuild/example/proto/BUILD index c994535..c59efdd 100644 --- a/src/jvm/org/pantsbuild/example/proto/BUILD +++ b/src/jvm/org/pantsbuild/example/proto/BUILD @@ -1 +1,7 @@ -protobuf_sources(grpc=True) +protobuf_sources( + dependencies=[ + # TODO: The protobuf runtime is not automatically injected as a dependency of protobuf targets. + # see https://github.com/pantsbuild/pants/pull/15006. + "3rdparty/jvm/com/google/protobuf", + ], +)