Skip to content

Commit

Permalink
Stop using the deprecated ctx.new_file function.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuetschard committed Jun 24, 2019
1 parent f3c4d96 commit e68ffad
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gapidapk/android/apk/rules.bzl
Expand Up @@ -19,7 +19,7 @@ def _strip_impl(ctx):
outs = []
cc_toolchain = find_cpp_toolchain(ctx)
if cc_toolchain.cpu == ctx.attr.abi:
out = ctx.new_file("lib/{}/{}".format(ctx.attr.abi, ctx.file.lib.basename))
out = ctx.actions.declare_file("lib/{}/{}".format(ctx.attr.abi, ctx.file.lib.basename))
ctx.actions.run(
executable = cc_toolchain.strip_executable(),
arguments = ["--strip-unneeded", "-o", out.path, ctx.file.lib.path],
Expand Down
6 changes: 3 additions & 3 deletions tools/build/rules/apic.bzl
Expand Up @@ -32,7 +32,7 @@ def _apic_binary_impl(ctx):
apilist = api.includes.to_list()
generated = depset()

outputs = [ctx.new_file(ctx.label.name + ".bapi")]
outputs = [ctx.actions.declare_file(ctx.label.name + ".bapi")]
generated += outputs

ctx.actions.run(
Expand Down Expand Up @@ -85,7 +85,7 @@ def _apic_compile_impl(ctx):

cc_toolchain = find_cpp_toolchain(ctx)
target = cc_toolchain.cpu
outputs = [ctx.new_file(ctx.label.name + ".o")]
outputs = [ctx.actions.declare_file(ctx.label.name + ".o")]

ctx.actions.run(
inputs = apilist,
Expand Down Expand Up @@ -177,7 +177,7 @@ def _apic_template_impl(ctx):
for template in ctx.attr.templates:
template = template[ApicTemplate]
templatelist = template.uses.to_list()
outputs = [ctx.new_file(out.format(api = apiname)) for out in template.outputs]
outputs = [ctx.actions.declare_file(out.format(api = apiname)) for out in template.outputs]
generated += outputs
ctx.actions.run(
inputs = apilist + templatelist,
Expand Down
4 changes: 2 additions & 2 deletions tools/build/rules/cc.bzl
Expand Up @@ -46,7 +46,7 @@ def _strip_impl(ctx):
extension = "." + extension
if ctx.label.name.endswith(extension):
extension = ""
out = ctx.new_file(ctx.label.name + extension)
out = ctx.actions.declare_file(ctx.label.name + extension)

flags = []
cc_toolchain = find_cpp_toolchain(ctx)
Expand Down Expand Up @@ -92,7 +92,7 @@ strip = rule(
# a symbol dump file that can be uploaded to the crash server to symbolize
# stack traces of uploaded crash dumps.
def _symbols_impl(ctx):
out = ctx.new_file(ctx.label.name)
out = ctx.actions.declare_file(ctx.label.name)
bin = ctx.file.src
cc_toolchain = find_cpp_toolchain(ctx)
if cc_toolchain.cpu.startswith("darwin"):
Expand Down
6 changes: 3 additions & 3 deletions tools/build/rules/common.bzl
Expand Up @@ -59,7 +59,7 @@ def _copy_to_impl(ctx):
outs = []
for src in filtered:
dstname = ctx.attr.rename.get(src.basename, default = src.basename)
dst = ctx.new_file(ctx.bin_dir, ctx.attr.to + "/" + dstname)
dst = ctx.actions.declare_file(ctx.attr.to + "/" + dstname)
outs += [dst]
_copy(ctx, src, dst)

Expand Down Expand Up @@ -91,7 +91,7 @@ def _copy_tree_impl(ctx):
path = path[len(ctx.attr.strip):]
if ctx.attr.to:
path = ctx.attr.to + "/" + path
dst = ctx.new_file(ctx.bin_dir, path)
dst = ctx.actions.declare_file(path)
outs += [dst]
_copy(ctx, src, dst)

Expand Down Expand Up @@ -122,7 +122,7 @@ def _copy_exec_impl(ctx):
extension = "." + extension
if ctx.label.name.endswith(extension):
extension = ""
out = ctx.new_file(ctx.label.name + extension)
out = ctx.actions.declare_file(ctx.label.name + extension)

_copy(ctx, src, out)

Expand Down
2 changes: 1 addition & 1 deletion tools/build/rules/embed.bzl
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

def _embed_impl(ctx):
out = ctx.new_file(ctx.label.name + ".go")
out = ctx.actions.declare_file(ctx.label.name + ".go")
args = ["--out", out.path]
if ctx.attr.package:
args += ["--package", ctx.attr.package]
Expand Down
2 changes: 1 addition & 1 deletion tools/build/rules/lingo.bzl
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

def _lingo_impl(ctx):
outs = [ctx.new_file(src.basename[:-6]+".go") for src in ctx.files.srcs]
outs = [ctx.actions.declare_file(src.basename[:-6]+".go") for src in ctx.files.srcs]
ctx.actions.run(
inputs = ctx.files.srcs,
outputs = outs,
Expand Down
6 changes: 3 additions & 3 deletions tools/build/rules/stringgen.bzl
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.

def _stringgen_impl(ctx):
go = ctx.new_file(ctx.label.name+".go")
api = ctx.new_file(ctx.label.name+".api")
table = ctx.new_file("en-us.stb")
go = ctx.actions.declare_file(ctx.label.name+".go")
api = ctx.actions.declare_file(ctx.label.name+".api")
table = ctx.actions.declare_file("en-us.stb")
ctx.actions.run(
inputs = [ctx.file.input],
outputs = [go, api, table],
Expand Down
2 changes: 1 addition & 1 deletion tools/build/rules/zip.bzl
Expand Up @@ -18,7 +18,7 @@ def _extract_impl(ctx):
if ctx.attr.dir:
base = ctx.attr.dir + "/"
for entry in ctx.attr.entries:
out = ctx.new_file(ctx.bin_dir, base + entry)
out = ctx.actions.declare_file(base + entry)
to = out.path[:-len(entry)]
outs += [out]
ctx.actions.run_shell(
Expand Down

0 comments on commit e68ffad

Please sign in to comment.