summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--THANKS2
-rw-r--r--ebin/rebar.app2
-rw-r--r--priv/shell-completion/bash/rebar59
-rw-r--r--priv/shell-completion/zsh/_rebar6
-rw-r--r--rebar.config6
-rw-r--r--rebar.config.sample61
-rw-r--r--src/rebar.erl9
-rw-r--r--src/rebar_core.erl31
-rw-r--r--src/rebar_ct.erl10
-rw-r--r--src/rebar_dia_compiler.erl86
-rw-r--r--src/rebar_erlc_compiler.erl8
-rw-r--r--src/rebar_eunit.erl1
-rw-r--r--src/rebar_neotoma_compiler.erl2
-rw-r--r--src/rebar_port_compiler.erl6
-rw-r--r--src/rebar_qc.erl5
-rw-r--r--src/rebar_require_vsn.erl10
17 files changed, 235 insertions, 74 deletions
diff --git a/Makefile b/Makefile
index 3f7b8ee..4ff331f 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,10 @@ all:
./bootstrap
clean:
- @rm -rf rebar ebin/*.beam inttest/rt.work rt.work .test
+ @rm -rf rebar ebin/*.beam inttest/rt.work rt.work .eunit
+
+distclean: clean
+ @rm -rf deps
debug:
@./bootstrap debug
diff --git a/THANKS b/THANKS
index 16b1f24..1be44e5 100644
--- a/THANKS
+++ b/THANKS
@@ -97,7 +97,7 @@ Eric B Merritt
Fred Hebert
Kresten Krab Thorup
David Aaberg
-DeadZen
+Pedram Nimreezi
Edwin Fine
Lev Walkin
Roberto Ostinelli
diff --git a/ebin/rebar.app b/ebin/rebar.app
index 8df929f..d3a50df 100644
--- a/ebin/rebar.app
+++ b/ebin/rebar.app
@@ -9,6 +9,7 @@
rebar_app_utils,
rebar_appups,
rebar_asn1_compiler,
+ rebar_dia_compiler,
rebar_base_compiler,
rebar_cleaner,
rebar_config,
@@ -67,6 +68,7 @@
rebar_protobuffs_compiler,
rebar_neotoma_compiler,
rebar_asn1_compiler,
+ rebar_dia_compiler,
rebar_erlc_compiler,
rebar_lfe_compiler,
rebar_erlydtl_compiler,
diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar
index d76e2ba..d4a42dc 100644
--- a/priv/shell-completion/bash/rebar
+++ b/priv/shell-completion/bash/rebar
@@ -6,14 +6,57 @@ _rebar()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
- sopts="-h -c -v -V -f -j"
- lopts=" --help --commands --verbose --force --jobs= --version"
- cmdsnvars="check-deps clean compile create create-app create-node ct \
- doc delete-deps escriptize eunit get-deps generate generate-upgrade \
- help list-deps list-templates qc update-deps version xref overlay \
- apps= case= force=1 jobs= suites= verbose=1 appid= \
- previous_release= nodeid= root_dir= skip_deps=true skip_apps= \
- template= template_dir="
+ sopts="-h -c -v -V -f -D -j -C -p -k"
+ lopts="--help \
+ --commands \
+ --verbose \
+ --force \
+ --jobs \
+ --config \
+ --profile \
+ --keep-going \
+ --version"
+ cmdsnvars="check-deps \
+ clean \
+ compile \
+ create \
+ create-app \
+ create-node \
+ ct \
+ doc \
+ delete-deps \
+ escriptize \
+ eunit \
+ get-deps \
+ generate \
+ generate-appups \
+ generate-upgrade \
+ help \
+ list-deps \
+ list-templates \
+ qc \
+ update-deps \
+ version \
+ xref \
+ overlay \
+ apps= \
+ case= \
+ dump_spec=1 \
+ force=1 \
+ jobs= \
+ suites= \
+ verbose=1 \
+ appid= \
+ overlay_vars= \
+ previous_release= \
+ nodeid= \
+ root_dir= \
+ skip_deps=true \
+ skip_apps= \
+ target_dir= \
+ template= \
+ template_dir= \
+ tests="
if [[ ${cur} == --* ]] ; then
COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
diff --git a/priv/shell-completion/zsh/_rebar b/priv/shell-completion/zsh/_rebar
index 7ac5a51..3d04ba1 100644
--- a/priv/shell-completion/zsh/_rebar
+++ b/priv/shell-completion/zsh/_rebar
@@ -43,6 +43,7 @@ _rebar () {
'overlay[Run reltool overlays only]' \
'generate-appups[Generate appup files]' \
'generate-upgrade[Build an upgrade package]' \
+ 'escriptize[Create stand-alone escript executable]' \
'eunit[Run eunit tests]' \
'ct[Run common_test suites]' \
'qc[Test QuickCheck properties]' \
@@ -51,18 +52,21 @@ _rebar () {
'version[Show version information]' \
'apps[Application names to process]:' \
'case[Common Test case]:' \
- 'dump_spec[Dump reltool spec]:' \
+ 'dump_spec[Dump reltool spec]::flag:(1)' \
'jobs[Number of workers]::workers:(0 1 2 3 4 5 6 7 8 9)' \
'suites[Common Test suites]::suite name:_path_files -W "(src test)" -g "*.erl(:r)"' \
'verbose[Verbosity level]::verbosity level:(0 1 2 3)' \
'appid[Application id]:' \
+ 'overlay_vars[Overlay variables file]:' \
'previous_release[Previous release path]:' \
'nodeid[Node id]:' \
'root_dir[Reltool config root directory]::directory:_files -/' \
'skip_deps[Skip deps]::flag:(true false)' \
'skip_apps[Application names to not process]::flag:(true false)' \
+ 'target_dir[Target directory]:' \
'template[Template name]:' \
'template_dir[Template directory]::directory:_files -/' \
+ 'tests[Run eunit tests whose name starts with given string]:' \
&& ret=0
;;
esac
diff --git a/rebar.config b/rebar.config
index cbdaf52..9028737 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,7 +1,6 @@
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 ft=erlang et
-{app_bin, ["priv/rebar"]}.
%% escript_incl_extra is for internal rebar-private use only.
%% Do not use outside rebar. Config interface is not stable.
{escript_incl_extra, [{"priv/templates/*", "."}]}.
@@ -15,5 +14,8 @@
- (\"erlydtl\":\"compile\"/\"3\")
- (\"lfe_comp\":\"file\"/\"2\")
- (\"neotoma\":\"file\"/\"2\")
- - (\"protobuffs_compile\":\"scan_file\"/\"2\"))",
+ - (\"protobuffs_compile\":\"scan_file\"/\"2\")
+ - (\"diameter_codegen\":\"from_dict\"/\"4\")
+ - (\"diameter_dict_util\":\"format_error\"/\"1\")
+ - (\"diameter_dict_util\":\"parse\"/\"2\"))",
[]}]}.
diff --git a/rebar.config.sample b/rebar.config.sample
index fac55af..a6fb03f 100644
--- a/rebar.config.sample
+++ b/rebar.config.sample
@@ -5,6 +5,11 @@
%% == Core ==
+%% Check required ERTS or OTP release version
+{require_erts_vsn, ".*"}.
+{require_otp_vsn, ".*"}.
+{require_min_otp_vsn, ".*"}.
+
%% Additional library directories to add to the code path
{lib_dirs, []}.
@@ -16,7 +21,9 @@
{erl_first_files, ["mymib1", "mymib2"]}.
%% Erlang compiler options
-{erl_opts, [no_debug_info, {i, "myinclude"}, {src_dirs, ["src1", "src2"]},
+{erl_opts, [no_debug_info,
+ {i, "myinclude"},
+ {src_dirs, ["src", "src2", "src3"]},
{platform_define,
"(linux|solaris|freebsd|darwin)", 'HAVE_SENDFILE'},
{platform_define, "(linux|freebsd)", 'BACKLOG', 128},
@@ -28,6 +35,18 @@
%% SNMP mibs to compile first?
{mib_first_files, []}.
+%% leex options
+{xrl_opts, []}.
+
+%% leex files to compile first
+{xrl_first_files, []}.
+
+%% yecc options
+{yrl_opts, []}.
+
+%% yecc files to compile first
+{yrl_first_files, []}.
+
%% == EDoc ==
%% EDoc options
@@ -46,7 +65,14 @@
%% architecture as a filter.
{port_specs, [{"priv/so_name.so", ["c_src/*.c"]},
{"linux", "priv/hello_linux", ["c_src/hello_linux.c"]},
- {"linux", "priv/hello_linux", ["c_src/*.c"], [{env, []}]}}.
+ {"linux", "priv/hello_linux", ["c_src/*.c"], [{env, []}]}]}.
+
+%% == escriptize ==
+{escript_name, "application"}.
+{escript_incl_apps, []}.
+{escript_shebang, "#!/usr/bin/env escript\n"}.
+{escript_comment, "%%\n"}.
+{escript_emu_args, "%%! -pa application/application/ebin\n"}.
%% == LFE Compiler ==
@@ -112,16 +138,8 @@
%% Which files to cleanup
{clean_files, ["file", "file2"]}.
-%% == Reltool ==
-
-%% Target directory for the release
-{target, "target"}.
-
%% == OTP Applications ==
-%% Binaries to link into the erlang path?
-{app_bin, []}.
-
%% Enable validation of the OTP app module list. Default is 'true'
{validate_app_modules, true}.
@@ -139,16 +157,19 @@
{application_name, "1.0.*"},
{application_name, "1.0.*",
{git, "git://github.com/basho/rebar.git", {branch, "master"}}},
-
-%% Dependencies can be marked as 'raw'. Rebar does not require such dependencies
-%% to have a standard Erlang/OTP layout which assumes the presence of either
-%% "src/dependency_name.app.src" or "ebin/dependency_name.app" files.
-%%
-%% 'raw' dependencies can still contain 'rebar.config' and even can have the
-%% proper OTP directory layout, but they won't be compiled.
-%%
-%% Only a subset of rebar commands will be executed on the 'raw' subdirectories:
-%% get-deps, update-deps, check-deps, list-deps and delete-deps.
+ %% Dependencies can be marked as 'raw'. Rebar does not require
+ %% such dependencies to have a standard Erlang/OTP layout
+ %% which assumes the presence of either
+ %% "src/dependency_name.app.src" or "ebin/dependency_name.app"
+ %% files.
+ %%
+ %% 'raw' dependencies can still contain 'rebar.config' and
+ %% even can have the proper OTP directory layout, but they
+ %% won't be compiled.
+ %%
+ %% Only a subset of rebar commands will be executed on the
+ %% 'raw' subdirectories: get-deps, update-deps, check-deps,
+ %% list-deps and delete-deps.
{application_name, "",
{git, "git://github.com/basho/rebar.git", {branch, "master"}},
[raw]}]}.
diff --git a/src/rebar.erl b/src/rebar.erl
index c7c9d29..c872ade 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -283,6 +283,8 @@ commands() ->
clean Clean
compile Compile sources
+escriptize Generate escript archive
+
create template= [var=foo,...] Create skel based on template and vars
create-app [appid=myapp] Create simple app skel
create-node [nodeid=mynode] Create simple node skel
@@ -379,9 +381,10 @@ filter_flags(Config, [Item | Rest], Commands) ->
command_names() ->
["check-deps", "clean", "compile", "create", "create-app", "create-node",
- "ct", "delete-deps", "doc", "eunit", "generate", "generate-appups",
- "generate-upgrade", "get-deps", "help", "list-deps", "list-templates",
- "qc", "update-deps", "overlay", "shell", "version", "xref"].
+ "ct", "delete-deps", "doc", "eunit", "escriptize", "generate",
+ "generate-appups", "generate-upgrade", "get-deps", "help", "list-deps",
+ "list-templates", "qc", "update-deps", "overlay", "shell", "version",
+ "xref"].
unabbreviate_command_names([]) ->
[];
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 9e3f9f0..5396dd5 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -53,9 +53,10 @@ process_commands([Command | Rest], ParentConfig) ->
ParentConfig4 =
try
- %% Convert the code path so that all the entries are absolute paths.
- %% If not, code:set_path() may choke on invalid relative paths when trying
- %% to restore the code path from inside a subdirectory.
+ %% Convert the code path so that all the entries are
+ %% absolute paths. If not, code:set_path() may choke on
+ %% invalid relative paths when trying to restore the code
+ %% path from inside a subdirectory.
true = rebar_utils:expand_code_path(),
{ParentConfig2, _DirSet} = process_dir(rebar_utils:get_cwd(),
ParentConfig1, Command,
@@ -68,8 +69,9 @@ process_commands([Command | Rest], ParentConfig) ->
_ ->
ok
end,
- %% TODO: reconsider after config inheritance removal/redesign
- ParentConfig3 = rebar_config:clean_config(ParentConfig1, ParentConfig2),
+ %% TODO: reconsider after config inheritance removal/re-design
+ ParentConfig3 = rebar_config:clean_config(ParentConfig1,
+ ParentConfig2),
%% Wipe out vsn cache to avoid invalid hits when
%% dependencies are updated
rebar_config:set_xconf(ParentConfig3, vsn_cache, dict:new())
@@ -107,29 +109,29 @@ process_dir(Dir, ParentConfig, Command, DirSet) ->
%% to process this dir.
{ok, AvailModuleSets} = application:get_env(rebar, modules),
ModuleSet = choose_module_set(AvailModuleSets, Dir),
- maybe_process_dir(ModuleSet, Config, CurrentCodePath,
+ skip_or_process_dir(ModuleSet, Config, CurrentCodePath,
Dir, Command, DirSet)
end.
-maybe_process_dir({[], undefined}=ModuleSet, Config, CurrentCodePath,
+skip_or_process_dir({[], undefined}=ModuleSet, Config, CurrentCodePath,
Dir, Command, DirSet) ->
- process_dir0(Dir, Command, DirSet, Config, CurrentCodePath, ModuleSet);
-maybe_process_dir({_, ModuleSetFile}=ModuleSet, Config, CurrentCodePath,
+ process_dir1(Dir, Command, DirSet, Config, CurrentCodePath, ModuleSet);
+skip_or_process_dir({_, ModuleSetFile}=ModuleSet, Config, CurrentCodePath,
Dir, Command, DirSet) ->
case lists:suffix(".app.src", ModuleSetFile)
orelse lists:suffix(".app", ModuleSetFile) of
true ->
%% .app or .app.src file, check if is_skipped_app
- maybe_process_dir0(ModuleSetFile, ModuleSet,
+ skip_or_process_dir1(ModuleSetFile, ModuleSet,
Config, CurrentCodePath, Dir,
Command, DirSet);
false ->
%% not an app dir, no need to consider apps=/skip_apps=
- process_dir0(Dir, Command, DirSet, Config,
+ process_dir1(Dir, Command, DirSet, Config,
CurrentCodePath, ModuleSet)
end.
-maybe_process_dir0(AppFile, ModuleSet, Config, CurrentCodePath,
+skip_or_process_dir1(AppFile, ModuleSet, Config, CurrentCodePath,
Dir, Command, DirSet) ->
case rebar_app_utils:is_skipped_app(Config, AppFile) of
{Config1, {true, SkippedApp}} ->
@@ -137,11 +139,11 @@ maybe_process_dir0(AppFile, ModuleSet, Config, CurrentCodePath,
Config2 = increment_operations(Config1),
{Config2, DirSet};
{Config1, false} ->
- process_dir0(Dir, Command, DirSet, Config1,
+ process_dir1(Dir, Command, DirSet, Config1,
CurrentCodePath, ModuleSet)
end.
-process_dir0(Dir, Command, DirSet, Config0, CurrentCodePath,
+process_dir1(Dir, Command, DirSet, Config0, CurrentCodePath,
{DirModules, ModuleSetFile}) ->
%% Get the list of modules for "any dir". This is a catch-all list
%% of modules that are processed in addition to modules associated
@@ -270,7 +272,6 @@ process_each([Dir | Rest], Command, Config, ModuleSetFile, DirSet) ->
process_each(Rest, Command, Config3, ModuleSetFile, DirSet2)
end.
-
%%
%% Given a list of module sets from rebar.app and a directory, find
%% the appropriate subset of modules for this directory
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl
index e33c6c9..749d025 100644
--- a/src/rebar_ct.erl
+++ b/src/rebar_ct.erl
@@ -26,14 +26,14 @@
%% -------------------------------------------------------------------
%%
%% Targets:
-%% test - runs common test suites in ./test
-%% int_test - runs suites in ./int_test
-%% perf_test - runs suites inm ./perf_test
+%% test - run common test suites in ./test
+%% int_test - run suites in ./int_test
+%% perf_test - run suites inm ./perf_test
%%
%% Global options:
%% verbose=1 - show output from the common_test run as it goes
-%% suites="foo,bar" - runs <test>/foo_SUITE and <test>/bar_SUITE
-%% case="mycase" - runs individual test case foo_SUITE:mycase
+%% suites="foo,bar" - run <test>/foo_SUITE and <test>/bar_SUITE
+%% case="mycase" - run individual test case foo_SUITE:mycase
%% -------------------------------------------------------------------
-module(rebar_ct).
diff --git a/src/rebar_dia_compiler.erl b/src/rebar_dia_compiler.erl
new file mode 100644
index 0000000..51c075b
--- /dev/null
+++ b/src/rebar_dia_compiler.erl
@@ -0,0 +1,86 @@
+%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ts=4 sw=4 et
+%% -------------------------------------------------------------------
+%%
+%% rebar: Erlang Build Tools
+%%
+%% Copyright (c) 2009, 2010 Dave Smith (dizzyd@dizzyd.com)
+%%
+%% Permission is hereby granted, free of charge, to any person obtaining a copy
+%% of this software and associated documentation files (the "Software"), to deal
+%% in the Software without restriction, including without limitation the rights
+%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+%% copies of the Software, and to permit persons to whom the Software is
+%% furnished to do so, subject to the following conditions:
+%%
+%% The above copyright notice and this permission notice shall be included in
+%% all copies or substantial portions of the Software.
+%%
+%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+%% THE SOFTWARE.
+%% -------------------------------------------------------------------
+-module(rebar_dia_compiler).
+
+-export([compile/2, clean/2]).
+
+-include("rebar.hrl").
+
+%% ===================================================================
+%% Public API
+%% ===================================================================
+
+-spec compile(rebar_config:config(), file:filename()) -> 'ok'.
+compile(Config, _AppFile) ->
+ rebar_base_compiler:run(Config, filelib:wildcard("dia/*.dia"),
+ "dia", ".dia", "src", ".erl",
+ fun compile_dia/3).
+
+-spec clean(rebar_config:config(), file:filename()) -> 'ok'.
+clean(_Config, _AppFile) ->
+ GeneratedFiles = dia_generated_files("dia", "src", "include"),
+ ok = rebar_file_utils:delete_each(GeneratedFiles),
+ ok.
+
+-spec compile_dia(file:filename(), file:filename(),
+ rebar_config:config()) -> ok.
+compile_dia(Source, Target, Config) ->
+ ok = filelib:ensure_dir(Target),
+ ok = filelib:ensure_dir(filename:join("include", "dummy.hrl")),
+ Opts = [{outdir, "src"}] ++ rebar_config:get(Config, dia_opts, []),
+ case diameter_dict_util:parse({path, Source}, []) of
+ {ok, Spec} ->
+ FileName = dia_filename(Source, Spec),
+ diameter_codegen:from_dict(FileName, Spec, Opts, erl),
+ diameter_codegen:from_dict(FileName, Spec, Opts, hrl),
+ HrlFile = filename:join("src", FileName ++ ".hrl"),
+ case filelib:is_regular(HrlFile) of
+ true ->
+ ok = rebar_file_utils:mv(HrlFile, "include");
+ false ->
+ ok
+ end;
+ {error, Reason} ->
+ ?ERROR("~s~n", [diameter_dict_util:format_error(Reason)])
+ end.
+
+dia_generated_files(DiaDir, SrcDir, IncDir) ->
+ F = fun(File, Acc) ->
+ {ok, Spec} = diameter_dict_util:parse({path, File}, []),
+ FileName = dia_filename(File, Spec),
+ [filename:join([IncDir, FileName ++ ".hrl"]) |
+ filelib:wildcard(filename:join([SrcDir, FileName ++ ".*"]))] ++ Acc
+ end,
+ lists:foldl(F, [], filelib:wildcard(filename:join([DiaDir, "*.dia"]))).
+
+dia_filename(File, Spec) ->
+ case proplists:get_value(name, Spec) of
+ undefined ->
+ filename:rootname(filename:basename(File));
+ Name ->
+ Name
+ end.
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index d704d2d..91f8354 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -117,7 +117,7 @@ clean(_Config, _AppFile) ->
test_compile(Config, Cmd, OutDir) ->
%% Obtain all the test modules for inclusion in the compile stage.
%% Notice: this could also be achieved with the following
- %% rebar.config option: {test_compile_opts, [{src_dirs, ["test"]}]}
+ %% rebar.config option: {test_compile_opts, [{src_dirs, ["src", "test"]}]}
TestErls = rebar_utils:find_files("test", ".*\\.erl\$"),
%% Copy source files to eunit dir for cover in case they are not directly
@@ -265,11 +265,6 @@ doterl_compile(Config, OutDir, MoreSources) ->
true = code:set_path(CurrPath),
ok.
-
-%% ===================================================================
-%% Internal functions
-%% ===================================================================
-
-spec include_path(file:filename(),
rebar_config:config()) -> [file:filename(), ...].
include_path(Source, Config) ->
@@ -414,7 +409,6 @@ gather_src([], Srcs) ->
gather_src([Dir|Rest], Srcs) ->
gather_src(Rest, Srcs ++ rebar_utils:find_files(Dir, ".*\\.erl\$")).
-
-spec dirs(file:filename()) -> [file:filename()].
dirs(Dir) ->
[F || F <- filelib:wildcard(filename:join([Dir, "*"])), filelib:is_dir(F)].
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index b82da0f..a7f4aca 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -762,7 +762,6 @@ pause_until_net_kernel_stopped(0) ->
exit(net_kernel_stop_failed);
pause_until_net_kernel_stopped(N) ->
try
- _ = net_kernel:i(),
timer:sleep(100),
pause_until_net_kernel_stopped(N - 1)
catch
diff --git a/src/rebar_neotoma_compiler.erl b/src/rebar_neotoma_compiler.erl
index 9bff892..33f32e3 100644
--- a/src/rebar_neotoma_compiler.erl
+++ b/src/rebar_neotoma_compiler.erl
@@ -57,7 +57,7 @@ compile(Config, _AppFile) ->
fun compile_neo/3, [{check_last_mod,false}]).
%% ============================================================================
-%% Public API
+%% Internal functions
%% ============================================================================
neotoma_opts(Config) ->
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index 70ee308..06a79bc 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -399,7 +399,7 @@ expand_vars_loop([], Recurse, Vars, Count) ->
expand_vars_loop(Recurse, [], Vars, Count-1);
expand_vars_loop([{K, V} | Rest], Recurse, Vars, Count) ->
%% Identify the variables that need expansion in this value
- ReOpts = [global, {capture, all_but_first, list}],
+ ReOpts = [global, {capture, all_but_first, list}, unicode],
case re:run(V, "\\\${?(\\w+)}?", ReOpts) of
{match, Matches} ->
%% Identify the unique variables that need to be expanded
@@ -472,8 +472,8 @@ erts_dir() ->
lists:concat([code:root_dir(), "/erts-", erlang:system_info(version)]).
os_env() ->
- Os = [list_to_tuple(re:split(S, "=", [{return, list}, {parts, 2}])) ||
- S <- os:getenv()],
+ ReOpts = [{return, list}, {parts, 2}, unicode],
+ Os = [list_to_tuple(re:split(S, "=", ReOpts)) || S <- os:getenv()],
%% Drop variables without a name (win32)
[T1 || {K, _V} = T1 <- Os, K =/= []].
diff --git a/src/rebar_qc.erl b/src/rebar_qc.erl
index 5784f7d..09e48e4 100644
--- a/src/rebar_qc.erl
+++ b/src/rebar_qc.erl
@@ -26,7 +26,7 @@
%% -------------------------------------------------------------------
-module(rebar_qc).
--export([qc/2, triq/2, eqc/2]).
+-export([qc/2, triq/2, eqc/2, clean/2]).
-include("rebar.hrl").
@@ -50,6 +50,9 @@ eqc(Config, _AppFile) ->
ok = load_qc_mod(eqc),
run_qc(Config, qc_opts(Config), eqc).
+clean(_Config, _File) ->
+ rebar_file_utils:rm_rf(?QC_DIR).
+
%% ===================================================================
%% Internal functions
%% ===================================================================
diff --git a/src/rebar_require_vsn.erl b/src/rebar_require_vsn.erl
index 83cb79d..9a0a005 100644
--- a/src/rebar_require_vsn.erl
+++ b/src/rebar_require_vsn.erl
@@ -77,18 +77,18 @@ check_versions(Config) ->
"OTP Release"),
case {OtpMaj, OtpMin} >= {MinMaj, MinMin} of
true ->
- ?DEBUG("~s satisfies the requirement for vsn ~s~n",
- [erlang:system_info(otp_release),
+ ?DEBUG("~s satisfies the requirement for vsn ~s~n",
+ [erlang:system_info(otp_release),
MinOtpVsn]);
- false ->
+ false ->
?ABORT("OTP release ~s or later is required, you have: ~s~n",
[MinOtpVsn,
erlang:system_info(otp_release)])
- end
+ end
end.
version_tuple(OtpRelease, Type) ->
- case re:run(OtpRelease, "R(\\d+)B?-?(\\d+)?", [{capture, all, list}]) of
+ case re:run(OtpRelease, "R(\\d+)B?-?(\\d+)?", [{capture, all, list}]) of
{match, [_Full, Maj, Min]} ->
{list_to_integer(Maj), list_to_integer(Min)};
{match, [_Full, Maj]} ->