summaryrefslogtreecommitdiff
path: root/src/rebar_app_info.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-12-18 22:44:20 -0500
committerFred Hebert <mononcqc@ferd.ca>2015-12-19 20:16:49 -0500
commit44a30ca52f3c74d19007fd0433f6192fa4ccca79 (patch)
tree12e5be5a54ff9d3bcb692bad3800505f2abe7bae /src/rebar_app_info.erl
parentddc64cd66b2d6e4e2315ee281b9eabb8bc2e8868 (diff)
Plugin templates enabled
This lets a plugin define templates to be loaded: $ rebar3 new ... proper (plugin): A basic PropEr suite for an OTP application ... $ rebar3 new help proper proper: plugin template (...) Description: A basic PropEr suite for an OTP application Variables: name="suite" (...) ... → rebar3 new proper fakesuite ===> Writing test/prop_fakesuite.erl In this case, proper is a fake template file I've put by hand in _build/default/plugins/rebar3_proper/priv/<somename>/, meaning it will only work as far as it's called from the project's root. The priority order of plugins is now .config > plugin > built-in, such that someone could ensure plugins do not crush their own private templates, but also that custom or plugin templates do overtake built-in ones. It used to be Built-in > .config only. Templates are searched for recursively in the priv/ directory of plugins.
Diffstat (limited to 'src/rebar_app_info.erl')
-rw-r--r--src/rebar_app_info.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl
index 95b4624..9fee4e0 100644
--- a/src/rebar_app_info.erl
+++ b/src/rebar_app_info.erl
@@ -23,6 +23,7 @@
original_vsn/1,
original_vsn/2,
ebin_dir/1,
+ priv_dir/1,
applications/1,
applications/2,
profiles/1,
@@ -361,6 +362,10 @@ out_dir(AppInfo=#app_info_t{}, OutDir) ->
ebin_dir(#app_info_t{out_dir=OutDir}) ->
ec_cnv:to_list(filename:join(OutDir, "ebin")).
+-spec priv_dir(t()) -> file:name().
+priv_dir(#app_info_t{out_dir=OutDir}) ->
+ ec_cnv:to_list(filename:join(OutDir, "priv")).
+
-spec resource_type(t(), pkg | src) -> t().
resource_type(AppInfo=#app_info_t{}, Type) ->
AppInfo#app_info_t{resource_type=Type}.