diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_deps.erl | 32 | ||||
-rw-r--r-- | src/rebar_erlc_compiler.erl | 6 | ||||
-rw-r--r-- | src/rebar_lfe_compiler.erl | 4 | ||||
-rw-r--r-- | src/rebar_utils.erl | 14 |
4 files changed, 34 insertions, 22 deletions
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 9911841..2e305d5 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -257,13 +257,27 @@ info_help(Description) -> [ Description, {deps_dir, "deps"}, - {deps, [application_name, - {application_name, "1.0.*"}, - {application_name, "1.0.*", - {git, "git://github.com/rebar/rebar.git", {branch, "master"}}}, - {application_name, "", - {git, "git://github.com/rebar/rebar.git", {branch, "master"}}, - [raw]}]} + {deps, + [app_name, + {rebar, "1.0.*"}, + {rebar, ".*", + {git, "git://github.com/rebar/rebar.git"}}, + {rebar, ".*", + {git, "git://github.com/rebar/rebar.git", "Rev"}}, + {rebar, "1.0.*", + {git, "git://github.com/rebar/rebar.git", {branch, "master"}}}, + {rebar, "1.0.0", + {git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}}, + {rebar, "", + {git, "git://github.com/rebar/rebar.git", {branch, "master"}}, + [raw]}, + {app_name, ".*", {hg, "https://www.example.org/url"}}, + {app_name, ".*", {rsync, "Url"}}, + {app_name, ".*", {svn, "https://www.example.org/url"}}, + {app_name, ".*", {svn, "svn://svn.example.org/url"}}, + {app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}}, + {app_name, ".*", {fossil, "https://www.example.org/url"}}, + {app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}}]} ]). %% Added because of trans deps, @@ -532,8 +546,6 @@ download_source(AppDir, {rsync, Url}) -> rebar_utils:sh(?FMT("rsync -az --delete ~s/ ~s", [Url, AppDir]), []); download_source(AppDir, {fossil, Url}) -> download_source(AppDir, {fossil, Url, ""}); -download_source(AppDir, {fossil, Url, latest}) -> - download_source(AppDir, {fossil, Url, ""}); download_source(AppDir, {fossil, Url, Version}) -> Repository = filename:join(AppDir, filename:basename(AppDir) ++ ".fossil"), ok = filelib:ensure_dir(Repository), @@ -589,8 +601,6 @@ update_source1(AppDir, {rsync, Url}) -> rebar_utils:sh(?FMT("rsync -az --delete ~s/ ~s",[Url,AppDir]),[]); update_source1(AppDir, {fossil, Url}) -> update_source1(AppDir, {fossil, Url, ""}); -update_source1(AppDir, {fossil, Url, latest}) -> - update_source1(AppDir, {fossil, Url, ""}); update_source1(AppDir, {fossil, _Url, Version}) -> ok = file:set_cwd(AppDir), rebar_utils:sh("fossil pull", [{cd, AppDir}]), diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index 4157ba4..dbefa4a 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -157,7 +157,8 @@ test_compile(Config, Cmd, OutDir) -> %% Compile erlang code to OutDir, using a tweaked config %% with appropriate defines for eunit, and include all the test modules %% as well. - ok = doterl_compile(test_compile_config(Config, Cmd), OutDir, TestErls), + ok = doterl_compile(test_compile_config(Config, ErlOpts, Cmd), + OutDir, TestErls), {ok, SrcErls}. @@ -201,12 +202,11 @@ info_help(Description) -> {yrl_first_files, []} ]). -test_compile_config(Config, Cmd) -> +test_compile_config(Config, ErlOpts, Cmd) -> {Config1, TriqOpts} = triq_opts(Config), {Config2, PropErOpts} = proper_opts(Config1), {Config3, EqcOpts} = eqc_opts(Config2), - ErlOpts = rebar_config:get_list(Config3, erl_opts, []), OptsAtom = list_to_atom(Cmd ++ "_compile_opts"), EunitOpts = rebar_config:get_list(Config3, OptsAtom, []), Opts0 = [{d, 'TEST'}] ++ diff --git a/src/rebar_lfe_compiler.erl b/src/rebar_lfe_compiler.erl index 2a047d8..8488b0f 100644 --- a/src/rebar_lfe_compiler.erl +++ b/src/rebar_lfe_compiler.erl @@ -70,8 +70,8 @@ compile_lfe(Source, _Target, Config) -> "~n", []), ?FAIL; _ -> - Opts = [{i, "include"}, {outdir, "ebin"}, return] - ++ rebar_config:get_list(Config, erl_opts, []), + ErlOpts = rebar_utils:erl_opts(Config), + Opts = [{i, "include"}, {outdir, "ebin"}, return] ++ ErlOpts, case lfe_comp:file(Source, Opts) of {ok, _Mod, Ws} -> rebar_base_compiler:ok_tuple(Config, Source, Ws); diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 4a74661..618427f 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -200,12 +200,12 @@ expand_env_variable(InStr, VarName, RawVarValue) -> re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts) end. -vcs_vsn(Config, Vcs, Dir) -> - Key = {Vcs, Dir}, +vcs_vsn(Config, Vsn, Dir) -> + Key = {Vsn, Dir}, Cache = rebar_config:get_xconf(Config, vsn_cache), case dict:find(Key, Cache) of error -> - VsnString = vcs_vsn_1(Vcs, Dir), + VsnString = vcs_vsn_1(Vsn, Dir), Cache1 = dict:store(Key, VsnString, Cache), Config1 = rebar_config:set_xconf(Config, vsn_cache, Cache1), {Config1, VsnString}; @@ -441,11 +441,12 @@ emulate_escript_foldl(Fun, Acc, File) -> vcs_vsn_1(Vcs, Dir) -> case vcs_vsn_cmd(Vcs) of - {unknown, VsnString} -> - ?DEBUG("vcs_vsn: Unknown VCS atom in vsn field: ~p\n", [Vcs]), + {plain, VsnString} -> VsnString; {cmd, CmdString} -> vcs_vsn_invoke(CmdString, Dir); + unknown -> + ?ABORT("vcs_vsn: Unknown vsn format: ~p\n", [Vcs]); Cmd -> %% If there is a valid VCS directory in the application directory, %% use that version info @@ -478,7 +479,8 @@ vcs_vsn_cmd(bzr) -> "bzr revno"; vcs_vsn_cmd(svn) -> "svnversion"; vcs_vsn_cmd(fossil) -> "fossil info"; vcs_vsn_cmd({cmd, _Cmd}=Custom) -> Custom; -vcs_vsn_cmd(Version) -> {unknown, Version}. +vcs_vsn_cmd(Version) when is_list(Version) -> {plain, Version}; +vcs_vsn_cmd(_) -> unknown. vcs_vsn_invoke(Cmd, Dir) -> {ok, VsnString} = rebar_utils:sh(Cmd, [{cd, Dir}, {use_stdout, false}]), |