diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-06-21 20:44:04 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-06-21 20:44:04 -0400 |
commit | 11d7a07064d044f2383fc699d7180ea6830b1299 (patch) | |
tree | ea1c2c7c236b754d2048195f9efb564748ee2e98 /src | |
parent | 4acd8e01510a6ff387dfae499c1d2e863945d3f7 (diff) | |
parent | 6d3a107056833e4360baf0354774506a4ff2bec0 (diff) |
Merge pull request #532 from tsloughter/pkgs_for_deps
Updates some deps, moves to packages for deps and adds dialyzer profile
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar.app.src | 1 | ||||
-rw-r--r-- | src/rebar_prv_install_deps.erl | 35 | ||||
-rw-r--r-- | src/rebar_templater.erl | 2 |
3 files changed, 12 insertions, 26 deletions
diff --git a/src/rebar.app.src b/src/rebar.app.src index 6d081a2..0ec0fcb 100644 --- a/src/rebar.app.src +++ b/src/rebar.app.src @@ -17,6 +17,7 @@ common_test, erlware_commons, providers, + bbmustache, relx, inets]}, {env, [ diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index 806293b..cfce1b7 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -224,28 +224,13 @@ update_pkg_deps(Profile, Pkgs, Packages, Upgrade, Seen, State, Locks) -> handle_pkg_dep(Profile, Pkg, Packages, Upgrade, DepsDir, Fetched, Seen, Locks, State) -> IsLock = pkg_locked(Pkg, Locks), AppInfo = package_to_app(DepsDir, Packages, Pkg, IsLock, State), + Deps = rebar_app_info:deps(AppInfo), Level = rebar_app_info:dep_level(AppInfo), {NewSeen, NewState} = maybe_lock(Profile, AppInfo, Seen, State, Level), {_, AppInfo1} = maybe_fetch(AppInfo, Profile, Upgrade, Seen, NewState), - - Profiles = rebar_state:current_profiles(State), - Name = rebar_app_info:name(AppInfo1), - C = rebar_config:consult(rebar_app_info:dir(AppInfo1)), - BaseDir = rebar_state:get(State, base_dir, []), - S1 = rebar_state:new(rebar_state:set(rebar_state:new(), base_dir, BaseDir), - C, rebar_app_info:dir(AppInfo1)), - S2 = rebar_state:apply_overrides(S1, Name), - - Plugins = rebar_state:get(S2, plugins, []), - S3 = rebar_state:set(S2, {plugins, Profile}, Plugins), - - S4 = rebar_state:apply_profiles(S3, Profiles), - AppInfo2 = rebar_app_info:state(AppInfo1, S4), - - %% Dep may have plugins to install. Find and install here. - S5 = rebar_plugins:install(S4), - AppInfo3 = rebar_app_info:state(AppInfo2, S5), - + {AppInfo2, _, _, _, _} = + handle_dep(NewState, Profile, DepsDir, AppInfo1, Locks, Level), + AppInfo3 = rebar_app_info:deps(AppInfo2, Deps), {[AppInfo3 | Fetched], NewSeen, NewState}. maybe_lock(Profile, AppInfo, Seen, State, Level) -> @@ -284,12 +269,12 @@ package_to_app(DepsDir, Packages, {Name, Vsn, Level}, IsLock, State) -> throw(?PRV_ERROR({missing_package, Name, Vsn})) end; {ok, PkgDeps} -> - {ok, AppInfo} = rebar_app_info:new(Name, Vsn), - AppInfo1 = rebar_app_info:deps(AppInfo, PkgDeps), - AppInfo2 = rebar_app_info:dir(AppInfo1, filename:join([DepsDir, Name])), - AppInfo3 = rebar_app_info:dep_level(AppInfo2, Level), - AppInfo4 = rebar_app_info:is_lock(AppInfo3, IsLock), - rebar_app_info:source(AppInfo4, {pkg, Name, Vsn}) + Source = {pkg, Name, Vsn}, + AppInfo = new_dep(DepsDir, Name, Vsn, Source, IsLock, State), + AppInfo1 = rebar_app_info:dep_level(rebar_app_info:deps(AppInfo, PkgDeps), Level), + BaseDir = rebar_state:get(State, base_dir, []), + AppState1 = rebar_state:set(rebar_app_info:state(AppInfo1), base_dir, BaseDir), + rebar_app_info:state(AppInfo1, AppState1) end. -spec update_src_deps(atom(), non_neg_integer(), list(), list(), list(), rebar_state:t(), boolean(), sets:set(binary()), list()) -> {rebar_state:t(), list(), list(), sets:set(binary())}. diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index 353fa36..3aa6e90 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -380,4 +380,4 @@ write_file(Output, Data, Force) -> %% Render a binary to a string, using mustache and the specified context %% render(Bin, Context) -> - mustache:render(ec_cnv:to_binary(Bin), Context, [{key_type, atom}]). + bbmustache:render(ec_cnv:to_binary(Bin), Context, [{key_type, atom}]). |