Commit graph

316 commits

Author SHA1 Message Date
Charles McKnight
f83f18eb3b Fix error where ebin was created as a file
This patch remedies an issue where the ebin directory would be
erroneously created as a file by the first "mv" command in
rebar_protobuffs_compile.erl [line 106] if the ebin file did not
exist at the root application level.

In essence, the patch ensures that the ebin directory exists at
the application directory level before any "mv" commands are
executed. The following code was inserted at line 106:

    ok = filelib:ensure_dir(filename:join("ebin","dummy")),
2011-01-06 12:30:32 +01:00
Tuncer Ayaz
9c0d51bc0b Fix order of erl_opts to be more accurate 2011-01-04 11:27:17 +01:00
Joseph Wayne Norton
a529577b74 Remove erlc target after fail_on_warning failure
Prevent overlooking a compilation warning by removing the target beam
file after fail_on_warning failure.
2010-12-27 13:29:53 +01:00
Anthony Ramine
008dcb8542 Add abnfc support
abnfc is an ABNF parser generator.
Options are:
	- doc_root (defaults to "src")
	- out_dir (defaults to "src")
	- source_ext (defaults to ".abnf")
	- module_ext (defaults to "")
2010-12-22 17:57:21 +01:00
David Reid
63d5ceb61d Support single level of nested template variables
Add support for defining template variables of the following form:

{variables, [{appid, "mochiwebapp"},
         {author, "Mochi Media <dev@mochimedia.com>"},
         {year, "2010"},
         {version, "0.1"},
         {port, 8080},
         {dest, "{{appid}}"}]}.

Where dest may be overridden on the commandline but will default to
being the appid. Mochiweb uses this so that we can create new
projects from the template in a configurable directory.

So

$ rebar create template=mochiwebapp dest=foo appid=bar

I thought about special casing dest but figured it might be generally
useful to be able to nest template vars.

However this patch only does one level of resolution. So if

{variables, [{foo, "{{bar}}"},
                {bar, "{{foo}}"}]}.

then bar will end up being the literal string {{bar}} and foo the
literal string {{foo}}.
2010-12-22 17:56:52 +01:00
Dave Smith
9b0d35d986 Adding support for app_vars in external file 2010-12-20 08:55:31 -07:00
Tuncer Ayaz
d8e50e8c2d Implement update-deps and disable auto update 2010-12-17 12:39:50 +01:00
Anthony Ramine
9ecc3455bf Fix typo in rebar_erlydtl_compiler 2010-12-16 15:40:15 +01:00
klaar
48ee15c7e7 Fix conversion of boolean atom to string
mustache:render("{{banan}}", dict:from_list([{banan, true}])).

** exception error: no function clause matching mustache:escape(true,[])
     in function  erl_eval:do_apply/5
     in call from erl_eval:expr/5
     in call from erl_eval:expr/5
     in call from mustache:render/3
2010-12-09 23:28:05 +01:00
Benjamin Nortier
ab4e0a32ab Add rebar code path to common test code path 2010-12-09 00:20:54 +01:00
Tuncer Ayaz
07269ebdb9 Add VCS dir check for bzr and svn 2010-12-07 19:32:58 +01:00
Dave Smith
3e12630f23 Check for VCS directory before attempting source update. 2010-12-07 10:38:00 -07:00
Tuncer Ayaz
0bb429c197 Fix code clarity 2010-12-07 01:03:17 +01:00
Mihai Balea
837192e34e Fix compilation of *_first_files
- Check the existence of first_files and fail if they are not present
 - Get first_files lists from local instead of inherited config
   definitions, since they only make sense in the local context
2010-12-01 17:30:23 +01:00
Adam Kocoloski
8118083122 Return descriptive errors from is_app_available() 2010-11-30 01:18:48 +01:00
Joseph Wayne Norton
d24021f4e3 Add new global flag 'debug_info' to erlc_compiler
Using rebar's commandline, enable/disable 'debug_info' for
compilation. This feature if added to all rebar compilers could help
simplify and standardize this common use case for all rebar build
targets.
2010-11-30 00:24:20 +01:00
Joseph Wayne Norton
e36783112d Support dialyzer plt paths having "~/" as a prefix
e.g. {dialyzer_opts, [{plt, "~/.dialyzer_plt.R14B"}]}.
2010-11-23 19:03:56 +01:00
Juhani Rankimies
fe664e8c50 Fix bug 805
Use rebar_utils:find_executable/1 that wraps the
path in quotes to make it work even if it contains
whitespace.
2010-11-22 23:48:28 +01:00
Misha Gorodnitzky
064195dc5a Fix git tag and branch dependency handling
Change git downloads and updates to not create branches and fix git
tag handling.
2010-11-20 23:32:49 +01:00
Daniel Néri
72cdcd9573 Remove mention of "clean" command from rebar_edoc 2010-11-14 13:35:14 +01:00
Daniel Néri
6785c16f02 Fix EDoc syntax errors 2010-11-14 13:32:30 +01:00
Anders
513ae33c5c Add possibility to specify rebar config for the "main" application 2010-11-09 20:19:38 -07:00
Anders
c604d85ed5 Create ebin directory if it is missing for deps 2010-11-09 20:19:38 -07:00
Andrew Thompson
5158f9531d Stop clean from erroring if there's no .app file
If rebar tries to clean the .app file (because there's a .app.src file)
and it doesn't exist (possibly because of a bad compile), don't fail.
2010-10-29 11:52:20 -04:00
Andrew Thompson
ff5a7982eb Improve error logging when running a command fails
Make the error message newline terminated and, if possible, log the name
of the module in which the failure occured.
2010-10-29 11:52:13 -04:00
Juhani Rankimies
fd5ebe69a4 Port rebar_file_utils to Windows
Modify rm_rf and cp_r to work when {win32,_} = os:type().
Simplify rm_rf to only accept one filename, directoryname or wildcard.
Add unit tests to ensure a similar behaviour on windows and unix.

Thanks to tuncer for guidance and feedback.
2010-10-27 11:39:12 -06:00
Juhani Rankimies
75fc2378bf Remove unused functions from rebar_file_utils
mkdir_p/1 and ln_sf/2.
2010-10-27 11:39:12 -06:00
Kostis Sagonas
7dc76d578e Tidier improvements 2010-10-26 00:38:51 +02:00
Tuncer Ayaz
1a577fcd43 Clarify rebar_utils:ensure_dir/1 comment 2010-10-25 23:09:37 +02:00
Tuncer Ayaz
2d2aed627f Refactor Dialyzer support to make it more usable 2010-10-25 22:37:18 +02:00
Dave Smith
7ddd4bdaad Fixed 819; removed the edoc clean function entirely in favor of requiring user to explicitly specify what files should be deleted.
If there is no convention or way to programatically figure out what files to process, don't guess.
2010-10-25 06:31:07 -06:00
Tuncer Ayaz
1690139be9 Match ok result of filelib:ensure_dir/1 2010-10-22 22:12:25 +02:00
Dave Smith
67d4fbf337 Add support for overriding the default name/location of the escript; add support for cleaning generated script file
--HG--
extra : rebase_source : 466f440dcb699e031c5c520d28ee7731b60c535a
2010-10-19 14:21:41 -06:00
David Reid
968ef1cc77 First pass at updating dependencies (svn, hg, bzr untested) 2010-10-03 08:22:47 -07:00
Oscar Hellström
8ea62597ff Use eunit_dir() instead of ?EUNIT_DIR since the function exists.
The eunit_dir() does use the ?EUNIT_DIR macro internally, but it also builds, what I guess is, an absolute path, which might be better :) At least it's more consistent.
2010-08-24 21:59:59 +02:00
Oscar Hellström
8c03d5959b Make sure *both* .eunit and ebin directory exists before setting up the code path.
Normally the ebin directory doesn't contain any source files. Therefore it won't be kept in the repository by, at least, mercurial and also maybe git unless you put some .keep file in it or do some other hack. The ebin directory is created by rebar compile, but if rebar eunit is called before rebar compile, you end up with a {'EXIT', {{badmatch,{error,bad_directory}},...}. Another approach would be not to match cod:add_pathz(ebin_dir()) with ok, but I think this is an ok solution as well.
2010-08-24 21:54:54 +02:00
Tuncer Ayaz
79546e66ff Add spec: rebar_utils:abort/2 does not return
Thanks to Kostis for no_return() result type.
2010-10-15 18:10:20 +02:00
Tuncer Ayaz
77660c5da6 Fix bug found by Dialyzer in neotoma compiler
Thanks to Cliff Moon for correct fun clause to add.
2010-10-14 22:05:11 +02:00
Tuncer Ayaz
c2917b31d4 Fix issues found by dialyzer 2010-10-10 23:24:20 +02:00
Kostis Sagonas
e024778599 Dialyzer related cleanups 2010-10-10 14:11:13 -06:00
Dave Smith
93f77b50fc Made OTP app module validation optional 2010-10-10 13:30:44 -06:00
Andrew Thompson
1bf45036dc Parse transforms and behaviours are compiled first
The previous code in rebar that was trying to ensure that parse
transforms and behaviours were compiled first doesn't work with multiple
compiler workers because of the possiblity of one of the workers
compiling a file that needs a parse transform or a behaviour at the same
time another worker is compiling that same parse transform or behaviour.

The solution this patch implements is to append any parse transforms and
any behaviours (in that order) to erl_first_files to ensure that they
are compiled before any regular files. This patch won't break any
currently working uses of erl_first files because we only append to the
list, so anything in erl_first_files is still compiled before anything
else.
2010-10-05 17:59:52 -04:00
Andrew Thompson
f2244b26be Add optional eunit coverage report to terminal
Add a coverage report similar to the one output to index.html except
that it is output to the terminal if the new rebar.conf option
'cover_print_enabled' is set to true.
2010-10-06 21:05:13 +02:00
Tuncer Ayaz
2f1d527ef1 Fix bug 676
The previous fix to relax the regex was insufficient.
This is basically the diff proposed by Bryan Fink with
the difference of using 'C' instead of 'en_US'.
2010-10-02 22:58:25 +02:00
Tuncer Ayaz
73398562aa Fix xrl_opts/yrl_opts option handling 2010-10-02 19:26:03 +02:00
Tuncer Ayaz
0a05775eed Make SVN version matching locale agnostic
Reported-by: Manuel Duran Aguete <manuel@aguete.org>
2010-10-02 18:54:04 +02:00
Tuncer Ayaz
392e312b3f Update TODO comment 2010-10-01 16:57:49 +02:00
Tuncer Ayaz
7200d18671 getopt optimization and dialyzer fix from Kostis 2010-10-01 15:55:17 +02:00
Tuncer Ayaz
933e4f7620 Fix dialyzer warning. Thanks Kostis 2010-10-01 14:37:42 +02:00
Tuncer Ayaz
851c602b20 Remove never matching clause 2010-10-01 14:26:38 +02:00