aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_rules
diff options
context:
space:
mode:
Diffstat (limited to 'tools/build_rules')
-rw-r--r--tools/build_rules/genproto.bzl27
-rw-r--r--tools/build_rules/java_rules_skylark.bzl8
2 files changed, 19 insertions, 16 deletions
diff --git a/tools/build_rules/genproto.bzl b/tools/build_rules/genproto.bzl
index a2e2d735a9..d6e6a80bd5 100644
--- a/tools/build_rules/genproto.bzl
+++ b/tools/build_rules/genproto.bzl
@@ -32,7 +32,7 @@ def gensrcjar_impl(ctx):
ctx.action(
command=" && ".join(sub_commands),
- inputs=[ctx.file.src, proto_compiler, ctx.file._jar],
+ inputs=[ctx.file.src, proto_compiler, ctx.file._jar] + ctx.files._jdk,
outputs=[out],
mnemonic="GenProtoSrcJar",
use_default_shell_env = True)
@@ -40,17 +40,20 @@ def gensrcjar_impl(ctx):
gensrcjar = rule(
gensrcjar_impl,
attrs={
- "src": attr.label(allow_files=proto_filetype, single_file=True),
- # TODO(bazel-team): this should be a hidden attribute with a default
- # value, but Skylark needs to support select first.
- "_proto_compiler": attr.label(
- default=Label("//third_party:protoc"),
- allow_files=True,
- single_file=True),
- "_jar": attr.label(
- default=Label("//external:jar"),
- allow_files=True,
- single_file=True),
+ "src": attr.label(allow_files=proto_filetype, single_file=True),
+ # TODO(bazel-team): this should be a hidden attribute with a default
+ # value, but Skylark needs to support select first.
+ "_proto_compiler": attr.label(
+ default=Label("//third_party:protoc"),
+ allow_files=True,
+ single_file=True),
+ "_jar": attr.label(
+ default=Label("//tools/jdk:jar"),
+ allow_files=True,
+ single_file=True),
+ "_jdk": attr.label(
+ default=Label("//tools/jdk:jdk"),
+ allow_files=True),
},
outputs={"srcjar": "lib%{name}.srcjar"},
)
diff --git a/tools/build_rules/java_rules_skylark.bzl b/tools/build_rules/java_rules_skylark.bzl
index 8a59f87b38..21b344d72b 100644
--- a/tools/build_rules/java_rules_skylark.bzl
+++ b/tools/build_rules/java_rules_skylark.bzl
@@ -81,7 +81,7 @@ def java_library_impl(ctx):
"touch " + build_output + "\n")
ctx.action(
inputs = (sources + compile_time_jars_list + [sources_param_file] +
- ctx.files.resources + ctx.files.srcjars),
+ [ctx.file._jar] + ctx.files._jdk + ctx.files.resources + ctx.files.srcjars),
outputs = [class_jar],
mnemonic='Javac',
command=cmd,
@@ -116,7 +116,7 @@ def java_binary_impl(ctx):
"touch " + build_output + "\n")
ctx.action(
- inputs=list(library_result.runtime_jars) + [manifest],
+ inputs=list(library_result.runtime_jars) + [manifest] + ctx.files._jdk,
outputs=[deploy_jar],
mnemonic='Deployjar',
command=cmd,
@@ -167,8 +167,7 @@ def java_binary_impl(ctx):
]),
executable = True)
- runfiles = ctx.runfiles(files = [
- deploy_jar, executable] + ctx.files.jvm, collect_data = True)
+ runfiles = ctx.runfiles(files = [deploy_jar, executable] + ctx.files._jdk, collect_data = True)
files_to_build = set([deploy_jar, manifest, executable])
files_to_build += library_result.files
@@ -191,6 +190,7 @@ java_library_attrs = {
"_java": attr.label(default=Label("//tools/jdk:java"), single_file=True),
"_javac": attr.label(default=Label("//tools/jdk:javac"), single_file=True),
"_jar": attr.label(default=Label("//tools/jdk:jar"), single_file=True),
+ "_jdk": attr.label(default=Label("//tools/jdk:jdk"), allow_files=True),
"data": attr.label_list(allow_files=True, cfg=DATA_CFG),
"resources": attr.label_list(allow_files=True),
"srcs": attr.label_list(allow_files=java_filetype),