Commit graph

31 commits

Author SHA1 Message Date
Tuncer Ayaz
03e7993402 Fix #205 (erlydtl:compile/3 returns warnings)
Adapt rebar_erlydtl_compiler to handle warnings emitted by
erlydtl:compile/3.
2014-01-11 20:26:10 +01:00
Anthony Ramine
daed79f629 Always return the errors and warnings from erlydtl
This allows us to use `rebar_base_compiler:ok_tuple/3` and
`rebar_base_compiler:error_tuple/5` when returning from
`rebar_erlydtl_compiler`.
2013-09-20 20:54:54 +02:00
Tuncer Ayaz
4b8c81fb53 Implement 'rebar help CMD1 CMD2' and extend common 'rebar help' msg
* allow plugins to print help message for implemented commands
* append core rebar.config options to common 'rebar help' message
2012-12-31 20:45:11 +01:00
serge
edfee29b15 Fix default DTL compilation when no erlydtl_opts are provided 2012-11-15 16:34:06 -05:00
Tuncer Ayaz
93f6ef36af rebar_erlydtl_compiler: fix incorrect lists:keysort/2 call 2012-11-11 00:14:42 +01:00
Dave Smith
0c8dd15c79 Merge pull request #328 from saleyn/depcheck
Fix erlydtl dependency check
2012-11-10 06:13:15 -08:00
Serge Aleynikov
3f5ab55787 Fix erlydtl dependency check
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.
2012-10-25 07:25:56 +04:00
Serge Aleynikov
b606e3bfc5 Made more readable printout of the erlydtl compiler message
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"]]
2012-10-22 08:55:30 +04:00
Serge Aleynikov
38902e9a52 Specify multiple locations of DTL template files
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.
2012-10-22 08:39:44 +04:00
Tuncer Ayaz
491d52298e Re-use rebar_utils:ebin_dir() 2012-08-06 19:00:18 +02:00
Tuncer Ayaz
636c02f0be Fix R13B03 build (Reported-by: Sergey Nartimov) 2012-07-28 19:51:57 +02:00
Dave Smith
c86c99940d Remove ?FAIL in favor of ?ABORT 2012-06-08 07:06:15 -06:00
Tuncer Ayaz
b6fadef5d3 Fix whitespace errors 2012-03-18 18:51:08 +01:00
Loïc Hoguin
2c37270f52 Fix badarg crashes on missing dependency errors 2012-03-18 18:46:04 +01:00
Phil Toland
8b486055e4 Fix compiling DTL templates with latest erlydtl
The latest version of erlydtl requires that custom tag modules be in
the path when templates are compiled. Without this change rebar silently
exits when using the custom_tags_modules option.
2012-02-16 11:40:57 +01:00
Tuncer Ayaz
2cae2950c4 Fix whitespace errors 2012-01-17 17:04:07 +01:00
Tuncer Ayaz
e6caab00d5 Use ?ERROR where appropriate 2012-01-17 17:04:07 +01:00
Tuncer Ayaz
63de05d914 Clean up code 2011-02-06 17:41:04 +01:00
Tuncer Ayaz
c466076ffb Clean up emacs file local variables 2011-01-31 17:55:36 +01:00
Tuncer Ayaz
ebcae06928 Fix grep invocations 2011-01-13 17:39:14 +01:00
Tuncer Ayaz
e4036cbe56 Apply Tidier suggestions 2011-01-13 17:39:14 +01:00
Tuncer Ayaz
58fd80917a Fix file existence checks 2011-01-13 17:39:14 +01:00
Juhani Rankimies
52ca7795fe Unify executable invocation
Add flags to rebar_utils:sh to control output and error handling.
Replace calls to os:cmd with calls to rebar_utils:sh.
2011-01-06 15:02:19 +01:00
Anthony Ramine
9ecc3455bf Fix typo in rebar_erlydtl_compiler 2010-12-16 15:40:15 +01:00
Kostis Sagonas
7dc76d578e Tidier improvements 2010-10-26 00:38:51 +02:00
Alex Songe
73ee6e442b Added support for custom_tags_dir compile option to rebar_erlydtl_compiler 2010-01-16 13:58:34 -06:00
Bryan Fink
abd535d081 rework elrydtl_compiler to do dependency checking correctly in refactored rebar 2010-01-04 11:24:28 -05:00
Dave Smith
fa2a58261a Another round of refactoring to yield better flexiblity in the base_compiler system 2010-01-03 22:53:04 -07:00
Dave Smith
9c15d63191 Refactor of compilation logic to enable support for package modules and provide better modularity/reusability for other systems 2010-01-02 14:17:59 -07:00
Tuncer Ayaz
9a8015f2d7 Added vi modeline/emacs local variables to file headers 2009-12-31 19:42:53 +01:00
Bryan Fink
299f45623f rebar can now compile ErlyDTL files (if erlydtl is installed)
defaults to compiling from templates/*.dtl to ebin/*_dtl.beam
see top of rebar_erlydtl_compiler for configuration options
2009-12-22 09:57:42 -05:00