diff --git a/java/google/registry/builddefs/zip_file.bzl b/java/google/registry/builddefs/zip_file.bzl index 07c42691e..625027e26 100644 --- a/java/google/registry/builddefs/zip_file.bzl +++ b/java/google/registry/builddefs/zip_file.bzl @@ -178,11 +178,11 @@ def _zip_file(ctx): else: # TODO(kchodorow): remove this once Bazel 4.0+ is required. script = ctx.new_file(ctx.configuration.bin_dir, "%s.sh" % ctx.label.name) - ctx.file_action(output = script, content = "\n".join(cmd), executable = True) + ctx.actions.write(output = script, content = "\n".join(cmd), is_executable = True) inputs = [ctx.file._zipper] inputs += [dep.zip_file for dep in ctx.attr.deps] inputs += srcs.to_list() - ctx.action( + ctx.actions.run( inputs = inputs, outputs = [ctx.outputs.out], executable = script, @@ -251,6 +251,6 @@ zip_file = rule( "deps": attr.label_list(providers = ["zip_file"]), "exclude": attr.string_list(), "mappings": attr.string_dict(), - "_zipper": attr.label(default = Label(ZIPPER), single_file = True), + "_zipper": attr.label(default = Label(ZIPPER), allow_single_file = True), }, ) diff --git a/javatests/google/registry/builddefs/zip_contents_test.bzl b/javatests/google/registry/builddefs/zip_contents_test.bzl index fe06d28ec..4feb336e1 100644 --- a/javatests/google/registry/builddefs/zip_contents_test.bzl +++ b/javatests/google/registry/builddefs/zip_contents_test.bzl @@ -48,10 +48,10 @@ def _impl(ctx): 'cd "${repo}"', 'rm -rf "${tmp}"', ] - ctx.file_action( + ctx.actions.write( output = ctx.outputs.executable, content = "\n".join(cmd), - executable = True, + is_executable = True, ) return struct(runfiles = ctx.runfiles([ctx.file.src, ctx.file._zipper])) @@ -61,6 +61,6 @@ zip_contents_test = rule( attrs = { "src": attr.label(allow_single_file = True), "contents": attr.string_dict(), - "_zipper": attr.label(default = Label(ZIPPER), single_file = True), + "_zipper": attr.label(default = Label(ZIPPER), allow_single_file = True), }, )