Merge pull request #974 from hgiesel/copyfiles

Move copy_page to ts/copy.bzl and rename to copy_files_into_group
This commit is contained in:
Damien Elmes 2021-02-03 13:08:22 +10:00 committed by GitHub
commit feee26723e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 23 deletions

View File

@ -1,5 +1,5 @@
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("//qt/aqt/data/web/pages:defs.bzl", "copy_page")
load("//ts:copy.bzl", "copy_files_into_group")
load("compile_sass.bzl", "compile_sass")
compile_sass(
@ -17,7 +17,7 @@ copy_file(
out = "core.css",
)
copy_page(
copy_files_into_group(
name = "editor",
srcs = [
"editor.css",

View File

@ -1,6 +1,6 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("//qt/aqt/data/web/pages:defs.bzl", "copy_page")
load("//ts:copy.bzl", "copy_files_into_group")
load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test")
@ -30,7 +30,7 @@ filegroup(
output_group = "es5_sources",
)
copy_page(
copy_files_into_group(
name = "editor",
srcs = [
"editor.js",

View File

@ -1,6 +1,6 @@
load("defs.bzl", "copy_page")
load("//ts:copy.bzl", "copy_files_into_group")
copy_page(
copy_files_into_group(
name = "graphs_page",
srcs = [
"graphs.css",
@ -10,7 +10,7 @@ copy_page(
package = "//ts/graphs",
)
copy_page(
copy_files_into_group(
name = "congrats_page",
srcs = [
"congrats.html",

View File

@ -1,16 +0,0 @@
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
def copy_page(name, package, srcs):
outs = []
for src in srcs:
copy_file(
name = src + "_copy",
src = package + ":" + src,
out = src,
)
native.filegroup(
name = name,
srcs = srcs,
visibility = ["//qt:__subpackages__"],
)

View File

@ -1,3 +1,5 @@
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
def copy_files(ctx, files):
cmds = []
inputs = []
@ -51,3 +53,18 @@ def copy_select_files(ctx, files, include, exclude, base, unwanted_prefix):
wanted.append((f, output))
return copy_files(ctx, wanted)
def copy_files_into_group(name, package, srcs):
outs = []
for src in srcs:
copy_file(
name = src + "_copy",
src = package + ":" + src,
out = src,
)
native.filegroup(
name = name,
srcs = srcs,
visibility = ["//qt:__subpackages__"],
)