This commit add support for reading mustache 'lists' from files, so you
can use the list section functionality when templating things.
An example of the list syntax is as follows:
{package_commands, {list, [[{name, "riak"}], [{name, "riak-admin"}], [{name, "search-cmd"}]]}}.
Then you can, for each of the list elements, render some text:
{{#package_commands}}
chmod +x bin/{{name}}
{{/package_commands}}
The results returned by os:getenv() may contain unicode characters.
That said, we need to explicitly allow unicode when splitting the
environment information, otherwise badarg will be raised causing all
rebar commands to fail until the environment variable is removed.
Add skip_deps=AppListSeparatedByCommas feature.
I agree it's a bit of a weird thing, but it's a reasonable and safe extension. When time comes to properly overhaul stuff, skip_deps should disappear entirely.
This allows `rebar ct suites=abc` to consider all suites when
you have a rebar setup with multiple sub_dirs.
Previously, rebar halted after it could not find the suite in the
first dir. But the suite might be present in another dir (when
sub_dirs contains multiple dirs).
This commit makes it so instead of halting, it prints a warning and
continues with looking for the suite in the other `sub_dir`s.
Note -- This uses try/catch to cause the test to be skipped because
otherwise I needed to adjust the return values of 4 functions, the
code path is pretty deeply nested here. Otherwise the whole call chain
needed to be adjusted for this return value:
`run_test -> make_cmd -> get_suites -> find_suite_path`
IMHO, I think for exceptional cases like this it is fine to use throw;
specially since only the {skip} is catched and nothing else.
When a DTL template includes other template files, those files don't need
to be compiled separately, and therefore can be given an extension different
from `source_ext` (such as `.dtli`) to avoid being compiled. This fix
allows rebar to find included dependencies with names `*.dtl*` rather
than `*.dtl` and properly determine if a template file needs to be recompiled.
Handle the case where the error didn't occur in the file being
compiled. That is, if there is an error on line 9 of bar.hrl,
instead of:
/path/to/foo.erl:9: type foo() already defined
print:
/path/to/bar.hrl:9: type foo() already defined
The printed message is made more terse.
Example before applying patch:
ERROR: Compiling template src/view/test.dtl failed:
{error,{"src/view/test.dtl",
[{{4,7},
erlydtl_parser,
["syntax error before: ",["\"\\\"HELLO_WORLD\\\"\""]]}]}}
Example after applying patch:
ERROR: Compiling template "src/cmp_html_error_template.dtl" failed:
(line:3, col:12): ["syntax error before: ",["trans"]]
Added a backward compartible feature to specify `erlydtl_opts' options
for the DTL template compiler to allow inclusion of templates in different
directories with different compilation settings for each. E.g.:
{erlydtl_opts, [
[{doc_root, "src/view"}, {module_ext, "_dtl_vw"}]
, [{doc_root, "src"}, {module_ext, ""}, {recursive, false}]
, {out_dir, "ebin"}
, {compiler_options, [verbose, debug_info]}
]}.
The definition above is identical to this (the last two options
are duplicated in each list):
{erlydtl_opts, [
[{doc_root, "src/view"}
,{module_ext, "_dtl_vw"}
,{out_dir, "ebin"}
,{compiler_options, [verbose, debug_info]}]
, [{doc_root, "src"}
,{module_ext, ""}
,{out_dir, "ebin"}
,{compiler_options, [verbose, debug_info]}
,{recursive, false}]
]}.
In this case "src/view" and "src" directories containing template files
will be compiled. A new `recursive' option tells rebar_erlydtl_compiler
to search files recursively from a given doc_root. In the example above
the "src" directory won't be scanned recursively, and the target template
name for target beam modules won't have "_dtl_vw" suffix.
Introduce a new 'raw' option for dependency specs in rebar.config file.
For example:
{deps,
{dependency_name, "1.0.*",
{git, "<...>", {branch, "master"}},
[raw]
}
]}.
When this option is specified, rebar does not require the dependency to
have a standard Erlang/OTP layout which assumes presence of either
"src/dependency_name.app.src" or "ebin/dependency_name.app" files.
'raw' dependencies can still contain 'rebar.config' and even can have
the proper OTP directory layout, but they won't be compiled.
Only a subset of rebar commands will be executed on the 'raw'
subdirectories:
get-deps, update-deps, check-deps, list-deps and delete-deps.