diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-09-06 17:35:16 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-09-06 17:35:16 -0400 |
commit | e1cba5a2a940a8301024fbc459fc66c7b9841419 (patch) | |
tree | 81066dd8c3d4e32e79945a6f5f4d7fafae2027b4 /src/rebar_app_info.erl | |
parent | 768889ad177cfb10d3cbace36047fba2f16a1315 (diff) | |
parent | cfd4beb99daf5f0686cb2bd6a2ecda9d8e0fe86c (diff) |
Merge pull request #779 from tsloughter/hooks_artifacts
hooks/artifacts are always run/resolved from an app unless at top of umbrella
Diffstat (limited to 'src/rebar_app_info.erl')
-rw-r--r-- | src/rebar_app_info.erl | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl index 92706f3..b41880e 100644 --- a/src/rebar_app_info.erl +++ b/src/rebar_app_info.erl @@ -412,18 +412,22 @@ verify_otp_vsn(AppInfo) -> -spec has_all_artifacts(#app_info_t{}) -> true | {false, file:filename()}. has_all_artifacts(AppInfo) -> Artifacts = rebar_app_info:get(AppInfo, artifacts, []), - Dir = dir(AppInfo), - all(Dir, Artifacts). + OutDir = out_dir(AppInfo), + Context = [{base_dir, rebar_app_info:get(AppInfo, base_dir, ?DEFAULT_BASE_DIR)} + ,{profile_dir, rebar_dir:profile_dir(opts(AppInfo), profiles(AppInfo))} + ,{out_dir, OutDir}], + all(OutDir, Context, Artifacts). -all(_, []) -> +all(_, _, []) -> true; -all(Dir, [File|Artifacts]) -> - case filelib:is_regular(filename:join(Dir, File)) of +all(Dir, Context, [File|Artifacts]) -> + FilePath = filename:join(Dir, rebar_templater:render(File, Context)), + case filelib:is_regular(FilePath) of false -> - ?DEBUG("Missing artifact ~s", [filename:join(Dir, File)]), + ?DEBUG("Missing artifact ~s", [FilePath]), {false, File}; true -> - all(Dir, Artifacts) + all(Dir, Context, Artifacts) end. %%%%% |