-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrebar.config
187 lines (171 loc) · 9.22 KB
/
rebar.config
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
%% The requirements on the OTP version come mainly from the patches
%% for OTP modules - see `otp_patches/` - requiring the version of
%% certain OTP applications, e.g. `mnesia`, to be well known in order
%% for such patches to be applied deterministically.
%%
%% The expected patched OTP modules required for the OTP release are
%% copied explicitly one by one as part of the `relx` overlay
%% configuration (in this `rebar.config`), in order to prevent
%% silently skipping patches e.g. because not built.
%%
%% If the user has a version of OTP that satisfies the specified
%% required minimum OTP version and that includes OTP applications
%% with version different (e.g. greater) than the well known ones
%% (e.g. because of a new OTP version with a higher-versioned OTP
%% application e.g. `mnesia`), then the patched OTP modules are not
%% built (!) though the explicit copying in the `relx` overlay fails.
%% Addressing such a failure consists of updating the content of
%% `otp_patches/`.
{minimum_otp_vsn, "20.1"}.
{erl_opts, [debug_info, {parse_transform, lager_transform},
{lager_extra_sinks, [dsdin_mining, dsdin_pow_cuckoo,
dsdin_metrics, dsdin_sync]}]}.
{deps, [{lager, ".*", {git, "https://github.com/dasudian/lager.git", {tag,"3.6.0.ae1"}}},
{setup, "2.0.2"},
{parse_trans, "3.2.0"},
{mnesia_rocksdb, ".*", {git, "https://github.com/dasudian/mnesia_rocksdb.git", {ref,"618870f"}}},
{enacl, ".*", {git,"https://github.com/dasudian/enacl.git", {ref,"2f50ba6"}}},
{enoise, ".*", {git, "https://github.com/dasudian/enoise.git", {ref, "c3bdb02"}}},
{cowboy, "2.2.2", {git, "https://github.com/ninenines/cowboy.git", {tag, "2.2.2"}}},
{jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "2.8.0"}}},
{jesse, {git, "https://github.com/dasudian/jesse.git", {ref, "4640ad1"}}}, %% Tag `1.5.0-rc2` with workaround for unexported `http_uri:uri()` type.
{gproc, "0.6.1"},
{jobs, "0.7.1"},
{exometer_core, {git, "https://github.com/Feuerlabs/exometer_core.git", {ref, "f088de5"}}},
{poolboy, "1.5.1"},
{yamerl, "0.7.0"},
{msgpack, "0.7.0"},
{base58, {git, "https://github.com/dasudian/erl-base58.git", {ref,"7f6e917"}}},
{eper, ".*", {git, "git://github.com/dasudian/eper.git", {ref, "03d4be3"}}},
{erlexec, ".*", {git, "https://github.com/saleyn/erlexec.git", {ref, "97a5188"}}},
{sha3, {git, "https://github.com/szktty/erlang-sha3", {ref, "dbdfd12"}}},
{sext, {git, "https://github.com/uwiger/sext.git", {ref, "615eebc"}}},
{idna, {git, "https://github.com/dasudian/erlang-idna", {ref, "24bf647"}}}
]}.
%% pc needed for erlexec and version 1.6.0 works, but 1.9.1 does not.
{plugins, [{swagger_endpoints, {git, "https://github.com/dasudian/swagger_endpoints", {tag, "0.2.1"}}}, {pc, "1.6.0"}]}.
{swagger_endpoints, [{src, "config/swagger.yaml"}, {dst, "apps/aeutils/src/endpoints.erl"}]}.
{relx, [{release, { dsdin, "version value comes from VERSION" },
% sasl is required for the command `dsdin versions` to work,
% it is disabled in `sys.config` though.
[runtime_tools, sasl, lager, setup, sext, rocksdb, mnesia_rocksdb, gproc,
jobs, {mnesia, load}, exometer_core, ranch, aecore, aehttp, enacl, enoise,
aebytecode, aevm, aechannel, aesophia]},
{sys_config, "./config/sys.config"},
{vm_args, "./config/vm.args"},
{dev_mode, true},
{include_erts, false},
{overlay, [{copy, "REVISION", "REVISION"},
{copy, "VERSION" , "VERSION"},
{copy, "docs/installation.md" , "docs/installation.md"},
{copy, "docs/configuration.md" , "docs/configuration.md"},
{copy, "docs/operation.md" , "docs/operation.md"},
{copy, "docs/release-notes" , "docs/release-notes"},
{mkdir, "data/aecore/.genesis"},
{copy, "data/aecore/.genesis/accounts.json", "data/aecore/.genesis/accounts.json"},
{copy, "hooks/pre_start.sh", "bin/hooks/pre_start.sh"},
{copy, "apps/check_config/priv/extensions/check_config.sh", "bin/extensions/check_config"},
{copy, "apps/aeutils/priv/extensions/get_peer_key.sh", "bin/extensions/peer_key"},
{copy, "apps/aeutils/test/data/dsdin_testnet.yaml", "docs/examples/dsdin_testnet.yaml"},
{copy, "otp_patches/ebin/mnesia.beam" , "patches/ebin/mnesia.beam" },
{copy, "otp_patches/ebin/mnesia_index.beam" , "patches/ebin/mnesia_index.beam" }
]},
{extended_start_script, true},
{extended_start_script_hooks, [
{pre_start, [{custom, "hooks/pre_start.sh"}]}
]},
{extended_start_script_extensions, [
{check_config, "extensions/check_config"},
{peer_key, "extensions/peer_key"}
]}]
}.
{profiles, [{local, [{relx, [{dev_mode, true},
{include_erts, false},
{include_src, true}]}]
},
{dev1, [{relx, [{dev_mode, false},
{include_erts, false},
{sys_config, "./config/dev1/sys.config"},
{vm_args, "./config/dev1/vm.args"},
{overlay, [{mkdir, "{{output_dir}}/data"},
{copy,
"_build/dev1/bin/check_config",
"{{output_dir}}/bin/check_config"},
{copy,
"_build/dev1/lib/aeutils/priv/dsdin_config_schema.json",
"{{output_dir}}/data/dsdin_config_schema.json"}]}
]}
]
},
{test, [{relx, [{dev_mode, true},
{include_erts, false},
{include_src, true},
{sys_config, "./config/dev1/sys.config"},
{vm_args, "./config/dev1/vm.args"}]},
{dist_node, [{setcookie, 'dsdin_cookie'},
{sname, 'dsdin_ct@localhost'}]},
{deps, [{meck, ".*", {git, "git://github.com/eproxus/meck.git", {tag, "0.8.6"}}},
{websocket_client, ".*", {git,
"git://github.com/dasudian/websocket_client",
{ref, "a4fb3db"}}}
]}
]},
{prod, [{relx, [{dev_mode, false},
{include_erts, true},
{include_src, false},
{overlay, [{copy,
"_build/prod/bin/check_config",
"bin/check_config"},
{copy,
"_build/prod/lib/aeutils/priv/dsdin_config_schema.json",
"data/dsdin_config_schema.json"}]}
]}
]},
{system_test, [
{extra_src_dirs, ["system_test", "system_test/helpers", "apps/aehttp/test"]},
{shell, [{apps, []}]},
{deps, [
bbmustache,
{hackney, "1.12.1"},
{websocket_client, ".*", {git, "git://github.com/dasudian/websocket_client", {ref, "a4fb3db"}}}
]}
]}
]
}.
{escript_main_app, check_config}.
{escript_name, "check_config"}.
{escript_incl_apps, [aeutils, jsx, yamerl, jesse, rfc3339]}.
{escript_shebang, "#!/usr/bin/env escript\n"}.
{escript_comment, "%%\n"}.
{overrides, [{override, exometer_core,
[{erl_opts, [{d,'HUT_LAGER'},
{parse_transform, lager_transform},
debug_info,
fail_on_warning,
{platform_define, "^((1[8|9])|2)", rand_module},
{verbosity, trace}]}]}]}.
{provider_hooks,
[{post, [{compile, escriptize}]}]}.
{pre_hooks, [{"(linux|darwin|solaris|netbsd|freebsd)", compile,
"git rev-parse HEAD > ${REBAR_ROOT_DIR}/REVISION"},
{compile, "make -C ./otp_patches all"},
{compile, "./rebar3 swagger_endpoints"},
{compile, "erlc test/ct_eunit_xform.erl"} %% {ct_first_files, _} does not work
]}.
{post_hooks, [{"(linux|darwin|solaris|netbsd|freebsd)", compile, "rm ct_eunit_xform.beam"},
{clean, "make -C ./otp_patches clean"},
{"(linux|darwin|solaris|netbsd|freebsd)", clean, "rm -f ${REBAR_ROOT_DIR}/REVISION"}
]}.
{overrides, [{override, sha3, [{pre_hooks, [{"(linux|darwin)", compile, "make "},
{"(linux|darwin)", release, "make "},
{"(linux|darwin)", eunit, "make "}]}
]}
]}.
{ct_opts, [
{ct_hooks, [{cth_surefire, [{path, "../junit.xml"}]}]}
]}.
{dialyzer, [
{warnings, [unknown]},
{plt_apps, all_deps},
{base_plt_apps, [erts, kernel, stdlib, crypto, mnesia]}
]}.