forked from rabbitmq/rabbitmq-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.ranch
46 lines (40 loc) · 1.05 KB
/
BUILD.ranch
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
load("@bazel-erlang//:bazel_erlang_lib.bzl", "app_file", "bazel_erlang_lib", "erlc",
"DEFAULT_ERLC_OPTS")
FIRST_SRCS = [
"src/ranch_transport.erl",
]
erlc(
name = "first_beam_files",
hdrs = glob(["include/**/*.hrl", "src/**/*.hrl"]),
srcs = glob(FIRST_SRCS),
erlc_opts = DEFAULT_ERLC_OPTS,
dest = "ebin",
)
erlc(
name = "beam_files",
hdrs = glob(["include/**/*.hrl", "src/**/*.hrl"]),
srcs = glob(["src/**/*.erl"], exclude = FIRST_SRCS),
beam = [":first_beam_files"],
erlc_opts = DEFAULT_ERLC_OPTS,
dest = "ebin",
)
genrule(
name = "appup",
srcs = ["src/ranch.appup"],
outs = ["ebin/ranch.appup"],
cmd = "cp $< $@",
)
app_file(
name = "app_file",
app_name = "ranch",
app_src = ["src/ranch.app.src"],
modules = [":first_beam_files", ":beam_files"],
)
bazel_erlang_lib(
name = "bazel_erlang_lib",
app_name = "ranch",
app = ":app_file",
hdrs = glob(["include/**/*.hrl"]),
beam = [":first_beam_files", ":beam_files", ":appup"],
visibility = ["//visibility:public"],
)