forked from bazelbuild/rules_closure
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
95 lines (84 loc) · 1.92 KB
/
BUILD.bazel
File metadata and controls
95 lines (84 loc) · 1.92 KB
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
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load(
"//closure:defs.bzl",
"closure_css_binary",
"closure_css_library",
"closure_js_binary",
"closure_js_library",
"closure_js_template_library",
"web_library",
)
load("//closure/protobuf:defs.bzl", "closure_jspb_library")
package(default_testonly = True)
proto_compile(
name = "build_info_js_proto",
outputs = ["build_info.js"],
plugins = ["//closure/protobuf:protoc-gen-js"],
proto = "//java/io/bazel/rules/closure:build_info_proto",
)
closure_jspb_library(
name = "build_info",
srcs = [":build_info_js_proto"],
internal_descriptors = ["//java/io/bazel/rules/closure:build_info_proto"],
)
closure_css_library(
name = "css",
srcs = ["index.css"],
)
closure_css_binary(
name = "style",
debug = False,
renaming = True,
visibility = ["//visibility:public"],
deps = [":css"],
)
closure_js_template_library(
name = "soy",
srcs = ["app.soy"],
deps = [":build_info"],
)
closure_js_library(
name = "app",
srcs = ["app.js"],
deps = [
":build_info",
":soy",
"//closure/goog/dom",
"//closure/goog/soy",
"//closure/goog/ui:component",
"//closure/protobuf:jspb",
],
)
closure_js_library(
name = "main",
srcs = ["main.js"],
deps = [":app"],
)
closure_js_binary(
name = "bundle",
compilation_level = "ADVANCED",
css = ":style",
debug = False,
defs = [
"--define=GREETING=world",
],
entry_points = ["goog:example.main"],
output_wrapper = "(function(){%output%}).call(this);",
deps = [":main"],
)
web_library(
name = "assets",
srcs = [
"bundle.js",
"style.css",
],
path = "/",
)
# ProTip: bazel run //closure/compiler/test/app:web
web_library(
name = "web",
srcs = ["index.html"],
path = "/",
port = "8080",
deps = [":assets"],
)