summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2014-06-11 16:38:48 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2014-06-11 16:38:48 -0500
commit908028858fc4376c02951dd1e524008d24c453f1 (patch)
tree8cfda962b1518b59a4e099400d7f11049f8794c4 /bootstrap
parent7936f9e873beb5887a8a81c24bdcbe09de3dd337 (diff)
parent4e67d254db38f349885fe5bb7dab764a9978deff (diff)
Merge pull request #292 from matwey/namespaced_types
Namespaced types: fix build for 17.0
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap16
1 files changed, 16 insertions, 0 deletions
diff --git a/bootstrap b/bootstrap
index 019aaea..f6aa6cc 100755
--- a/bootstrap
+++ b/bootstrap
@@ -28,10 +28,20 @@ main(Args) ->
%% Extract the system info of the version of OTP we use to compile rebar
OtpInfo = string:strip(erlang:system_info(otp_release), both, $\n),
+ %% Types dict:dict() and digraph:digraph() have been introduced in Erlang 17.
+ %% At the same time, their counterparts dict() and digraph() are to be deprecated
+ %% in Erlang 18. namespaced_types option is used to select proper type name
+ %% depending of the OTP version used.
+ NamespacedTypes = case is_otp(OtpInfo, "^[0-9]+") of
+ true -> {d, namespaced_types};
+ false -> undefined
+ end,
+
%% Compile all src/*.erl to ebin
case make:files(filelib:wildcard("src/*.erl"),
[{outdir, "ebin"}, {i, "include"},
DebugFlag,
+ NamespacedTypes,
{d, 'BUILD_TIME', Built},
{d, 'VCS_INFO', VcsInfo},
{d, 'OTP_INFO', OtpInfo}]) of
@@ -79,6 +89,12 @@ main(Args) ->
"Place this script anywhere in your path\n"
"and you can use rebar to build OTP-compliant apps.\n").
+is_otp(OtpInfo, Regex) ->
+ case re:run(OtpInfo, Regex, [{capture, none}]) of
+ match -> true;
+ nomatch -> false
+ end.
+
rm(Path) ->
NativePath = filename:nativename(Path),
Cmd = case os:type() of