[bazel] Consolidate skylib loads

For importing into G3, this will simplify the regex needed
and allow us to stub out things not supported (e.g. gazelle)

Change-Id: I770f5dee6f29e555356742dae36212ad6cfb713a
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529836
Reviewed-by: Ben Wagner <bungeman@google.com>
This commit is contained in:
Kevin Lubick 2022-04-13 15:57:17 -04:00
parent c49bf3e754
commit 458f4ded2b
9 changed files with 21 additions and 24 deletions

View File

@ -1,9 +1,6 @@
licenses(["notice"])
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//bazel:macros.bzl", "select_multi")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("//bazel:macros.bzl", "gazelle", "select_multi", "selects")
package(default_visibility = ["//:__subpackages__"])

View File

@ -2,8 +2,7 @@ licenses(["notice"])
load(":defs.bzl", "bool_flag", "string_flag_with_values")
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//bazel:macros.bzl", "selects")
# @platforms is found at https://github.com/bazelbuild/platforms
package(default_visibility = ["//:__subpackages__"])

View File

@ -2,6 +2,19 @@
This file contains general helper macros that make our BUILD.bazel files easier to read.
"""
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", _selects = "selects")
load("@rules_python//python:defs.bzl", _py_binary = "py_binary")
load("@py_deps//:requirements.bzl", _requirement = "requirement")
load("@bazel_gazelle//:def.bzl", _gazelle = "gazelle")
# re-export symbols that are commonly used or that are not supported in G3
# (and thus we need to stub out)
selects = _selects
py_binary = _py_binary
requirement = _requirement
gazelle = _gazelle
def select_multi(values_map, default, name = ""):
"""select() but allowing multiple matches of the keys.

View File

@ -1,8 +1,6 @@
licenses(["notice"])
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//bazel:macros.bzl", "generated_cc_atom", "select_multi")
load("//bazel:macros.bzl", "generated_cc_atom", "select_multi", "selects")
cc_library(
name = "androidcodec_srcs",

View File

@ -1,8 +1,6 @@
licenses(["notice"])
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//bazel:macros.bzl", "generated_cc_atom")
load("//bazel:macros.bzl", "generated_cc_atom", "selects")
cc_library(
name = "core_srcs",

View File

@ -1,8 +1,6 @@
licenses(["notice"])
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//bazel:macros.bzl", "generated_cc_atom", "select_multi")
load("//bazel:macros.bzl", "generated_cc_atom", "select_multi", "selects")
cc_library(
name = "typeface_freetype",

View File

@ -1,9 +1,6 @@
licenses(["notice"])
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@rules_python//python:defs.bzl", "py_binary")
load("@py_deps//:requirements.bzl", "requirement")
load("//bazel:macros.bzl", "py_binary", "requirement", "selects")
cc_library(
name = "skcms",

View File

@ -1,7 +1,6 @@
licenses(["notice"])
load("//bazel:macros.bzl", "generated_cc_atom")
load("@rules_python//python:defs.bzl", "py_binary")
load("//bazel:macros.bzl", "generated_cc_atom", "py_binary")
py_binary(
name = "embed_resources",

View File

@ -1,8 +1,6 @@
licenses(["notice"])
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//bazel:macros.bzl", "generated_cc_atom")
load("//bazel:macros.bzl", "generated_cc_atom", "selects")
selects.config_setting_group(
name = "dawn_unix",