浏览代码

replace single profile atom in providers with list of profiles

pull/96/head
Tristan Sloughter 10 年前
父节点
当前提交
407362c074
共有 5 个文件被更改,包括 14 次插入15 次删除
  1. +1
    -1
      rebar.config
  2. +9
    -9
      src/rebar_app_info.erl
  3. +2
    -2
      src/rebar_core.erl
  4. +1
    -1
      src/rebar_prv_common_test.erl
  5. +1
    -2
      src/rebar_prv_eunit.erl

+ 1
- 1
rebar.config 查看文件

@ -23,7 +23,7 @@
{branch, "master"}}},
{providers, "",
{git, "https://github.com/tsloughter/providers.git",
{branch, "master"}}},
{branch, "profiles"}}},
{erlydtl, ".*",
{git, "https://github.com/erlydtl/erlydtl.git",
{tag, "0.9.4"}}},

+ 9
- 9
src/rebar_app_info.erl 查看文件

@ -20,8 +20,8 @@
ebin_dir/1,
applications/1,
applications/2,
profile/1,
profile/2,
profiles/1,
profiles/2,
deps/1,
deps/2,
dep_level/1,
@ -45,7 +45,7 @@
app_details=[] :: list(),
applications=[] :: list(),
deps=[] :: list(),
profile=default :: atom(),
profiles=[default] :: atom(),
dep_level=0 :: integer(),
dir :: file:name(),
source :: string() | tuple() | undefined,
@ -172,13 +172,13 @@ applications(#app_info_t{applications=Applications}) ->
applications(AppInfo=#app_info_t{}, Applications) ->
AppInfo#app_info_t{applications=Applications}.
-spec profile(t()) -> list().
profile(#app_info_t{profile=Profile}) ->
Profile.
-spec profiles(t()) -> list().
profiles(#app_info_t{profiles=Profiles}) ->
Profiles.
-spec profile(t(), list()) -> t().
profile(AppInfo=#app_info_t{}, Profile) ->
AppInfo#app_info_t{profile=Profile}.
-spec profiles(t(), list()) -> t().
profiles(AppInfo=#app_info_t{}, Profiles) ->
AppInfo#app_info_t{profiles=Profiles}.
-spec deps(t()) -> list().
deps(#app_info_t{deps=Deps}) ->

+ 2
- 2
src/rebar_core.erl 查看文件

@ -77,8 +77,8 @@ process_command(State, Command) ->
Command when Command =:= do; Command =:= as ->
do(TargetProviders, State);
_ ->
Profile = providers:profile(CommandProvider),
State1 = rebar_state:apply_profiles(State, [Profilespan>]),
Profiles = providers:profiles(CommandProvider),
State1 = rebar_state:apply_profiles(State, Profiles),
Opts = providers:opts(CommandProvider)++rebar3:global_option_spec_list(),
case getopt:parse(Opts, rebar_state:command_args(State1)) of

+ 1
- 1
src/rebar_prv_common_test.erl 查看文件

@ -28,7 +28,7 @@ init(State) ->
{short_desc, "Run Common Tests."},
{desc, ""},
{opts, ct_opts(State)},
{profile, test}]),
{profiles, [test]}]),
State1 = rebar_state:add_provider(State, Provider),
{ok, State1}.

+ 1
- 2
src/rebar_prv_eunit.erl 查看文件

@ -28,7 +28,7 @@ init(State) ->
{short_desc, "Run EUnit Tests."},
{desc, ""},
{opts, eunit_opts(State)},
{profile, test}]),
{profiles, [test]}]),
State1 = rebar_state:add_provider(State, Provider),
{ok, State1}.
@ -185,4 +185,3 @@ handle_results(error) ->
{error, unknown_error};
handle_results({error, Reason}) ->
{error, {error_running_tests, Reason}}.

正在加载...
取消
保存