forked from gTile/gTile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
134 lines (117 loc) · 2.68 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
#load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm//@bazel/karma:index.bzl", "karma_web_test", "karma_web_test_suite")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load(":execute.bzl", "concat")
package(default_visibility = ["//:__subpackages__"])
# Building the distribution.
# Install the extension to ~/.local/share/gnome-shell/extensions
sh_binary(
name = "install-extension",
srcs = ["install-extension.sh"],
data = [":dist.tar.gz"],
)
sh_binary(
name = "concat",
srcs = ["concat.sh"],
)
# Output a dist.tar.gz folder to bazel-bin for distribution.
pkg_tar(
name = "dist",
srcs = [":dist_files"],
extension = "tar.gz",
mode = "0664",
strip_prefix = ".",
)
filegroup(
name = "dist_files",
srcs = [
"extension.js",
"hotkeys.js",
"metadata.json",
"prefs.js",
"schemas/gschemas.compiled",
"schemas/org.gnome.shell.extensions.gtile.gschema.xml",
"settings.js",
],
)
exports_files([
"tsconfig.json",
"tsconfig-app.json",
])
# NOTE: this will move to node_modules/BUILD in a later release
filegroup(
name = "node_modules",
srcs = glob([
"node_modules/**/*.js",
"node_modules/**/*.d.ts",
"node_modules/**/*.json",
]),
)
ts_library(
name = "app_lib",
srcs = ["app.ts"],
tsconfig = "//:tsconfig-app.json",
deps = [
":resize_lib",
":tilespec_lib",
],
)
ts_library(
name = "entry_lib",
srcs = ["entry.ts"],
tsconfig = "//:tsconfig-app.json",
deps = [":app_lib"],
)
ts_library(
name = "tilespec_lib",
srcs = ["tilespec.ts"],
tsconfig = "//:tsconfig.json",
)
ts_library(
name = "resize_lib",
srcs = ["resize.ts"],
tsconfig = "//:tsconfig.json",
deps = [":tilespec_lib"],
)
ts_library(
name = "tests",
testonly = 1,
srcs = [
"resize.spec.ts",
"tilespec.spec.ts",
],
deps = [
":resize_lib",
":tilespec_lib",
"@npm//@types/chai",
"@npm//@types/mocha",
"@npm//@types/jasmine",
"@npm//chai",
"@npm//jasmine",
"@npm//mocha",
],
)
jasmine_node_test(
name = "testing",
deps = [
":tests",
],
)
rollup_bundle(
name = "bundle",
entry_point = "entry.ts",
deps = [":entry_lib"],
)
concat(
name = "extension",
srcs = [
# Order matters here.
"polyfill.js",
"setup.js",
"bundle.js",
],
out = "extension.js",
)