Use jar command from bazel in eclipse setup

Original eclipse setup used the jar command from the system path
which resulted in different behavior on different systems. This
change modifies the build target to use the jar command provided
by bazel: @local_jdk//:bin/jar
This commit is contained in:
Wolfgang Meyers 2016-03-16 15:27:10 +00:00
parent fc4333acc2
commit 15222fc32f

View file

@ -45,14 +45,20 @@ genrule(
name = "eclipse_deps",
srcs = ["//java/com/google/domain/registry/eclipse:registry_deps_deploy.jar"],
outs = ["eclipse_deps.jar"],
tools = [
"@local_jdk//:bin/jar",
"@local_jdk//:jdk-lib",
"@local_jdk//:jre-default",
],
cmd = " && ".join([
"JAR=$$(pwd)/$(location @local_jdk//:bin/jar)",
"IN=$$(pwd)/$(SRCS)",
"OUT=$$(pwd)/$@",
"TMP=$$(mktemp -d $${TMPDIR:-/tmp}/eclipse_deps.XXXXXXXX)",
"cd $$TMP",
"jar -xf $$IN",
"$$JAR -xf $$IN",
"rm -rf com/google/domain/registry",
"jar -cmf META-INF/MANIFEST.MF eclipse_deps.jar .",
"$$JAR -cmf META-INF/MANIFEST.MF eclipse_deps.jar .",
"mv eclipse_deps.jar $$OUT",
"rm -rf $$TMP",
]),