Commit graph

25 commits

Author SHA1 Message Date
Tuncer Ayaz
2f2e7c4889 rebar_base_compiler: replace fixed size list with a tuple 2014-01-15 19:29:00 +01:00
Tuncer Ayaz
97c9fdf31a Fix basho/rebar#388
If the syntax error is in a .hrl file, then the reported error message
is not as useful because it's not clear which .erl file was being
compiled. We can fix that easily by first printing what source file was
being processed. We don't change the actual error message, so this will
still work with your editor of choice for jumping to the right line.

Before
------

Success:
Compiled src/foo.erl

Failure:
include/foo.hrl:10: syntax error [...]

After
-----

Success:
Compiled src/foo.erl

Failure:
Compiling src/foo.erl failed:
include/foo.hrl:10: syntax error [...]
2014-01-15 19:28:41 +01:00
mats cronqvist
63a69af04b More error logging
rebar throws away some error messages, e.g. the ones generated if the yecc compiler is broken.
2013-04-12 21:21:53 +03:00
Dave Smith
7826232a03 Merge pull request #327 from saleyn/erlydtl_compiler
Erlydtl compiler
2012-11-10 06:08:16 -08:00
Magnus Henoch
e8169e91e4 Fix rebar_base_compiler:format_errors/3 for errors in include files
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
2012-10-22 22:10:26 +02: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
0b18b208e2 Only print absolute filename if not in base_dir 2012-08-05 19:56:27 +02:00
Tuncer Ayaz
636c02f0be Fix R13B03 build (Reported-by: Sergey Nartimov) 2012-07-28 19:51:57 +02:00
Tuncer Ayaz
252757c753 Do not use application:set_env 2012-07-23 13:17:11 +02:00
Yurin Slava
7bef458163 Add support for errors without line number 2012-06-18 12:09:58 +02:00
Tuncer Ayaz
c1a891ce33 Remove gratuitous lists:append/1 2012-06-12 23:40:42 +02:00
Tuncer Ayaz
8e66225e06 Fix error/warning newlines (Reported-by: Tim Watson) 2012-06-12 15:13:20 +02:00
Tuncer Ayaz
8a2274b8b4 Refactor shared error reporting code 2012-06-11 19:42:00 +02:00
Tuncer Ayaz
0716cf708c Add support for {Line,Column} in error reports 2012-06-11 19:42:00 +02:00
Tuncer Ayaz
658f4847a2 Report warnings as errors if -Werror is enabled 2012-06-11 19:41:51 +02:00
Tuncer Ayaz
dff60918cb Share format_errors/format_warnings functions 2012-06-11 19:40:59 +02:00
Tuncer Ayaz
50fbabda68 Manually report errors/warnings with absolute path 2012-06-11 19:40:59 +02:00
Dave Smith
c86c99940d Remove ?FAIL in favor of ?ABORT 2012-06-08 07:06:15 -06: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
Kostis Sagonas
7dc76d578e Tidier improvements 2010-10-26 00:38:51 +02:00
Bob Ippolito
9dd9585d5b include source path in compiler errors, process commands separately (to make get-deps compile work), ensure ebin dir, process iteratively to support transitive deps 2010-05-15 13:57:07 -07:00
Tuncer Ayaz
fb0cee2afb Implemented option to specify number of concurrent workers a command may use 2010-01-06 17:31:14 +01: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