Commit graph

1100 commits

Author SHA1 Message Date
Fred Hebert
94d568ad0e Merge branch 'fix_format_source' of https://github.com/irpab/rebar into irpab-fix_format_source
Conflicts:
	THANKS
2014-12-21 15:35:13 -05:00
Fred Hebert
ae7a7aae18 Revert "Merge branch 'kittee-ct_appconfig_fix'"
This reverts commit 3c0f420c2a, reversing
changes made to 8f64e13184.
2014-12-21 15:25:00 -05:00
Fred Hebert
440d73825b Merge branch 'ct_appconfig_fix' of https://github.com/kittee/rebar into kittee-ct_appconfig_fix
Conflicts:
	THANKS
2014-12-21 15:17:03 -05:00
Fred Hebert
8f64e13184 Merge pull request #408 from lrascao/fix/remove_duplicate_console_message
Fix/remove duplicate console message
2014-12-21 15:03:27 -05:00
Fred Hebert
81063d33f0 Merge pull request #386 from tomas-abrahamsson/gpb-recompilation-detection
Recompile .proto files with gpb also with prefix/suffix
2014-12-21 15:03:05 -05:00
Fred Hebert
6584defdda Merge pull request #406 from stwind/master
Fix deps path check in rebar_ct:collect_glob/3
2014-12-21 15:02:39 -05:00
Luis Rascao
5bb7b2963f gpb_compiler: remove duplicate compiling message
It's unnecessary to print "Compiling..." since base_compiler already prints a
message to the effect.
2014-12-21 16:08:04 +00:00
Fred Hebert
3900724cec Remove no longer valid comment 2014-12-16 13:03:44 -05:00
Fred Hebert
ede6666961 Merge branch 'fix-dtl-target-path' of https://github.com/coolchevy/rebar into coolchevy-fix-dtl-target-path 2014-12-16 12:49:47 -05:00
stwind
a83c80d4c0 Fix deps path check in rebar_ct:collect_glob/3
Since rebar_deps:get_deps_dir/1 returns an absolute path,
lists:member(Deps, Parts2) will always return false, thus .test.spec
files in deps/ will not be ignored.
2014-12-11 11:59:40 +08:00
Tuncer Ayaz
39ab4e13fb Generate cachegrind file if erlgrind is available 2014-12-08 23:09:20 +01:00
Fred Hebert
01ef314951 Merge pull request #404 from tuncer/consistent-export-attributes
Consistently format export attributes
2014-12-04 10:51:48 -05:00
Tuncer Ayaz
c7a611d22d Consistently format export attributes 2014-12-03 23:25:46 +01:00
Vlad Dumitrescu
7d55c9986f Fix detection and processing of .app.src.script
Loading .app, .app.src or .app.src.script returns now the value as per
the documentation (was wrapped in a list in some cases).

More places in the code detect .app.src.script and handle it.
2014-12-03 18:39:17 +01:00
Vitalii Kulchevych
34a713d88a fix target dir without subdir for erlydtl templates 2014-12-02 16:51:36 +02:00
Tuncer Ayaz
b44b4f4199 Fix detection of .app.src.script (Reported-by: Vlad Dumitrescu)
rebar_app_utils:is_app_dir/1 failed to search for .app.src.script when
looking for an app file in src/.

While at it, fix inconsistent module export list.
2014-12-02 10:00:50 +01:00
Igor Savchuk
bc46b501d0 Fix app.config argument passing when using ct_run
ct_run has changed its config key from -ct_config to -config,
thus, -config key, used to specify app.config now must be
placed after -erl_args
2014-11-28 16:48:47 +03:00
Fred Hebert
d42ed46835 Normalize log level as WARN to ERROR in new patch 2014-11-27 15:34:52 -05:00
Tuncer Ayaz
a4c5f3357f Treat vsn mismatch as warning if -k/--keep-going
Fixes #319.
2014-11-25 18:44:21 +01:00
Fred Hebert
c54d496030 Additional fixes and modification
- Updating documentation to be more accurate
- Style fixes
- More precise error messages
2014-11-21 10:11:13 -05:00
Fred Hebert
b41086ba98 Merge branch 'fix_upgrade_error' of https://github.com/terrencehan/rebar into terrencehan-fix_upgrade_error 2014-11-21 09:59:46 -05:00
Fred Hebert
4ba8f74787 Revert "Merge branch 'platinumthinker-color_in_logs'"
This reverts commit 49930fe566, reversing
changes made to 6e6b0fd43f.
2014-11-21 09:57:49 -05:00
Fred Hebert
733d3771fa Merge branch 'color_in_logs' of https://github.com/platinumthinker/rebar into platinumthinker-color_in_logs
Conflicts:
	THANKS
2014-11-21 09:46:10 -05:00
Andrey Teplyashin
cc3f54b008 Fix verbose level in global rebar config
Replace application:set_env on erlang:put
2014-11-20 00:22:26 +06:00
Andrey Teplyashin
c01cf5902b Add colored logs 2014-11-19 23:44:55 +06:00
Tomas Abrahamsson
51b34a6e52 Recompile .proto files with gpb also with prefix/suffix
For protocol buffer files, when there were gpb options to alter the
module name with prefix or suffix, recompilation was not properly
detected. This is now fixed. (Issue #384).

Properly detecting change meant moving from rebar_base_compiler, so it
also meant processing protocol buffer files in sequence instead of in
parallel.
2014-11-05 00:31:52 +01:00
Tuncer Ayaz
3cae9d83cd Fix Dialyzer warning introduced in 0caf047f 2014-11-03 20:39:19 +01:00
Fred Hebert
17e0b14d1d Merge pull request #203 from tomas-abrahamsson/pluggable-proto-compilers-gpb
Pluggable proto compilers gpb
2014-10-31 09:32:13 -04:00
Tomas Abrahamsson
1b367a8b24 Add support for compiling proto files using gpb
This adds the config option {proto_compiler,gpb} for selecting gpb
as the compiler for protocol buffer files. When gpb is used as
compiler, it reads the gpb_opts config item for options.
2014-10-29 23:45:35 +01:00
Tomas Abrahamsson
0caf047fc3 Introduce pluggable protocol buffer compilers
Make it possible for plug in alternative protocol buffer compilers.
The compilers are picked up based on if they export all of the
functions key/0, proto_compile/3, proto_clean/3 and proto_info/2.
The set of compiler modules to choose from, is fetched from the rebar
application environment, from the app_dir modules.

A new config option, {proto_compiler,Compiler}, specifies which of
the available protocol buffer compilers to use. The 'protobuffs'
compiler is now one such compiler (the only one), and it is also the
default, for backwards compatibility.
2014-10-29 23:45:35 +01:00
Tuncer Ayaz
631d74c00f Implement eflame -p/--profile support
When -p/--profile is enabled, you can select the profiler as follows:

generate flame graph (eflame.svg) from trace (eflame.trace)
$ rebar -p compile profiler=eflame

generate fprof.analysis
$ rebar -p compile

generate fprof.analysis
$ rebar -p compile profiler=fprof
2014-10-29 19:24:58 +01:00
Pavel Baturko
5d89a93db2 deps: add new clause of format_source function
Function format_source in rebar_deps.erl will fail on sources
like {rsync, Path} or {hg, URL} in rebar.config.
Add new function clause to match such source types.
2014-10-24 09:47:23 +04:00
Pavel Baturko
dfc3cc5ad2 Skip check for ebin directory when building edoc
edoc target fails if ebin directory does not exist.
ebin directory is not necessary for building edoc.
Skip check that ebin directory exist.
2014-10-24 00:40:50 +04:00
Fred Hebert
6f7e70edee Fix cover print truncation when coverage is 100%
When the option {cover_print_enabled, true} is set and that the code
coverage is 100%, the '%' will end up being truncated.

This patch makes it so that the truncation happens at 4 a characters
width so that instead of the following printouts:

    some_mod  : 99%
    some_other: 100

We instead show:

    some_mod  :  99%
    some_other: 100%

This solves issue #331 as reported by @lispking and @NineFX.
2014-10-16 12:00:54 -04:00
Adam Lindberg
ec6ff3597d Escape more characters in path (fix #367) 2014-10-14 12:29:40 +02:00
Fred Hebert
d5e3b4329c Merge pull request #293 from liskin/port-deps
Check C source dependencies in needs_compile
2014-09-11 09:53:30 -07:00
Evan Vigil-McClanahan
ba466e2d38 Manually clean up paths
Using code:set_path/1 with very large paths is very slow on larger
projects.  On my mid-sized project, it seems to take around .4s per
call.  Emulating the call with direct path removal (using
code:del_path/1) seems to be quite a lot faster.
2014-08-18 13:56:19 -07:00
Tuncer Ayaz
3fb4a7c540 Fix OS X resource fork handling (Reported-by: Richard O'Keefe)
If you happen to fetch a zip archive of the git repo and try to build
from that, you may, for example, ask erlc to build src/._rebar.erl.
._* are OS X resource forks and not real .erl files. This may also
happen with network filesystems on OS X. To fix that, limit the
files compiled by rebar to include only those which start with
a letter or a digit.
2014-07-25 20:52:30 +02:00
Tuncer Ayaz
e9fcd11ccc Remove experimental label from 'eunit tests=' 2014-07-18 18:54:18 +02:00
Tuncer Ayaz
38934da869 Follow-up typo fixes for #327 2014-07-17 22:20:51 +02:00
Tuncer Ayaz
9b060f2de9 rebar_utils:otp_release/0: handle vsn like x.y.z**
As mentioned in the OTP documentation, licensed customers may use
patched OTP installations where the otp_patch_apply tool adds a '**'
suffix as a flag saying the system consists of application versions from
multiple OTP versions. When we get such a version string, we drop the
suffix, as we cannot obtain relevant information from it as far as
tooling is concerned.
2014-07-17 21:18:43 +02:00
Tuncer Ayaz
873d236ce9 Adapt arch string to versioning scheme changes (>= 17.x) 2014-07-17 18:53:58 +02:00
Tuncer Ayaz
6f60256138 Fix minor whitespace and comment issues in rebar_utils 2014-07-17 18:49:57 +02:00
Fred Hebert
8b6a2a8c74 Merge branch 'minor-fixes' of https://github.com/tuncer/rebar into tuncer-minor-fixes 2014-07-15 08:45:36 -04:00
Fred Hebert
3824b52b89 Merge pull request #316 from talentdeficit/rebar_shell_314
fix for #314 (rebar shell somehow blocks using io:format in gen_server handle_call)
2014-07-15 08:21:27 -04:00
Fred Hebert
dcfa6daf30 Merge branch 'erl-args-to-end' of https://github.com/NineFX/rebar into NineFX-erl-args-to-end
Conflicts:
	THANKS
2014-07-15 08:20:29 -04:00
alisdair sullivan
68089c6297 update group leaders when restarting user process
ensure any processes with a reference to an old user process as their
group leader are updated to use the new user process. this introduces a
slight delay at startup as the system must wait for the new processes
to be registered. there is a max wait period of three seconds (before
the shell command gives up and throws a timeout error)

fixes #314 ("rebar shell" somehow blocks using io:format in gen_server
handle_call)
2014-07-07 23:10:14 +00:00
Tuncer Ayaz
c22370a2cb Use correct types for OTP >=17.x 2014-06-29 21:13:54 +02:00
Tuncer Ayaz
5f995bfdc0 Fix a few minor formatting inconsistencies
* fix overlong lines
* where appropriate use %% instead of %
2014-06-29 21:13:45 +02:00
varnerac-ubnt
35ee457176 Fix bug 271
Moves ct_extra_params to the end of the generated ct_run command.
This allows users to pass commands to the underlying emulator
using -erl_args. The included rt test demonstrates that it is
possible to pass an addtional option to ct_run and -erl_args at
the same time. Finally, the test executes in regular and verbose
modes because rebar constructs the ct_run command differently in
verbose mode.
2014-06-27 15:35:56 -05:00
Fred Hebert
0b1e6b3779 Revert "Merge pull request #281 from tuncer/rebar-h-internal"
This reverts commit 07e2232847, reversing
changes made to 37cf470ae9.
2014-06-23 13:48:49 -04:00
Tomas Janousek
6fca763c9b Fix compiler invocation on multiarch Linux
This fixes port compilation for some configurations, notably this one:
Debian with 32-bit userspace, 64-bit kernel and 64-bit erlang packages.
2014-06-20 17:05:10 +02:00
terrencehan
a17ee35004 Fix upgrade error 2014-06-20 16:32:26 +08:00
Fred Hebert
e1237caee5 Merge pull request #260 from dgud/dgud/windows-fix-paths
Quote include/lib paths
2014-06-18 11:26:29 -04:00
Tristan Sloughter
8a0d8ad7a5 Merge pull request #285 from nevar/fix_inheritance
Fix #249 (erlc regression)
2014-06-15 14:48:12 -05:00
Tomas Janousek
3a549d3e37 Check C source dependencies in needs_compile 2014-06-15 17:22:26 +02:00
Tristan Sloughter
29a16cbabe Merge pull request #195 from fgallaire/switch_template_instructions
Switch template instructions
2014-06-14 21:55:44 -05:00
Tuncer Ayaz
1363ba3038 Wrap cover:stop() call as rebar_cover_utils:exit/0 2014-06-14 19:23:45 +02:00
Tuncer Ayaz
8fea315b0b rebar_eunit: disambiguate internal naming
Partially revert naming changes introduced in 93689703c1:
CoverageModules -> FilteredModules
get_coverage_modules -> get_matching_modules

Having the name "coverage" meaning "filtered/selected modules" can be
confused with code coverage.
2014-06-14 19:23:45 +02:00
Andras Horvath
4a6dc223b7 Add code coverage analysis functionality to `qc'
- Use `cover' with QuickCheck testing
- Reuse the `cover_*' rebar.config options
- Refactor cover-related code to separate module (`qc_cover_utils')
  for use with both `eunit' and `qc'
2014-06-14 19:23:45 +02:00
Tristan Sloughter
6a4d80e385 Revert "Merge pull request #171 from fenollp/using-stdlib"
This reverts commit 3297ffec2c, reversing
changes made to 0401debb3c.
2014-06-14 12:10:08 -05:00
Tristan Sloughter
07e2232847 Merge pull request #281 from tuncer/rebar-h-internal
Move include/rebar.hrl to src/rebar.hrl
2014-06-14 11:19:43 -05:00
Tristan Sloughter
37cf470ae9 Merge pull request #130 from yamt/ct-fixes
ct fixes
2014-06-14 11:18:54 -05:00
Tristan Sloughter
9380583f6c Merge pull request #229 from tolbrino/tb-patch-env
Add REBAR to environment before executing hooks
2014-06-13 19:25:21 -05:00
Tristan Sloughter
3297ffec2c Merge pull request #171 from fenollp/using-stdlib
Some optimisation/refactoring using stdlib's functions
2014-06-13 19:24:58 -05:00
Tristan Sloughter
0401debb3c Merge pull request #119 from deadok22/qualified-test-spec
Add qualified name tests specification (see #118)
2014-06-13 19:22:22 -05:00
Fred Hebert
fe16668a20 Merge pull request #136 from waisbrot/add-p4-support
Add support for the Perforce VCS client via the "p4" tool
2014-06-13 08:42:21 -04:00
Pierre Fenoll
258ab8a623 Rebasing. Fix differences with c26b0c7 c996e98 b690842. 2014-06-13 14:39:15 +02:00
Pierre Fenoll
e3d2142df5 Local corrections on string processing:
* Corrected regexp: `[x|y]` -> `[xy]`.
* Used an re:replace/4 option instead of multiple IOlist functions.
2014-06-13 02:22:26 +02:00
Matwey V. Kornilov
a7e05f57d1 Fix build for 17.0 using the solutiong proposed by @tsloughter
We use namespaced_types option to choose between dict() and dict:dict() types.
2014-06-08 14:34:04 +04:00
Tino Breddin
9c23dfef72 Add REBAR to environment before executing hooks
REBAR will be set to the rebar binary which was executed and runs the
builds. Enables the use of the same binary for rebar invocations as
part of a pre or post hook like so:

    ${REBAR} escriptize
2014-06-02 13:36:52 +02:00
Tuncer Ayaz
949d565527 erlc: replace if expression with case of
Motivated by the bug fix in 2c4d7d1.
2014-05-30 14:43:04 +02:00
Slava Yurin
49c25642b3 Fix #249 (erlc regression)
The combination of changes to rebar_erlc_compiler, and the fact
that erl_first_files is inherited, caused a regression. To fix
that, ensure every project uses its own .rebar/erlcinfo. While at
it, fix the issue that erl_first_files entries were not included
when initializing the dep digraph.

Reported-by: Louis-Philippe Gauthier
Reported-by: Roland Karlsson

Thanks: Tuncer Ayaz
2014-05-30 18:55:09 +07:00
Tuncer Ayaz
2c4d7d1d9b erlc: fix typo in update_erlcinfo/3 clause 2014-05-30 13:52:29 +02:00
YAMAMOTO Takashi
5e91322e4a use the effective deps dir instead of hardcoding "deps"
suggested by @tuncer
2014-05-30 14:48:15 +09:00
YAMAMOTO Takashi
ad588a70b7 fix double "the" in a comment
noted by @tuncer
2014-05-30 14:38:39 +09:00
YAMAMOTO Takashi
9713dafcb5 Fix spec file look up
When trying to skip spec files under deps/ directory,
ignore "deps" component which is also included in Cwd.
For example, "/home/deps/src/myapp/test/cover.spec"
contains "deps" component but should not be skipped if
Cwd is "/home/deps/src/myapp/".
2014-05-30 14:37:37 +09:00
YAMAMOTO Takashi
7fd5a2d630 Fix a format of a debug output 2014-05-30 14:37:37 +09:00
Sergey Savenko
93689703c1 Add qualified name tests specification (see #118)
Augment 'tests' option of 'rebar eunit' command with ability to specify
tests to run using module-qualified names. This change also forced me
to change the way modules for coverage and for testing itself are
selected - module-qualified tests specifications are now taken into
consideration. Extend tests to cover new functionality. Update
dialyzer_reference accordingly.
2014-05-29 22:38:14 +04:00
Fred Hebert
763f5dc9ef Merge pull request #280 from talentdeficit/bettershell
improve output when using `rebar shell`
2014-05-27 08:10:23 -04:00
alisdair sullivan
89cd24937e improve behaviour of rebar shell
attempt to emulate the behavior of
`erl -pa ebin -pa deps/*/ebin`

fix error messages and formatting issues of `rebar shell` by
shutting down and restarting the user subsystem in a mode more
hospitable to the shell than the simple user started when run
as an escript. emulate `error_logger` behaviour when the shell
is run via `erl`

add documentation of the shell command

limitations:

the erlang interrupt handler is not enabled when running as an
escript and there is no interface to re-enable it via erlang code.
this means `ctrl-c` will immediately exit the running process
unlike when running the shell via `erl`. `ctrl-g` is, however,
unaffected

the user subsystem is killed and restarted but not supervised. if
your code somehow relies on the user subsystem crashing and
restarting `rebar shell` may interfere with it's operation
2014-05-26 22:35:10 +00:00
Tuncer Ayaz
bf63171893 Move include/rebar.hrl to src/rebar.hrl
rebar.hrl is only meant to be used by src/*.
2014-05-22 11:56:54 +02:00
Jared Morrow
755c6023d1 Merge pull request #52 from shino/slim-release-support
Slim release support
2014-05-21 15:36:57 -06:00
Jared Morrow
93621d0d0c Merge pull request #251 from mururu/eunit_compile_opts
Make sure that eunit/qc_compile_opts works
2014-05-19 09:14:03 -06:00
Jared Morrow
8a5b9aa29f Merge pull request #244 from tuncer/missing-help
Document skip_apps=, apps=, and require_*_vsn
2014-05-19 09:12:30 -06:00
Jared Morrow
7d4d3642b6 Merge pull request #274 from redpine50/broken_on_win
Use lowercase for Windows drive name to resolve issue #250
2014-05-19 09:09:31 -06:00
Jared Morrow
fdb66ecb94 Merge pull request #242 from tuncer/erlc-speedup-v5-fixup
Extra commits for #129
2014-05-19 09:06:20 -06:00
Yuki Ito
c996e9878b Make sure that eunit/qc_compile_opts works fix #245 2014-05-13 12:53:52 +09:00
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