Commit graph

1062 commits

Author SHA1 Message Date
redpine50
8cc5a6abdc Do not wrap base_dir with filename:absname()
base_dir() returns already filename:absname()'ed path.
2014-05-10 14:09:54 +09:00
redpine50
9d653f906d Update rebar_utils.erl
On windows, bootstrap.bat failed with next error.
Command 'escriptize' not understood or not applicable

This happens because the drive name in path got from rebar_utils:get_cwd() and base_dir(Config) are different case.
Made the drive name the same lowercase using filename:absname().
2014-05-08 02:07:10 +09:00
Jared Morrow
837df64087 Merge pull request #252 from tuncer/file_utils-errors
file_utils: properly report errors (fix #95)
2014-04-24 07:16:39 -06:00
Tuncer Ayaz
99fe270e59 Fix #267 (code path regression)
Since the introduction of -r/--recursive, deps were not properly added
to the code path when running ct, eunit, etc.

To fix that, pass a flag down to process_dir1 and conditionalize
execution of the command. This moves the decision into process_dir1
where we can decide to invoke preprocess/2 and postprocess/2 but not
execute the command.

Without this fix, you'd have to, for example, invoke 'rebar -r ct
skip_deps=true', if you wanted to run base_dir's ct suites with deps on
the code path (while skipping all non-base_dir ct suites).

So, with this patch applied, if you run
$ rebar ct
deps will be on the code path, and only base_dir's ct suites will be
tested.

If you want to test ct suites in base_dir and sub_dirs, you have to run
$ rebar -r ct skip_deps=true

If you want to test ct suites in all dirs, you have to run
$ rebar -r ct

The fix is not specific to ct and applies to all commands.

To be able to add inttest/code_path_no_recurse/deps, I had to fix
.gitignore. While at it, I've updated and fixed all entries.
2014-04-23 22:17:23 +02:00
Tuncer Ayaz
b037f6c076 rebar_core: consistently order args and simplify code
* Fix arg order:
  The order of arguments got inconsistent over time. To fix that, use
  the same consistent order in all functions.

* Avoid one erlang:'++'/2 call in process_dir/6.

* Avoid lists:prefix/2 and atom_to_list/1 calls:
  We can easily avoid 2 lists:prefix/2 calls and one atom_to_list/1 call
  in execute/5 by passing in whether the command is a hook or not. The
  resulting code is simpler and easier to read.
2014-04-20 16:59:38 +02:00
goofansu
43b3e0d038 Fix 'rebar help clean' function_clause error
Missing info(help, clean) in rebar_qc.erl.
2014-04-12 13:04:36 +08:00
Jared Morrow
75f1383f66 Merge pull request #254 from tuncer/fix-generate
Fix 'rebar generate' regression (#253)
2014-04-11 09:19:01 -06:00
Tuncer Ayaz
e1eec02c80 file_utils: properly report errors (fix #95)
While at it, improve the error message printed by rebar_utils:sh/2.
2014-04-11 15:01:26 +02:00
Dan Gudmundsson
4b49dc0727 Quote include/lib paths
In OTP-17.0 paths on windows are not shortpaths anymore
so they may contain spaces and parenthesis
2014-04-09 21:16:41 +02:00
Tuncer Ayaz
883decce3d Fix 'rebar generate' regression (#253)
If the directory we're about to process contains
reltool.config[.script] and the command to be applied is
'generate', then it's safe to process. We do this to retain the
behavior of specifying {sub_dirs, ["rel"]} and have "rebar generate"
pick up rel/reltool.config[.script]. Without this workaround you'd
have to run "rebar -r generate" (which you don't want to do if you
have deps or other sub_dirs) or "cd rel && rebar generate".
2014-03-30 22:07:26 +02:00
Joseph Wayne Norton
def6b8c98d Add partial support for Erlang/OTP 17
Allow rebar to compile applications using Erlang/OTP 17 and older
versions.  This patch only provides partial support since the rebar
tool itself must be compiled using an Erlang/OTP version that is older
than 17.
2014-03-29 23:22:47 -05:00
Nathaniel Waisbrot
41f1a891d9 Add 'p4' (Perforce) as a dependency type
This calls the 'p4' command-line tool to checkout and sync Perforce
trees. It involves significantly more special code in Rebar than
using 'git p4', but it eliminates the indirection of
Rebar->Git->Python->Perforce
2014-03-17 15:49:44 -04:00
Tuncer Ayaz
ca40d3b00a Document require_*_vsn options 2014-03-12 23:32:16 +01:00
Tuncer Ayaz
fe9d328cb5 erlc: fixup log message
Using the filename as a prefix is less readable and inconsistent with
the other log messages.

Before:

DEBUG: src/foo.erl depends on...

After:

DEBUG: Dependencies of src/foo.erl ...
2014-03-12 20:45:37 +01:00
Tuncer Ayaz
6063e0d197 Document skip_apps= and apps= 2014-03-12 20:43:10 +01:00
Tuncer Ayaz
9bb677ed99 Fix #226
Running 'rebar list-templates' can take quite a long time, when it has
to search the file system. To fix that, make list-templates not recurse
by default. To enable recursion, run 'rebar -r list-templates'.
2014-03-11 21:11:36 +00:00
Tuncer Ayaz
77a0eb6fe4 Fix #56 (always-on recursion)
Always-on recursive application of all rebar commands causes too many
issues. Recursive application is required for:
1. dealing with dependencies: get-deps, update-deps, and compile of deps
   right after get-deps or update-deps
2. projects with a riak-like apps/ project structure and dev process

The vast majority of projects are not structured like riak. Therefore,
moving forward it's best to (by default) restrict recursive behavior to
dealing with deps. This commit does that and also adds command line and
rebar.config options for controlling or configuring recursion. Also, we
introduce two meta commands: prepare-deps (equivalent to rebar -r
get-deps compile) and refresh-deps (equivalent to rebar -r update-deps
compile). riak-like projects can extend the list of recursive commands
(to include 'eunit' and 'compile') by adding
{recursive_cmds, [eunit, compile]} to rebar.config.
2014-03-11 21:11:36 +00:00
Shunichi Shinohara
2575bb24da Add slim marker file as automatic overlay 2014-03-09 15:54:32 +09:00
goofansu
195d61a402 Fix typo in rebar_erlydtl_compiler 2014-03-06 13:03:39 +08:00
Jared Morrow
a361719781 Merge pull request #139 from rnewson/depmods
Allow specification of module dependencies for appups
2014-03-05 13:35:11 -07:00
Andrew Thompson
ab571fd2aa Merge pull request #234 from tuncer/fix-220
Fix #220 (Reported-by: Joseph Norton)
2014-03-05 14:54:27 -05:00
Jared Morrow
b7e727a8f7 Merge pull request #98 from jcomellas/jc-no-erl-libs-repetition
Repetition of environment variable definitions in child processes (ports)
2014-03-05 12:52:43 -07:00
Tuncer Ayaz
03fe5318c6 Fix #220 (Reported-by: Joseph Norton)
When running 'rebar qc' or 'rebar eunit', we were erroneously fetching
erl_opts more than once.
2014-03-05 20:16:15 +01:00
Tuncer Ayaz
c26b0c7d6b erlc: fix comment
test_compile/3 is used by eunit and qc, but the comment was only
referring to 'rebar eunit'.
2014-03-05 20:16:15 +01:00
Jared Morrow
077f8e064a Merge pull request #175 from tuncer/cwd-plugins-regression
CWD plugins regression
2014-03-05 12:08:00 -07:00
Tuncer Ayaz
b6908421b7 erlc: clean-up, enhance, and regression fix fd17693
* update files
* fix Dialyzer warning
* unconditionally enable info fil
* clean-up inconsistencies
* use term_to_binary compression
* use try...catch instead of case...catch...of
* do not write build info file if the graph is unmodified
* store info file as <base_dir>/.rebarinfo
* properly support list of compile directives
* fix regressions:
 - Fix a bug in handling of files to compile first.
 - If a file that is depended upon itself depends on other files, make sure
   those are compiled first. While at it, rename variables for correctness.
   Reported-by: David Robakowski
 - Make sure that FirstFiles has no dupes and preserves the proper order.
 - headers referenced via -include_lib() were not properly resolved to absolute
   filenames
 - .erl files found in sub dirs of src_dirs were not properly resolved to
   absolute filenames
2014-03-05 15:44:38 +01:00
Anthony Ramine
7742d70ee2 erlc: add support for detecting core transforms 2014-03-05 15:33:22 +01:00
Evgeniy Khramtsov
fd17693b7c Speed up the compilation process
* Do not parse source files twice while checking for relationship.
* Keep files relationships in a graph.
* The option 'keep_build_info' is introduced. When set to 'true'
  the graph will be kept in ebin/.rebar.build.info and will be
  used by further compiler calls. The default is 'false'.
2014-03-05 15:20:36 +01:00
Tuncer Ayaz
2576031163 docs: fix #228 2014-02-25 19:46:49 +01:00
Jared Morrow
dcc75b144c Merge pull request #230 from tuncer/fix-dialyzer-warnings
eunit: fix dialyzer warnings introduced in 03da5e0b
2014-02-25 08:14:47 -07:00
Tuncer Ayaz
a554744fc0 Mention rebar -c/--commands 2014-02-24 22:36:31 +01:00
Tuncer Ayaz
c29f8b45ae Document support for abbreviated commands 2014-02-24 22:36:31 +01:00
Tuncer Ayaz
589afc0173 eunit: fix dialyzer warnings introduced in 03da5e0b 2014-02-20 19:10:47 +01:00
David N. Welton
60d106055b {ok, Module} is an acceptable return value from do_compile. 2014-02-14 13:35:51 +01:00
David N. Welton
f7d62dee68 Use proplists:unfold to make sure we feed a proplist to keymerge. 2014-02-14 13:35:51 +01:00
Andreas Stenius
33110267ba Adapt erlydtl compiler plugin to latest version of erlydtl 2014-02-14 13:35:51 +01:00
Andrew Thompson
2f6991cbd7 Add documentation 2014-02-07 13:08:14 -05:00
Andrew Thompson
03da5e0be0 Add random_suite_order option to eunit command
Option takes either 'true' or a numeric seed value. If true is passed, a
random seed is generated and used. The numeric seed value is for
repeatability.

The idea here is to root out test suites that are order dependant, or
that fail in the presence of certain orderings.
2014-02-07 13:05:33 -05:00
Jared Morrow
fa679b4343 Merge pull request #224 from andrewjstone/allow-test
allow suite[s] or test[s] as options for eunit and ct
2014-02-07 10:53:08 -07:00
Andrew Thompson
184edc2331 Merge pull request #188 from massemanet/xref_extra_path
Xref extra path
2014-02-06 01:04:35 -05:00
Andrew J. Stone
cc72cd8fce allow suite[s] or test[s] as options for eunit and ct 2014-02-05 16:56:44 -05:00
Jared Morrow
af91604053 Merge pull request #212 from tuncer/hrl-error
Fix basho/rebar#388
2014-01-16 15:11:45 -08:00
Jared Morrow
b2c2adb7c0 Merge pull request #215 from tuncer/experimental
Remove experimental flags
2014-01-16 15:09:50 -08:00
Jared Morrow
c5e48b4a8b Merge pull request #214 from tuncer/compile_only
Document compile_only=true
2014-01-16 15:07:47 -08:00
Jared Morrow
477fbabfa8 Merge pull request #210 from tuncer/erlydtl-warnings
Fix #205 (erlydtl:compile/3 returns warnings)
2014-01-16 14:09:43 -08:00
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
Jared Morrow
5d2b9ba23f Merge pull request #191 from tuncer/rename-modules
Fix #187 (rename getopt and mustache)
2014-01-14 13:38:30 -08:00
Jared Morrow
cf3a24e5c7 Merge pull request #196 from tuncer/rebar-run-info
Print a more appropriate message on 'rebar info'
2014-01-14 12:49:42 -08:00
Jared Morrow
d75af5266d Merge pull request #183 from EchoTeam/generate-upgrade-and-target-dir
generate-upgrade can now take target_dir argument
2014-01-14 12:48:48 -08:00
Tuncer Ayaz
3c1b819369 erlydtl: add missing clause (Reported-by: goofansu)
erlydtl implemented 'binary' option. Add new clause for {binary, false}.
2014-01-14 18:38:53 +01:00
Tuncer Ayaz
5fa6671511 Remove experimental flags
Remove experimental flag from:
* qc compile_only=true
* eunit compile_only=true
* src/foo.app.src.script
* eunit tests=
2014-01-14 12:44:53 +01:00
Tuncer Ayaz
8a94a41ef0 Document compile_only=true 2014-01-14 12:44:09 +01:00
mats cronqvist
4ca7c84179 introduce xref_extra_paths 2014-01-13 15:11:12 +01:00
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
Tuncer Ayaz
34ead92c83 Fix #187 (rename mustache to rebar_mustache) 2014-01-01 10:59:34 +01:00
Tuncer Ayaz
777fefe181 Fix #187 (rename getopt to rebar_getopt)
While at it, update getopt.erl to git rev 78eda3b.
2014-01-01 10:59:34 +01:00
Tuncer Ayaz
a8a415aed4 Fix regression caused by 252b31f (#90) 2014-01-01 10:59:16 +01:00
Tuncer Ayaz
39c38b6141 rebar_core: minor comment fix 2014-01-01 10:59:16 +01:00
Tuncer Ayaz
4af177bd06 Print a more appropriate message on 'rebar info'
To avoid treating plugins' info/2 functions as commands, we catch calls
to 'rebar info'. Previously (4b8c81fb) we simply printed the help
string, but it's much more informative to print the following:
Command 'info' not understood or not applicable
2014-01-01 10:58:32 +01:00
Pierre Fenoll
70cdb37942 Add command to rebar:command_names/0 2013-12-19 23:05:49 +00:00
Pierre Fenoll
c83d037404 Add a library template 2013-12-19 22:01:25 +00:00
Tuncer Ayaz
031e7c5fc5 rebar_dia_compiler: fix Dialyzer warnings 2013-12-17 14:27:35 +01:00
Florent Gallaire
51584caa3e A switch variable can have multiple values 2013-12-11 14:10:21 +01:00
Florent Gallaire
0e39dc4149 Support switch template instructions 2013-12-11 14:10:21 +01:00
Tuncer Ayaz
277a10cd3b Fix is_verbose/1 helper function 2013-12-06 21:39:53 +01:00
Tuncer Ayaz
f39309a660 Write ERROR messages to standard_error device 2013-12-06 19:05:45 +01:00
Tuncer Ayaz
6de94e8a16 Change default log level to 'warn' and introduce -q/--quiet 2013-12-06 19:05:45 +01:00
Tuncer Ayaz
e5d76e7e8c rebar_log: use defines for log level numbers 2013-12-06 19:05:45 +01:00
Tuncer Ayaz
2f636236bf rebar_config:is_verbose/0: fix variable name 2013-12-06 19:05:45 +01:00
Tuncer Ayaz
6fe3b82b5b Make list of commands (for unabbreviation) easier to maintain
It's easier to modify the list with each command on a separate line.
The shell completion scripts have already been modified that way.
2013-12-04 20:11:49 +01:00
Jared Morrow
c02fcec92c Merge pull request #174 from tuncer/dialyzer-fixes
rebar_core: fix Dialyzer warning introduced in aa46d85 (#157)
2013-12-03 13:10:05 -08:00
Jared Morrow
dac4f9245d Merge pull request #173 from tuncer/unknown-vsn
Fix false reporting of (plain) vsn strings
2013-12-03 13:07:01 -08:00
Jared Morrow
cedb889137 Merge pull request #172 from tuncer/dep-examples
Add missing dep examples and fix existing ones
2013-12-03 13:04:16 -08:00
snaky
2246d1b69e generate-upgrade can now take target_dir argument
Previous generate-upgrade required renames in rel/ directory:

    rebar generate
    ...changing code...
    mv rel/<release> rel/<release_prev>
    rebar generate
    rebar generate-upgrade previous_release=<release_prev>

With the proposed changes you can now do the same without moving things:

    rebar generate # default target dir: rel/<release>
    ...changing code...
    rebar generate target_dir=<release_new>
    rebar generate-upgrade target_dir=<release_new> previous_release=<release>
2013-12-03 12:32:39 +04:00
Tuncer Ayaz
37310820f7 rebar_core: fix Dialyzer warning introduced in aa46d85 (#157) 2013-11-26 21:15:04 +01:00
Tuncer Ayaz
55d1539404 lfe: use correctly filtered erl_opts 2013-11-26 20:33:56 +01:00
Tuncer Ayaz
8f05368ba4 erlc: properly reuse the right erl_opts in test_compile
Avoid getting erl_opts twice in test_compile/3, and make sure the
correctly filtered (platform_define, etc.) version is used.
2013-11-26 20:33:56 +01:00
Tuncer Ayaz
edef0962d2 Fix false reporting of (plain) vsn strings
rebar used to mistakenly report plain version strings like
{vsn, "1.0.0"} as follows:
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "1.0.0"

Properly detect unknown/unsupported version terms and abort
if we encounter one.

While at it, rename a variable in vcs_vsn/3 to be non-misleading.
2013-11-26 20:33:34 +01:00
Tuncer Ayaz
79903b9eeb deps: remove undocumented fossil syntax
As discussed with Martin Schut, remove support for
{app_name, "vsn", {fossil, "url", latest}.
2013-11-26 20:30:16 +01:00
Tuncer Ayaz
d7cef6b4c1 Add missing dep examples and fix existing ones 2013-11-26 20:30:16 +01:00
Jared Morrow
988c9cd574 Merge pull request #155 from tuncer/fixes
Fixes for #137 and #142
2013-11-26 06:18:30 -08:00
Jared Morrow
9a158d37fc Merge pull request #157 from Vagabond/adt-lib-dir
Don't over-aggressively clean the code path in the presence of lib_dir directives
2013-11-22 14:17:21 -08:00
Andrew Thompson
aa46d85849 Don't badmatch if a path we think we added isn't in the code path 2013-10-17 12:36:36 -04:00
Andrew Thompson
d983beafe9 Don't over-aggressively clean the code path in the presence of lib_dir directives
Rebar, when it encounters a lib_dir directive, caches the current code
path, adds the libdir(s) and returns the cached copy of the path. When
rebar has finished processing that directory, it restores the cached
path. This is problematic in the below scenario:

        /(lib_dir)->G
  A -> B -> C -> D -> E
   \-> F -> D -> E

When rebar is finished processing B, it restores the code path to what
it was before it processed B, removing C, D, E and G from the code path.
This means when it comes to process F, neither D or E are in the code
path, so any header includes, rebar plugins or parse transforms will not
be in the code path. Without the lib_dir directive, rebar does no code
path cleanups, so everything works fine.

This change makes rebar only remove the explicit lib_dir code paths it
added and adds an inttest that replicates the above scenario.
2013-10-16 19:58:02 -04:00
Andrew Thompson
01df43e58a Fix update-deps with certain forms of the {tag, ...} type
Sometimes tags like 1.1-3-g3af5478 or d20b53f0 are encountered. The
first is the output of 'git describe', and the second is just a regular
git SHA. git fetch --tags will not pull these down, so do a full git
fetch instead.
2013-10-16 12:43:01 -04:00
Manuel Rubio
dfba6dd6f9 Fix issues introduced in #137 (4dfdd72)
* fix Dialyzer warning
* fix formatting
2013-10-16 13:21:56 +02:00
Tuncer Ayaz
d49ac03627 rebar_deps: fix overly long lines 2013-10-16 13:21:51 +02:00
Tuncer Ayaz
95910c7764 rebar_deps: 'depowner' has to be stored in xconf 2013-10-16 12:51:22 +02:00
Tuncer Ayaz
6518b5f541 rebar_deps: fix Dialyzer warning 2013-10-16 12:36:32 +02:00
Tuncer Ayaz
348d13b064 'current_command' has to be stored in xconf 2013-10-16 12:29:54 +02:00
Dave Smith
ed88055a75 Merge pull request #142 from Vagabond/adt-update-deps
Make update-deps traverse deps breadth-first, top-down
2013-10-14 15:09:03 -07:00
Andrew Thompson
e74de95eeb Address review comments and add inttest for update-deps 2013-09-30 16:57:50 -04:00
Andrew Thompson
eae26a5c43 Fix skip check for deps not present 2013-09-24 12:07:41 -04:00
Andrew Thompson
d9aa65f118 Make update-deps honor apps= and skip_apps=
Because rebar_core handles skipping apps, we had to specialcase the
handling in the case of update-deps because it has to do its own dep
handling. The way this was done is not particularly clean, but there
currently does not exist another way for a command to signal rebar_core
that it doesn't want rebar_core to pay attention to skip_apps.

With this change, however, you can update-deps even with local
conflicting changes/commits by simply skipping the deps you don't wish
to update, or whitelisting he ones you do wish to update.
2013-09-23 15:19:51 -04:00
Andrew Thompson
f46e7b2e5c Change how update-deps updates a git branch
Previously, update-deps on a dep tagged as {branch, ...} would do the
following:

  git fetch
  git checkout -q origin/<branch>

If you were already on that branch, the repo would end up in detached
head state. This is kind of annoying if you're doing local development.

This patch changes the behaviour to be

  git fetch
  git checkout -q <branch>
  git pull --ff-only --no-rebase -q <branch>

The intent of this is to move the branch's HEAD forward to match
upstream without destroying any local commits or changes, and without
accidentally causing merges or rebases. It will fail if the operation
can not be performed without losing history, merging or rebasing.

The previous behaviour has been around a very long time:

064195dc5a (L0R308)

It also exactly mirrors the download_source case, which is not really
true. With git tags and SHAs, one can assume that they don't change, but
branches move all the time.
2013-09-23 15:13:26 -04:00
Andrew Thompson
0977d58361 Ignore skip_deps during update-deps as it has no meaning 2013-09-23 15:11:11 -04:00
Dave Smith
72247281a2 Merge pull request #111 from tuncer/nox-erlydtl-compile
Always return the errors and warnings from erlydtl
2013-09-20 13:06:02 -07: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
0550560221 Fix eunit regression introduced in 2716d83a18
Use alternative way to detect net_kernel:stop/0 has succeeded as
suggested by Ulf Wiger.
2013-09-20 20:53:16 +02:00
Robert Newson
ebbb927cbc Allow specification of module dependencies for appups
The order in which modules, within an application, are loaded can be
important. This patch adds allows the specification of module
dependencies such that generate .appup/.relup scripts will load a
module's dependent modules before itself.

To use:

in rebar.config, add a module_deps

{module_deps, [{ModuleName, [DependentModuleName, ...]}]}.

ModuleName is the name of any module, followed by a list of module
names that it depends on.
2013-09-20 16:50:12 +01:00
Dave Smith
e840ac2112 Merge pull request #125 from lucafavatella/neotoma-doc-typo
Fix typo in neotoma help message
2013-09-20 07:26:11 -07:00
Dave Smith
d19a46676c Merge pull request #132 from alexthornton1/mib_to_hrl_verbosity
mib_to_hrl compilation verbosity via 'mib_opts'
2013-09-20 07:10:26 -07:00
Dave Smith
4dfdd726ad Merge pull request #137 from bosqueviejo/master
let vm.args and sys.config as optional
2013-09-20 07:05:06 -07:00
Dave Smith
d5ca068983 Merge pull request #138 from evax/conditionalTemplateInstructions
Support conditional template instructions
2013-09-20 07:02:51 -07:00
Björn Bylander
1dfe56b3c6 Change rebar_ct:check_log/3 to use double quotes
The call to the grep program in rebar_ct:check_log/3 used single
quotation marks around the strings grep should search for. This works
well in most cases but fails on Windows 7 using GNU grep 2.5.4 as
installed by the Chocolatey package GnuWin 0.6.3.1 with the follow
message:

ERROR: cmd /q /c grep -e 'TEST COMPLETE' -e '{error,make_failed}'
ct/raw.log
failed with error: 2 and output:
grep: COMPLETE': No such file or directory

This commit changes the single quotation marks to double quotation
marks. I've tested this using GNU grep 2.5.3 on a Debian Linux machine
and it works well.
2013-09-20 15:12:21 +02:00
Andrew Thompson
cb4599f828 Make update-deps traverse deps breadth-first, top-down
This ensures that deps of deps are updated AFTER the dep listing them
is, so that a complicated project with many layers of deps will be
updated correctly. Any new deps encountered along the way are also
cloned, and THEIR deps are also evaluated.

Also added was conflict detection, if a dep has differing versions or
source information, inherited from different places, that will be logged
at the end of update-deps, along with the origin of each conflicting
dep.
2013-09-20 01:24:07 -04:00
Evax Software
2970fab4b7 Support conditional template instructions 2013-09-19 07:11:37 +02:00
Manuel Rubio
3732662080 let vm.args and sys.config as optional 2013-09-19 00:59:51 +02:00
Alex Thornton
01fd873c1e mib_to_hrl compilation verbosity via 'mib_opts'
Previously, the configuration setting 'mib_opts' in rebar.config
would affect the call to snmpc:compile/2, so that (for example)
verbosity could be controlled.  However, the subsequent call to
snmpc:mib_to_hrl/1 did not include any of these options, so it
did not appear to be possible to control the verbosity of the
process of converting a MIB to a .hrl file.  To make matters
worse, the default was to dump a full trace -- including debug
output and various logging -- so the act of compiling a large
number of MIBs could result in a huge amount of "noisy" output
that hid any signal (meaningful warnings, errors, etc.).

This commit addresses that issue by replacing the call to
snmpc:mib_to_hrl/1 with a call to snmpc:mib_to_hrl/3 instead,
which includes an "options" argument that, at present, is only
capable of setting verbosity.  The verbosity setting is taken
from the 'mib_opts' setting in rebar_config, if present, and
the approriate kind of argument is passed to snmpc:mib_to_hrl/3.

It should be noted that snmpc:mib_to_hrl/3 is not listed in
Erlang's documentation, but does appear in the list of "API"
exports at the top of snmpc.erl in R15B01 (and remains that way
in R16B01), so this appears to be more of a documentation oversight
than the use of a deep, dark function call that was not intended
to be public.  snmpc:mib_to_hrl/3 accepts an #options{} record
(defined in lib/srdlib/include/erl_compile.hrl within Erlang's
source distribution), though most of the fields in that record
are ignored by snmpc:mib_to_hrl/3; only verbosity can be controlled
this way.
2013-09-08 00:37:47 -07:00
Luca Favatella
7bee2c0462 Fix typo in neotoma help message 2013-08-30 10:44:24 +01:00
Dave Smith
620c4b01c6 Use REBAR_DEPS_DIR if set as location of DEPS dir 2013-07-02 10:59:26 -06:00
Dave Smith
d3c7be265d Merge pull request #108 from tuncer/dialyzer
dialyzer_reference plus one minor patch
2013-06-29 06:28:35 -07:00
Tuncer Ayaz
bd3338a0a7 Document 'rebar help <CMD1> <CMD2>' 2013-06-29 15:10:23 +02:00
Tuncer Ayaz
2faabf460d rebar_deps: fix overlong line introduced in 0b83339 2013-06-27 21:02:16 +02:00
Dave Smith
96c7bd7338 Make sure to run ct_run w/ -noshell 2013-06-25 16:33:34 -06:00
Dave Smith
9cf7cf7cb0 Use ct_run if available; fixes strange issues with getting erl/ct to stop 2013-06-25 15:59:19 -06:00
Dave Smith
490d00f0d6 Adding debug statements closer to open_port 2013-06-25 15:59:05 -06:00
Dave Smith
4b642bf916 Merge pull request #41 from exterm/cover_html_validity
change cover html generation to produce valid html
2013-06-25 05:57:55 -07:00
Tuncer Ayaz
09cd4e9be2 rebar_xref: regression fixes and updates for a5be40c96
- restore support for "rebar help xref"
- update rebar.config.sample
- update 'help xref' string
- simplify new/changed functions by breaking out code or
  using simpler syntax where applicable
2013-06-24 21:46:24 +02:00
Tuncer Ayaz
bdf957b201 rebar_core: fix consistency issues caused by 252b31f
- refactor plugin dirs code to be simpler and easier to read
- use erlang-mode's default (%%) comments for portability/consistency
- make sure erlang-mode's indenter is used so that a future whole
  buffer indent doesn't get messed up
2013-06-24 21:46:24 +02:00
Tuncer Ayaz
edd835510b rebar_ct: fix Dialyzer warning caused by bcc57e9b
Also fix a single line exceeding max column.
2013-06-24 21:46:24 +02:00
Dave Thomas
091405bce7 Fix crsh with Unicode in environment vars 2013-06-23 20:30:38 -05:00
Dave Thomas
dd277fd01a Fix crash when env vars contain utf8 chars 2013-06-22 21:41:04 -05:00
Dave Thomas
934ec7fdef Add one more "unicode" option in expand_env_variable—I have a bullet in my prompt that was blowing it up 2013-06-21 23:40:32 -05:00
Juan Jose Comellas
d4164c9606 When expanding lib_dirs, don't crash with 'volumerelative' paths 2013-06-18 19:19:41 -03:00
Juan Jose Comellas
708c190faa Allow the use of absolute paths in the lib_dirs configuration setting 2013-06-18 18:03:30 -03:00
Dave Smith
a5be40c969 Merge branch 'xref_20130130' of git://github.com/spilgames/rebar into spg-xref
Conflicts:
	src/rebar_xref.erl
2013-06-17 16:31:09 -06:00
Dave Smith
d3c125de27 Merge pull request #47 from uwiger/master
rebar_eunit:reset_after_eunit/1 mustn't remove 'included_applications'
2013-06-17 15:21:11 -07:00
José Valim
e467642476 External deps_dir should have higher priority than the config one
The external deps_dir should have higher priority because
it is used by scripts and other build tools to set up the
location of the dependencies. This commit ensures that,
even if a project has set deps_dir in its config file has
lower preference than the command line one.
2013-06-18 00:28:52 +03:00
Philip Mueller
c79314593d remove superfluous string concat operator usage 2013-06-16 16:15:14 +02:00
Dave Smith
16eed82ae4 Merge pull request #60 from jcomellas/jc-getopt-0.7.0
Add latest version getopt that automatically wraps usage output lines
2013-06-16 06:24:37 -07:00
Dave Smith
baf2655343 Merge pull request #44 from nevar/fix_neotoma
Correct ext of neotoma output file
2013-06-16 06:21:59 -07:00
Dave Smith
2f4de5359c Merge pull request #37 from nox/force-registered
Ensure we always have a `registered` value in `.app` files
2013-06-16 06:14:48 -07:00
Dave Smith
76405da6d7 Merge pull request #24 from legoscia/master
Allow specifying eunit suite run order in 'suites'
2013-06-16 06:07:55 -07:00
Dave Smith
547552b5c2 Merge pull request #74 from DeadZen/dz-merged-overlay
Implement merged overlays
2013-06-14 05:52:42 -07:00
Juan Jose Comellas
4993a83820 Avoid passing more than one instance of ERL_LIBS to child processes
This commit fixes issue #98 by removing the ERL_LIBS and REBAR_DEPS_DIR
from the list of environment variables exported by the rebar_port_compiler
plugin.
2013-06-13 16:31:28 -03:00
Dave Smith
6cd982c897 Merge pull request #75 from rpt/master
Support for QuickCheck Mini
2013-06-12 06:18:16 -07:00
Dave Smith
638569acc2 Merge pull request #90 from Motiejus/dep_plugin
Fix searching for plugins
2013-05-21 05:22:43 -07:00
Motiejus Jakštys
252b31f2a4 Fix searching for plugins
If a plugin is in a dependency, rebar didn't search for it carefully
enough.
2013-05-19 16:33:29 +03:00
Dave Smith
ae3323728f Merge branch 'master' of git://github.com/ferd/rebar into ferd-master 2013-05-15 10:07:02 -06:00
Jeremie Lasalle Ratelle
c2fae0ca5c Add rebar-deps env to port compiler SharedEnv
REBAR_DEPS_DIR is often needed when a nif needs to be linked with a raw
dependency.
2013-05-06 11:15:06 -04:00
Fred Hebert
bcc57e9b04 Handle ct_run exit codes in R15B02 and later
Since R15B02, ct_run returns a non-zero exit code when some tests
failed or were auto-skipped. (See ticket OTP-9865.)

This fix makes it so a non-0 code doesn't cause an instant failure, but
still prompts for log verification before doing so. Given the behaviour
was acceptable for pre-R15B02, it should be valid with it with
post-R15B02.

The fix should also be backwards compatible.
2013-04-18 22:45:46 -04: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
Pedram Nimreezi
df7cfba71f Implement merged overlays
This allows overlay_vars to merge comma delimited var config files
2013-03-26 05:23:47 -04:00
Krzysztof Rutka
5dfb6d6351 Add support for QuickCheck Mini 2013-03-25 09:30:46 +01:00
Dave Smith
a9cb38e6d1 Merge pull request #68 from nevar/fix_unicode_promt
Fix unicode
2013-03-04 06:49:32 -08:00
Dave Smith
c77f8e13ca Fix missing call to cwd_predirs 2013-03-02 08:25:28 -07:00
Dave Smith
21038d537c Merge pull request #38 from tuncer/fix-sub_dir-association
rebar_core: fix sub dir association
2013-03-02 07:04:41 -08:00
Tuncer Ayaz
dc2f5c8c7b Update rebar repo urls 2013-03-02 14:16:33 +01:00