forked from fwouts/prmonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
48 lines (43 loc) · 1017 Bytes
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package(default_visibility = ["//visibility:public"])
load("@bazel_javascript//:defs.bzl", "npm_packages")
exports_files([
"tsconfig.json",
])
npm_packages(
name = "packages",
package_json = ":package.json",
yarn_lock = ":yarn.lock",
)
genrule(
name = "extension-unpacked",
srcs = [
"//public:images",
"//public:manifest.json",
"//src:popup-prod_bundle",
"//src:background-prod_bundle",
],
outs = ["extension-dir"],
cmd = """
# Create the directory.
mkdir $@
# Copy manifest.json.
cp $(location //public:manifest.json) $@/
# Copy images.
mkdir $@/images
cp -r $(location //public:images) $@/images/
# Copy background script.
cp -r $(location //src:background-prod_bundle)/* $@/
# Copy popup bundle.
cp -r $(location //src:popup-prod_bundle)/* $@/
""",
)
genrule(
name = "extension-packed",
srcs = [":extension-unpacked"],
outs = ["extension.zip"],
cmd = """
origin=$$(pwd)
cd $(location //:extension-unpacked)
zip -r $$origin/$@ *
""",
)