From a25094d386c0c0e820d2846e1df7ac71aa082ade Mon Sep 17 00:00:00 2001 From: Nicolas Lopez Date: Thu, 16 Aug 2018 13:13:42 -0400 Subject: [PATCH] Remove usages of deprecated Bazel features (#494) --- container/flatten.bzl | 3 +-- container/layer_tools.bzl | 3 +-- container/push.bzl | 6 ++---- java/image.bzl | 19 +++++++------------ 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/container/flatten.bzl b/container/flatten.bzl index c7b69249d..a3ddd8e39 100644 --- a/container/flatten.bzl +++ b/container/flatten.bzl @@ -62,8 +62,7 @@ def _impl(ctx): container_flatten = rule( attrs = dict({ "image": attr.label( - allow_files = [".tar"], - single_file = True, + allow_single_file = [".tar"], mandatory = True, ), "_flattener": attr.label( diff --git a/container/layer_tools.bzl b/container/layer_tools.bzl index 471a5082e..40453bdb4 100644 --- a/container/layer_tools.bzl +++ b/container/layer_tools.bzl @@ -185,8 +185,7 @@ def incremental_load( tools = { "incremental_load_template": attr.label( default = Label("//container:incremental_load_template"), - single_file = True, - allow_files = True, + allow_single_file = True, ), "join_layers": attr.label( default = Label("//container:join_layers"), diff --git a/container/push.bzl b/container/push.bzl index 87400dfb8..471925da5 100644 --- a/container/push.bzl +++ b/container/push.bzl @@ -116,8 +116,7 @@ def _impl(ctx): container_push = rule( attrs = dict({ "image": attr.label( - allow_files = [".tar"], - single_file = True, + allow_single_file = [".tar"], mandatory = True, ), "registry": attr.string(mandatory = True), @@ -132,8 +131,7 @@ container_push = rule( ), "_tag_tpl": attr.label( default = Label("//container:push-tag.sh.tpl"), - single_file = True, - allow_files = True, + allow_single_file = True, ), "_pusher": attr.label( default = Label("@containerregistry//:pusher"), diff --git a/java/image.bzl b/java/image.bzl index fb49f7ef5..72a7a7d87 100644 --- a/java/image.bzl +++ b/java/image.bzl @@ -21,8 +21,15 @@ The signature of war_image is compatible with java_library. load( "//container:container.bzl", "container_pull", + _container = "container", _repositories = "repositories", ) +load( + "//lang:image.bzl", + "dep_layer_impl", + "layer_file_path", + "runfiles_dir", +) # Load the resolved digests. load( @@ -88,11 +95,6 @@ DEFAULT_JETTY_BASE = select({ "//conditions:default": "@jetty_image_base//image", }) -load( - "//container:container.bzl", - _container = "container", -) - def java_files(f): files = [] if java_common.provider in f: @@ -102,13 +104,6 @@ def java_files(f): files += list(f.files) return files -load( - "//lang:image.bzl", - "dep_layer_impl", - "layer_file_path", - "runfiles_dir", -) - def _jar_dep_layer_impl(ctx): """Appends a layer for a single dependency's runfiles.""" return dep_layer_impl(ctx, runfiles = java_files)