-
Notifications
You must be signed in to change notification settings - Fork 11
/
rebar.config.script
84 lines (64 loc) · 1.35 KB
/
rebar.config.script
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
% Auto-generated by https://github.com/Pouriya-Jahanbakhsh/estuff
NameUpper = string:to_upper("achlys").
BuildType =
case os:getenv(NameUpper ++ "_BUILD") of
false ->
default;
BuildTypeX ->
erlang:list_to_atom(string:to_lower(BuildTypeX))
end.
Version =
case os:getenv(NameUpper ++ "_VERSION") of
false ->
{Y, Mo, D} = erlang:date(),
{H, Mi, S} = erlang:time(),
lists:flatten(io_lib:format("~p.~p.~p.~p.~p.~p", [Y, Mo, D, H, Mi, S]));
VersionX ->
VersionX
end.
Release =
fun() ->
{_, {_, RelXOpts}, Cfg2} = lists:keytake(relx, 1, CONFIG),
[{relx, [{release, {achlys, Version}, [{sasl, load}, achlys]} | RelXOpts]} | Cfg2]
end.
Dialyzer =
fun() ->
CONFIG
end.
Test =
fun() ->
CONFIG
end.
Docs =
fun() ->
CONFIG
end.
Shell =
fun() ->
CONFIG
end.
Default =
fun() ->
CONFIG
end.
Cfg =
[]
++
case BuildType of
release ->
Release();
dialyzer ->
Dialyzer();
test ->
Test();
docs ->
Docs();
shell ->
Shell();
_ -> % default: Used as dependency
Default()
end
++
[].
%io:format("~p\n", [Cfg]).
Cfg.