Skip to content

Commit

Permalink
Fix bazel build as bazel no longer bundles jarjar.
Browse files Browse the repository at this point in the history
Imported from #2218.

PiperOrigin-RevId: 345717903
  • Loading branch information
Googler authored and copybara-github committed Dec 4, 2020
1 parent 15d116c commit 2b4ccb9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
21 changes: 19 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,25 @@ jvm_maven_import_external(

jvm_maven_import_external(
name = "jarjar",
artifact = "com.googlecode.jarjar:jarjar:1.3",
artifact_sha256 = "4225c8ee1bf3079c4b07c76fe03c3e28809a22204db6249c9417efa4f804b3a7",
artifact = "org.pantsbuild:jarjar:1.7.2",
artifact_sha256 = "0706a455e17b67718abe212e3a77688bbe8260852fc74e3e836d9f2e76d91c27",
licenses = ["notice"], # Apache 2.0
server_urls = ["https://repo1.maven.org/maven2"],
deps = ["@asm", "@asm-commons"]
)

jvm_maven_import_external(
name = "asm",
artifact = "org.ow2.asm:asm:7.0",
artifact_sha256 = "b88ef66468b3c978ad0c97fd6e90979e56155b4ac69089ba7a44e9aa7ffe9acf",
licenses = ["notice"], # Apache 2.0
server_urls = ["https://repo1.maven.org/maven2"],
)

jvm_maven_import_external(
name = "asm-commons",
artifact = "org.ow2.asm:asm-commons:7.0",
artifact_sha256 = "fed348ef05958e3e846a3ac074a12af5f7936ef3d21ce44a62c4fa08a771927d",
licenses = ["notice"], # Apache 2.0
server_urls = ["https://repo1.maven.org/maven2"],
)
Expand Down
11 changes: 9 additions & 2 deletions proto/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ java_proto_library(
deps = [":intellij_plugin_target_deploy_info_proto"],
)

# Required for bazel.
java_binary(
name = "jarjar_runner",
main_class = "org.pantsbuild.jarjar.Main",
runtime_deps = ["@jarjar//jar"],
)

genrule(
name = "repackaged_proto_deps",
srcs = [
Expand All @@ -84,13 +91,13 @@ genrule(
],
outs = [":repackaged_proto_deps.jar"],
cmd = """
$(location @bazel_tools//third_party/jarjar:jarjar_bin) \
$(location :jarjar_runner) \
process \
$(location :jarjar_protobuf_rule.txt) \
$(location :proto_deps_binary_deploy.jar) \
$@
""",
tools = ["@bazel_tools//third_party/jarjar:jarjar_bin"],
tools = [":jarjar_runner"],
)

java_binary(
Expand Down

0 comments on commit 2b4ccb9

Please sign in to comment.