Переглянути джерело

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"}}}, {branch, "master"}}},
{providers, "", {providers, "",
{git, "https://github.com/tsloughter/providers.git", {git, "https://github.com/tsloughter/providers.git",
{branch, "master"}}},
{branch, "profiles"}}},
{erlydtl, ".*", {erlydtl, ".*",
{git, "https://github.com/erlydtl/erlydtl.git", {git, "https://github.com/erlydtl/erlydtl.git",
{tag, "0.9.4"}}}, {tag, "0.9.4"}}},

+ 9
- 9
src/rebar_app_info.erl Переглянути файл

@ -20,8 +20,8 @@
ebin_dir/1, ebin_dir/1,
applications/1, applications/1,
applications/2, applications/2,
profile/1,
profile/2,
profiles/1,
profiles/2,
deps/1, deps/1,
deps/2, deps/2,
dep_level/1, dep_level/1,
@ -45,7 +45,7 @@
app_details=[] :: list(), app_details=[] :: list(),
applications=[] :: list(), applications=[] :: list(),
deps=[] :: list(), deps=[] :: list(),
profile=default :: atom(),
profiles=[default] :: atom(),
dep_level=0 :: integer(), dep_level=0 :: integer(),
dir :: file:name(), dir :: file:name(),
source :: string() | tuple() | undefined, source :: string() | tuple() | undefined,
@ -172,13 +172,13 @@ applications(#app_info_t{applications=Applications}) ->
applications(AppInfo=#app_info_t{}, Applications) -> applications(AppInfo=#app_info_t{}, Applications) ->
AppInfo#app_info_t{applications=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(). -spec deps(t()) -> list().
deps(#app_info_t{deps=Deps}) -> 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 -> Command when Command =:= do; Command =:= as ->
do(TargetProviders, State); 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(), Opts = providers:opts(CommandProvider)++rebar3:global_option_spec_list(),
case getopt:parse(Opts, rebar_state:command_args(State1)) of 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."}, {short_desc, "Run Common Tests."},
{desc, ""}, {desc, ""},
{opts, ct_opts(State)}, {opts, ct_opts(State)},
{profile, test}]),
{profiles, [test]}]),
State1 = rebar_state:add_provider(State, Provider), State1 = rebar_state:add_provider(State, Provider),
{ok, State1}. {ok, State1}.

+ 1
- 2
src/rebar_prv_eunit.erl Переглянути файл

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

Завантаження…
Відмінити
Зберегти