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("@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")
|
load("compile_sass.bzl", "compile_sass")
|
||||||
|
|
||||||
compile_sass(
|
compile_sass(
|
||||||
@ -17,7 +17,7 @@ copy_file(
|
|||||||
out = "core.css",
|
out = "core.css",
|
||||||
)
|
)
|
||||||
|
|
||||||
copy_page(
|
copy_files_into_group(
|
||||||
name = "editor",
|
name = "editor",
|
||||||
srcs = [
|
srcs = [
|
||||||
"editor.css",
|
"editor.css",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
||||||
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
|
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:prettier.bzl", "prettier_test")
|
||||||
load("//ts:eslint.bzl", "eslint_test")
|
load("//ts:eslint.bzl", "eslint_test")
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ filegroup(
|
|||||||
output_group = "es5_sources",
|
output_group = "es5_sources",
|
||||||
)
|
)
|
||||||
|
|
||||||
copy_page(
|
copy_files_into_group(
|
||||||
name = "editor",
|
name = "editor",
|
||||||
srcs = [
|
srcs = [
|
||||||
"editor.js",
|
"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",
|
name = "graphs_page",
|
||||||
srcs = [
|
srcs = [
|
||||||
"graphs.css",
|
"graphs.css",
|
||||||
@ -10,7 +10,7 @@ copy_page(
|
|||||||
package = "//ts/graphs",
|
package = "//ts/graphs",
|
||||||
)
|
)
|
||||||
|
|
||||||
copy_page(
|
copy_files_into_group(
|
||||||
name = "congrats_page",
|
name = "congrats_page",
|
||||||
srcs = [
|
srcs = [
|
||||||
"congrats.html",
|
"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):
|
def copy_files(ctx, files):
|
||||||
cmds = []
|
cmds = []
|
||||||
inputs = []
|
inputs = []
|
||||||
@ -51,3 +53,18 @@ def copy_select_files(ctx, files, include, exclude, base, unwanted_prefix):
|
|||||||
wanted.append((f, output))
|
wanted.append((f, output))
|
||||||
|
|
||||||
return copy_files(ctx, wanted)
|
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