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:
commit
feee26723e
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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__"],
|
||||
)
|
17
ts/copy.bzl
17
ts/copy.bzl
@ -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__"],
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user