From ebb8171021419bf6ce3e807ffb9861ede285f298 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 31 Dec 2020 16:41:01 +0100 Subject: [PATCH] Add css-browser-selector to BAZEL build file in data/web/js/vendor --- qt/aqt/data/web/js/vendor/BUILD.bazel | 7 +++++++ ts/css-browser-selector.bzl | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/qt/aqt/data/web/js/vendor/BUILD.bazel b/qt/aqt/data/web/js/vendor/BUILD.bazel index 99e7ff45f..7f45af741 100644 --- a/qt/aqt/data/web/js/vendor/BUILD.bazel +++ b/qt/aqt/data/web/js/vendor/BUILD.bazel @@ -1,6 +1,7 @@ load("//ts:jquery.bzl", "copy_jquery") load("//ts:jquery-ui.bzl", "copy_jquery_ui") load("//ts:protobufjs.bzl", "copy_protobufjs") +load("//ts:css-browser-selector.bzl", "copy_css_browser_selector") copy_jquery( name = "jquery", @@ -17,11 +18,17 @@ copy_protobufjs( visibility = ["//visibility:public"], ) +copy_css_browser_selector( + name = "css-browser-selector", + visibility = ["//visibility:public"], +) + files = [ "jquery", "jquery-ui", "protobufjs", + "css-browser-selector", ] directories = [ diff --git a/ts/css-browser-selector.bzl b/ts/css-browser-selector.bzl index 7db733d56..ad2c4578b 100644 --- a/ts/css-browser-selector.bzl +++ b/ts/css-browser-selector.bzl @@ -3,14 +3,14 @@ load("//ts:copy.bzl", "copy_files") "Rule to copy css-browser-selector subset from node_modules to vendor folder." _include = [ - "css-browser-selector.min.js", + "css_browser_selector.min.js", ] _unwanted_prefix = "external/npm/node_modules/css-browser-selector/" -def _copy_browsersel(ctx): +def _copy_css_browser_selector_impl(ctx): wanted = [] - for f in ctx.attr.browsersel.files.to_list(): + for f in ctx.attr.css_browser_selector.files.to_list(): path = f.path want = True @@ -21,9 +21,9 @@ def _copy_browsersel(ctx): return copy_files(ctx, wanted) -copy_browsersel = rule( - implementation = _copy_browsersel_impl, +copy_css_browser_selector = rule( + implementation = _copy_css_browser_selector_impl, attrs = { - "browsersel": attr.label(default = "@npm//css-browser-selector:css_browser-selector__files"), + "css_browser_selector": attr.label(default = "@npm//css-browser-selector:css-browser-selector__files"), }, )