summaryrefslogtreecommitdiff
path: root/bazel/BUILD.ra
blob: 517a0347631936649d4a25d76b783ddad6833870 (plain)
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
load("@rules_erlang//:erlang_bytecode2.bzl", "erlang_bytecode", "erlc_opts")
load("@rules_erlang//:erlang_app.bzl", "erlang_app")

erlc_opts(
    name = "erlc_opts",
    values = select({
        "@rules_erlang//:debug_build": [
            "+debug_info",
            "+warn_export_vars",
            "+warn_obsolete_guard",
            "+warn_shadow_vars",
        ],
        "//conditions:default": [
            "+debug_info",
            "+deterministic",
            "+warn_export_vars",
            "+warn_obsolete_guard",
            "+warn_shadow_vars",
        ],
    }),
    visibility = [":__subpackages__"],
)

erlang_bytecode(
    name = "behaviours",
    srcs = [
        "src/ra_machine.erl",
        "src/ra_snapshot.erl",
    ],
    hdrs = [":public_and_private_hdrs"],
    app_name = "ra",
    dest = "ebin",
    erlc_opts = "//:erlc_opts",
)

erlang_bytecode(
    name = "other_beam",
    srcs = [
        "src/ra.erl",
        "src/ra_app.erl",
        "src/ra_bench.erl",
        "src/ra_counters.erl",
        "src/ra_dbg.erl",
        "src/ra_directory.erl",
        "src/ra_env.erl",
        "src/ra_ets_queue.erl",
        "src/ra_file_handle.erl",
        "src/ra_flru.erl",
        "src/ra_leaderboard.erl",
        "src/ra_lib.erl",
        "src/ra_log.erl",
        "src/ra_log_cache.erl",
        "src/ra_log_ets.erl",
        "src/ra_log_meta.erl",
        "src/ra_log_pre_init.erl",
        "src/ra_log_reader.erl",
        "src/ra_log_segment.erl",
        "src/ra_log_segment_writer.erl",
        "src/ra_log_snapshot.erl",
        "src/ra_log_sup.erl",
        "src/ra_log_wal.erl",
        "src/ra_log_wal_sup.erl",
        "src/ra_machine_ets.erl",
        "src/ra_machine_simple.erl",
        "src/ra_metrics_ets.erl",
        "src/ra_monitors.erl",
        "src/ra_server.erl",
        "src/ra_server_proc.erl",
        "src/ra_server_sup.erl",
        "src/ra_server_sup_sup.erl",
        "src/ra_sup.erl",
        "src/ra_system.erl",
        "src/ra_system_sup.erl",
        "src/ra_systems_sup.erl",
    ],
    hdrs = [":public_and_private_hdrs"],
    app_name = "ra",
    beam = [":behaviours"],
    dest = "ebin",
    erlc_opts = "//:erlc_opts",
    deps = [
        "@gen_batch_server//:erlang_app",
    ],
)

filegroup(
    name = "beam_files",
    srcs = [
        ":behaviours",
        ":other_beam",
    ],
)

filegroup(
    name = "srcs",
    srcs = [
        "src/ra.app.src",
        "src/ra.erl",
        "src/ra_app.erl",
        "src/ra_bench.erl",
        "src/ra_counters.erl",
        "src/ra_dbg.erl",
        "src/ra_directory.erl",
        "src/ra_env.erl",
        "src/ra_ets_queue.erl",
        "src/ra_file_handle.erl",
        "src/ra_flru.erl",
        "src/ra_leaderboard.erl",
        "src/ra_lib.erl",
        "src/ra_log.erl",
        "src/ra_log_cache.erl",
        "src/ra_log_ets.erl",
        "src/ra_log_meta.erl",
        "src/ra_log_pre_init.erl",
        "src/ra_log_reader.erl",
        "src/ra_log_segment.erl",
        "src/ra_log_segment_writer.erl",
        "src/ra_log_snapshot.erl",
        "src/ra_log_sup.erl",
        "src/ra_log_wal.erl",
        "src/ra_log_wal_sup.erl",
        "src/ra_machine.erl",
        "src/ra_machine_ets.erl",
        "src/ra_machine_simple.erl",
        "src/ra_metrics_ets.erl",
        "src/ra_monitors.erl",
        "src/ra_server.erl",
        "src/ra_server_proc.erl",
        "src/ra_server_sup.erl",
        "src/ra_server_sup_sup.erl",
        "src/ra_snapshot.erl",
        "src/ra_sup.erl",
        "src/ra_system.erl",
        "src/ra_system_sup.erl",
        "src/ra_systems_sup.erl",
    ],
)

filegroup(
    name = "private_hdrs",
    srcs = [
        "src/ra.hrl",
        "src/ra_server.hrl",
    ],
)

filegroup(name = "public_hdrs")

filegroup(name = "priv")

filegroup(
    name = "licenses",
    srcs = [
        "LICENSE",
        "LICENSE-APACHE2",
        "LICENSE-MPL-RabbitMQ",
    ],
)

filegroup(
    name = "public_and_private_hdrs",
    srcs = [
        ":private_hdrs",
        ":public_hdrs",
    ],
)

filegroup(
    name = "all_srcs",
    srcs = [
        ":public_and_private_hdrs",
        ":srcs",
    ],
)

erlang_app(
    name = "erlang_app",
    srcs = [":all_srcs"],
    hdrs = [":public_hdrs"],
    app_name = "ra",
    beam_files = [":beam_files"],
    extra_apps = [
        "crypto",
        "sasl",
    ],
    license_files = [":license_files"],
    priv = [":priv"],
    deps = [
        "@aten//:erlang_app",
        "@gen_batch_server//:erlang_app",
        "@seshat//:erlang_app",
    ],
)

alias(
    name = "ra",
    actual = ":erlang_app",
    visibility = ["//visibility:public"],
)

filegroup(
    name = "license_files",
    srcs = [
        "LICENSE",
        "LICENSE-APACHE2",
        "LICENSE-MPL-RabbitMQ",
    ],
)