summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorEric Meadows-Jönsson <eric.meadows.jonsson@gmail.com>2018-12-29 15:57:19 +0100
committerEric Meadows-Jönsson <eric.meadows.jonsson@gmail.com>2018-12-30 16:06:58 +0100
commit6a5ad07bc49a366ecc81ea87feb2de77c825771a (patch)
tree3b6ca817d2a97665314305f32b3682e7f881f664 /bootstrap
parent968458b43592ee112ea85addc674af3beb476da6 (diff)
Update hex_core and add mirror_of repo config
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap20
1 files changed, 15 insertions, 5 deletions
diff --git a/bootstrap b/bootstrap
index ebbf35b..505963c 100755
--- a/bootstrap
+++ b/bootstrap
@@ -135,13 +135,23 @@ compile(App, FirstFiles) ->
filelib:ensure_dir(filename:join([Dir, "ebin", "dummy.beam"])),
code:add_path(filename:join(Dir, "ebin")),
FirstFilesPaths = [filename:join([Dir, "src", Module]) || Module <- FirstFiles],
+ LeexFiles = filelib:wildcard(filename:join([Dir, "src", "*.xrl"])),
+ [compile_xrl_file(X) || X <- LeexFiles],
+ YeccFiles = filelib:wildcard(filename:join([Dir, "src", "*.yrl"])),
+ [compile_yrl_file(X) || X <- YeccFiles],
Sources = FirstFilesPaths ++ filelib:wildcard(filename:join([Dir, "src", "*.erl"])),
- [compile_file(X, [{i, filename:join(Dir, "include")}
+ [compile_erl_file(X, [{i, filename:join(Dir, "include")}
,debug_info
,{outdir, filename:join(Dir, "ebin")}
,return | additional_defines()]) || X <- Sources].
-compile_file(File, Opts) ->
+compile_xrl_file(File) ->
+ {ok, _} = leex:file(File).
+
+compile_yrl_file(File) ->
+ {ok, _} = yecc:file(File).
+
+compile_erl_file(File, Opts) ->
case compile:file(File, Opts) of
{ok, _Mod} ->
ok;
@@ -162,7 +172,7 @@ bootstrap_rebar3() ->
filename:absname("_build/default/lib/rebar/src")),
true = Res == ok orelse Res == exists,
Sources = ["src/rebar_resource_v2.erl", "src/rebar_resource.erl" | filelib:wildcard("src/*.erl")],
- [compile_file(X, [{outdir, "_build/default/lib/rebar/ebin/"}
+ [compile_erl_file(X, [{outdir, "_build/default/lib/rebar/ebin/"}
,return | additional_defines()]) || X <- Sources],
code:add_patha(filename:absname("_build/default/lib/rebar/ebin")).
@@ -471,7 +481,7 @@ make_normalized_path(Path) ->
AbsPath = make_absolute_path(Path),
Components = filename:split(AbsPath),
make_normalized_path(Components, []).
-
+
make_absolute_path(Path) ->
case filename:pathtype(Path) of
absolute ->
@@ -636,7 +646,7 @@ join([], Sep) when is_list(Sep) ->
join([H|T], Sep) ->
H ++ lists:append([Sep ++ X || X <- T]).
-%% Same for chr; no non-deprecated equivalent in OTP20+
+%% Same for chr; no non-deprecated equivalent in OTP20+
chr(S, C) when is_integer(C) -> chr(S, C, 1).
chr([C|_Cs], C, I) -> I;
chr([_|Cs], C, I) -> chr(Cs, C, I+1);