This is an automated email from the ASF dual-hosted git repository.
nwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/master by this push:
new 6693ea1 changes for bazel 0.27+ compatibility (#3325)
6693ea1 is described below
commit 6693ea1ce1a2ed2e0e63943fb3a5f89769ba3cdb
Author: Rohan Agarwal <[email protected]>
AuthorDate: Wed Aug 7 23:05:06 2019 -0700
changes for bazel 0.27+ compatibility (#3325)
---
scripts/packages/self_extract_binary.bzl | 3 +--
tools/rules/genproto.bzl | 10 ++++------
tools/rules/jarjar_rules.bzl | 10 ++++------
tools/rules/javadoc.bzl | 5 ++---
4 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/scripts/packages/self_extract_binary.bzl
b/scripts/packages/self_extract_binary.bzl
index 60912f1..a05b548 100644
--- a/scripts/packages/self_extract_binary.bzl
+++ b/scripts/packages/self_extract_binary.bzl
@@ -75,8 +75,7 @@ self_extract_binary = rule(
attrs = {
"launcher": attr.label(
mandatory=True,
- allow_files=True,
- single_file=True),
+ allow_single_file=True),
"empty_files": attr.string_list(default=[]),
"resources": attr.label_list(
default=[],
diff --git a/tools/rules/genproto.bzl b/tools/rules/genproto.bzl
index 09ec679..67e4cae 100644
--- a/tools/rules/genproto.bzl
+++ b/tools/rules/genproto.bzl
@@ -22,8 +22,7 @@ def proto_package_impl(ctx):
genproto_base_attrs = {
"src": attr.label(
- allow_files = [".proto"],
- single_file = True,
+ allow_single_file = [".proto"],
),
"deps": attr.label_list(
allow_files = False,
@@ -40,7 +39,7 @@ def genproto_java_impl(ctx):
src = ctx.file.src
protoc = ctx.file._protoc
- srcjar = ctx.new_file(ctx.configuration.genfiles_dir, ctx.label.name +
".srcjar")
+ srcjar = ctx.actions.declare_file("%s.srcjar" % ctx.attr.name)
java_srcs = srcjar.path + ".srcs"
inputs = [src, protoc]
@@ -52,7 +51,7 @@ def genproto_java_impl(ctx):
"jar cMf " + srcjar.path + " -C " + java_srcs + " .",
"rm -rf " + java_srcs,
])
- ctx.action(
+ ctx.actions.run_shell(
inputs = inputs,
outputs = [srcjar],
mnemonic = 'ProtocJava',
@@ -65,8 +64,7 @@ genproto_java_attrs = dict(genproto_base_attrs)
genproto_java_attrs.update({
"_protoc": attr.label(
default = Label("@com_google_protobuf//:protoc"),
- allow_files = True,
- single_file = True,
+ allow_single_file = True,
),
})
diff --git a/tools/rules/jarjar_rules.bzl b/tools/rules/jarjar_rules.bzl
index 5ac8272..64f8e0c 100644
--- a/tools/rules/jarjar_rules.bzl
+++ b/tools/rules/jarjar_rules.bzl
@@ -18,9 +18,9 @@ def jarjar_binary_impl(ctx):
jarjar = ctx.executable._jarjar
class_jar = ctx.outputs.class_jar
- ctx.action(
+ ctx.actions.run(
executable = jarjar,
- inputs = [ src_file, shade_file, jarjar ],
+ inputs = [ src_file, shade_file ],
outputs = [ class_jar ],
arguments = ["process", shade_file.path, src_file.path, class_jar.path])
@@ -34,12 +34,10 @@ def jarjar_binary_impl(ctx):
jarjar_attrs = {
"src": attr.label(
- allow_files = [".jar"],
- single_file = True,
+ allow_single_file = [".jar"],
),
"shade": attr.label(
- allow_files = True,
- single_file = True,
+ allow_single_file = True,
),
"deps": attr.label_list(),
"_jarjar": attr.label(
diff --git a/tools/rules/javadoc.bzl b/tools/rules/javadoc.bzl
index 3fb7c49..23af53d 100644
--- a/tools/rules/javadoc.bzl
+++ b/tools/rules/javadoc.bzl
@@ -49,7 +49,7 @@ def _impl(ctx):
"find %s -exec touch -t 198001010000 '{}' ';'" % dir,
"(cd %s && zip -qr ../%s *)" % (dir, ctx.outputs.zip.basename),
]
- ctx.action(
+ ctx.actions.run_shell(
inputs = list(transitive_jar_set) + list(source_jars) + ctx.files._jdk,
outputs = [zip_output],
command = " && ".join(cmd))
@@ -61,8 +61,7 @@ java_doc = rule(
"external_docs": attr.string_list(),
"_javadoc": attr.label(
default = Label("@local_jdk//:bin/javadoc"),
- single_file = True,
- allow_files = True,
+ allow_single_file = True,
),
"_jdk": attr.label(
default = Label("@local_jdk//:bin/javadoc"),