Commit graph

1071 commits

Author SHA1 Message Date
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
Tuncer Ayaz
1036277525 rebar_core: fix broken indentation 2013-02-26 18:24:50 +01:00
Tuncer Ayaz
9715c40386 rebar_core: remove useless return after ?ABORT call 2013-02-26 18:24:50 +01:00
Tuncer Ayaz
2b9241bd2b rebar_core: document pre-dirs association 2013-02-26 18:24:50 +01:00
Dave Smith
e36b9c1bff Merge pull request #59 from Vagabond/adt-read-lists-from-files
Support reading mustache 'lists' from files
2013-02-26 07:23:26 -08:00
Slava Yurin
fb77295a1f Fix handling of Unicode characters in env vars 2013-02-18 14:20:27 +07:00
Andrew Thompson
ee8919420d Support reading mustache 'lists' from files
This commit add support for reading mustache 'lists' from files, so you
can use the list section functionality when templating things.

An example of the list syntax is as follows:

{package_commands, {list, [[{name, "riak"}], [{name, "riak-admin"}], [{name, "search-cmd"}]]}}.

Then you can, for each of the list elements, render some text:

{{#package_commands}}
chmod +x bin/{{name}}
{{/package_commands}}
2013-01-30 16:43:29 -05:00
Dennis Docter
61e79afd80 Add standard xref checks and improved suppression
* Allow the following predefined analyses :
   undefined_function_calls, undefined_functions, locals_not_used,
   exports_not_used, deprecated_function_calls, deprecated_functions

* Trap some possible errors in case module information is not
    available

* ignore_xref works on all checks and can take {M,F,A} tuples.
  (Automatic behaviour export suppression still only works on
  exports_not_used)
2013-01-30 15:26:01 +01:00
Philip Mueller
e29d84fbf6 break overlong line 2013-01-30 14:24:54 +01:00
Juan Jose Comellas
e2b1941c4b Add latest version getopt that automatically wraps usage output lines 2013-01-25 21:48:37 -03: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
Slava Yurin
b63328bb16 Correct ext of neotoma output file 2012-12-31 11:16:47 +07:00
Dave Smith
78fa8fc3d5 Merge branch 'saleyn-erlydtl' 2012-12-17 09:27:07 -07:00
Tuncer Ayaz
2716d83a18 Fix basho/rebar/issues/286 2012-12-17 12:53:48 +01:00
Ulf Wiger
209ca73b91 rebar_eunit:reset_after_eunit/1 mustn't remove 'included_applications'
One could argue that rebar_eunit does some pretty dangerous stuff when
trying to clean up after a test run, but specifically, it tells the
Application Controller to delete everything returned by
application:get_all_env(App). Unfortunately, included_applications
also goes, which can lead to a crash in application_controller, if
the application is subsequently unloaded.

This patch attempts the smallest possible fix: remove all env
variables except included_applications.
2012-12-16 21:30:15 +01:00
Philip Mueller
4ae4a80219 change cover html generation to produce valid html
- added missing doctype
- added encoding statement
- removed invalid additional opening <body> tag
2012-12-12 12:38:39 +01:00
Anthony Ramine
22641c07ec Ensure we always have a registered value in .app files
`systools:make_relup/4` fails with `{missing_param, registered}`
without a `registered` value.
2012-12-07 14:43:35 +01:00
Dave Smith
71c717d86b Merge pull request #26 from l4u/patch-1
Support environment vars with unicode characters
2012-12-02 09:52:29 -08:00
Dave Smith
329eba4e52 Merge pull request #13 from tuncer/fixes
Fixes
2012-11-23 07:19:32 -08:00
Joseph Wayne Norton
7d624e9018 Add missing rebar_qc:clean/2 2012-11-23 22:14:56 +09:00
José Valim
61c353dcfd Support environment vars with unicode characters
The results returned by os:getenv() may contain unicode characters.
That said, we need to explicitly allow unicode when splitting the
environment information, otherwise badarg will be raised causing all
rebar commands to fail until the environment variable is removed.
2012-11-22 01:30:49 +08:00
Magnus Henoch
e4083cacee Run eunit suites in the order specified in the 'suites' command line parameter
Normally, Rebar runs eunit tests in the order the beam files are
stored in the file system (see rebar_utils:beams).  However, sometimes
it is desirable to run the tests in a different order (e.g. to
reproduce an error found on a build server).  For that case, it would
make sense to use the 'suites' parameter not just for selecting which
modules to consider, but also for choosing the order.
2012-11-20 15:50:00 +00:00
Tuncer Ayaz
06dbb4cb80 Document escriptize command 2012-11-19 00:01:59 +01:00
Tuncer Ayaz
abb319d10a rebar_ct: fix wording in comments 2012-11-18 23:36:59 +01:00
Tuncer Ayaz
0d5583db5a rebar_require_vsn: remove trailing whitespace 2012-11-18 19:36:59 +01:00
Tuncer Ayaz
ed55df9648 rebar_neotoma_compiler: fix comment 2012-11-18 18:57:55 +01:00
serge
edfee29b15 Fix default DTL compilation when no erlydtl_opts are provided 2012-11-15 16:34:06 -05:00
Tuncer Ayaz
a015892e21 Cleanup rebar_core and rebar_erlc_compiler
Rename rebar_core functions for improved readability.
Remove redundant comments and blank lines.
2012-11-15 15:41:51 +01:00
Tuncer Ayaz
6a63ab9f6c rebar_erlc_compiler: fix src_dirs comment 2012-11-15 01:33:26 +01:00
Dave Smith
bf35ec9392 Merge branch 'ates-diameter' 2012-11-12 21:40:57 -07:00
Dave Smith
7dad2b384b Be sure to filter empty sources (h/t to Tuncer and Joe Norton) 2012-11-12 20:18:00 -07:00
Artem Teslenko
4c25718492 Add support to compile the Diameter dictionary files 2012-11-12 15:03:43 +02:00
Dave Smith
9ac6c25f6d Restore support for so_name, port_envs and port_sources 2012-11-11 13:03:24 -07:00
Tuncer Ayaz
a9491e112f Fix Dialyzer warning in rebar:run/2 2012-11-11 00:21:13 +01: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
Dave Smith
7826232a03 Merge pull request #327 from saleyn/erlydtl_compiler
Erlydtl compiler
2012-11-10 06:08:16 -08:00
Dave Smith
a2fb8fdc39 Expose Erlang API for invoking rebar 2012-11-06 08:40:41 -07:00
Dave Smith
a7c32f8d98 Add comment to explain why we're using sub_dirs by hand 2012-11-05 06:19:02 -07:00
Daniel Luna
b1a947488b Add all subdirs to xref library path 2012-11-05 06:19:02 -07:00
Daniel Luna
2b5844d14c Add email address to my name 2012-11-05 06:19:02 -07:00
Dave Smith
6eb7c08499 Merge pull request #293 from Motiejus/skip_deps
Add skip_deps=AppListSeparatedByCommas feature.

I agree it's a bit of a weird thing, but it's a reasonable and safe extension. When time comes to properly overhaul stuff, skip_deps should disappear entirely.
2012-10-31 19:47:13 -07:00
Arjan Scherpenisse
cc67814b65 ct: skip instead of halt on missing/unknown suite
This allows `rebar ct suites=abc` to consider all suites when
you have a rebar setup with multiple sub_dirs.

Previously, rebar halted after it could not find the suite in the
first dir. But the suite might be present in another dir (when
sub_dirs contains multiple dirs).

This commit makes it so instead of halting, it prints a warning and
continues with looking for the suite in the other `sub_dir`s.

Note -- This uses try/catch to cause the test to be skipped because
otherwise I needed to adjust the return values of 4 functions, the
code path is pretty deeply nested here. Otherwise the whole call chain
needed to be adjusted for this return value:

`run_test -> make_cmd -> get_suites -> find_suite_path`

IMHO, I think for exceptional cases like this it is fine to use throw;
specially since only the {skip} is catched and nothing else.
2012-10-31 20:37:42 -06:00
Dave Smith
3ee3a7cd9e Merge remote-tracking branch 'basho/master' 2012-10-30 21:26:54 -06:00
Dave Smith
08c510130e Merge pull request #243 from evanmcc/pevm_min_otp_version
Add support for minimum OTP versions
2012-10-30 19:23:08 -07:00
Tuncer Ayaz
588244465f Revert arch string changes 2012-10-29 16:01:28 +01: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
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
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
Dave Smith
53ae245725 Merge pull request #217 from alavrik/raw_deps_new
Add support for non-Erlang/OTP (raw) dependencies
2012-10-21 11:22:51 -07:00
Dave Smith
d896fbffa7 Merge pull request #325 from saleyn/reltool
Fix return value of rebar_overlay
2012-10-20 12:06:04 -07:00
serge
2d5bd56605 Fix return value of rebar:overlay/2
When 'rebar overlay' is run rebar_core got a wrong result
{Config, ok} from rebar_reltool instead of {ok, Config}.
2012-10-20 13:32:30 +04:00
serge
3de9167d99 Add hostname variable to reltool overlay templates 2012-10-20 03:05:42 +04:00
Anton Lavrik
0b833391ed Add support for non-Erlang/OTP (raw) dependencies
Introduce a new 'raw' option for dependency specs in rebar.config file.
For example:

{deps,
    {dependency_name, "1.0.*",
	 {git, "<...>", {branch, "master"}},
	 [raw]
    }
]}.

When this option is specified, rebar does not require the dependency to
have a standard Erlang/OTP layout which assumes presence of either
"src/dependency_name.app.src" or "ebin/dependency_name.app" files.

'raw' dependencies can still contain 'rebar.config' and even can have
the proper OTP directory layout, but they won't be compiled.

Only a subset of rebar commands will be executed on the 'raw'
subdirectories:

	get-deps, update-deps, check-deps, list-deps and delete-deps.
2012-10-11 02:06:08 -05:00
Tuncer Ayaz
32e67ef55e rebar_edoc: use correct proplist() type (Reported-by: Kostis Sagonas) 2012-10-03 12:28:19 +02:00
Dave Smith
8ff99f98b3 noshell/noinput should NOT be the default emulator args for an escript 2012-10-02 20:17:09 -06:00
Tuncer Ayaz
2829741a38 Fix whitespace errors 2012-09-28 23:37:18 +02:00
Martin Schut
fbbeb360a5 deps: add fossil scm support 2012-09-28 23:34:53 +02:00
Tuncer Ayaz
f4e55b8463 Fix fprof use (-p/--profile) 2012-09-26 22:18:35 +02:00
Tuncer Ayaz
1b52a597c4 Revert 15b7798e4 and restore old git-describe call
Restore previous 'git describe' behaviour as discussed here:
http://lists.basho.com/pipermail/rebar_lists.basho.com/2012-September/001713.html
2012-09-21 17:20:03 +02:00
Tuncer Ayaz
9521586bdd rebar_deps: fix whitespace errors 2012-09-15 19:05:15 +02:00
Yurii Rashkovskii
9a57e06015 Restore ability to specify deps_dir on the command line
It was previously possible to run `rebar compile deps_dir=/path/to/deps`,
but as of 70d27c5720, it was nixed.
2012-09-15 18:58:02 +02:00
Shunichi Shinohara
22b703efa8 eunit: analyze coverage only for cover compiled modules
This change fixes #310.
2012-09-13 22:30:30 +02:00
Daniel Luna
7bd318c219 xref: allow multiple behaviours and ignore_xref pragmas 2012-09-13 22:20:55 +02:00
Eric Merritt
eaad535e31 Allow script to be evaluated when app file is loaded
This allows an <app-name>.app.src.script to be defined and evaluated
when <app-name>.app.src or <app-name>.app are loaded. This allows the
user to add project specific manipulations to app metadata.
2012-09-07 22:53:50 +02:00
Tuncer Ayaz
e0bc55db33 Use R15B02 EUnit {test,M,F} primitive as suggested by Richard Carlsson 2012-09-06 00:50:46 +02:00
joewilliams
29492dd0e8 Correctly use release_handler:create_RELEASES 2012-09-04 18:43:22 +02:00
Ryan Zezeski
e7be6874d7 Pass compile flags to protobuffs
By default protobuffs doesn't create beams with debug info.  This
causes issues when running dialyzer which requires debug info.  Read
the `erl_opts` config and pass it down to protobuffs compiler.
2012-09-03 12:10:14 +02:00
Tuncer Ayaz
d22a2bb81f rebar_ct: ?DEBUG log ct_run command 2012-09-03 11:40:53 +02:00
Tuncer Ayaz
f460eb14bc rebar_ct: do not export variable from case 2012-09-02 21:30:59 +02:00
Tuncer Ayaz
f0bf3503cb Update port_env for Mountain Lion (Noticed-by: Tony Rogvall) 2012-09-01 11:13:34 +02:00
Tuncer Ayaz
f22337b68f Comment eunit_test:function_wrapper/2 TODO 2012-09-01 11:11:24 +02:00
Tuncer Ayaz
8aadd65a34 rebar_eunit: adapt to R15B02 changes 2012-08-31 22:07:42 +02:00
Tuncer Ayaz
3cc8fb2855 rebar_reltool: remove blank lines 2012-08-30 22:20:02 +02:00
Dmitriy Kargapolov
9c7259d8a2 Add dynamic .script support for overlay vars file 2012-08-30 22:18:09 +02:00
Markus Näsman
2d139ea6c2 Stop cover server between eunit runs for speed
Cover gets slower and slower for each application. This is due to the
cover_server internal state. Stopping the cover server between
eunit+cover runs, emptying the cover_server state, gives a ~5-6x speed
improvement when analyzing many Erlang modules. Stopping the cover
server replaces the earlier practice of doing a cover:reset before each
run. On a project consisting of 62 dependencies with a total of 1866
Erlang modules the running time of rebar eunit decreased from ~20
minutes to ~3 minutes.
2012-08-30 17:27:43 +02:00
Tuncer Ayaz
ff8337f9b0 Fix whitespace error in rebar_eunit 2012-08-22 19:17:17 +02:00
Tuncer Ayaz
f528c397f8 Fix whitespace errors in rebar_ct and rebar_eunit 2012-08-22 19:14:35 +02:00
Tuncer Ayaz
3c0d97bf2c Cleanup and comment 2012-08-20 13:55:55 +02:00
Roberto Ostinelli
60516dc406 Fix tests= option not running generator tests 2012-08-20 12:58:34 +02:00
Roberto Ostinelli
fa6618f2b4 Add experimental tests= filter without eunit suites 2012-08-20 12:58:31 +02:00
Tuncer Ayaz
9dd8e7f2ee Fix #295 (consider *_SUITE.beam in ct skip check) 2012-08-19 15:25:13 +02:00
Tuncer Ayaz
6c1694980c Fix whitespace error 2012-08-18 17:19:42 +02:00
Joe DeVivo
991e2ce8e1 Add erlc override from erl_opts: outdir 2012-08-18 17:19:23 +02:00
Tuncer Ayaz
fc7df16e31 Clarify comments 2012-08-12 14:03:44 +02:00
Tuncer Ayaz
bdee72fae8 rebar_eunit: add tests= TODO item 2012-08-11 23:10:06 +02:00
Roberto Ostinelli
69dc9ec933 Add experimental tests= filter for eunit suites 2012-08-11 23:08:21 +02:00
Tuncer Ayaz
563607bc02 Change escript zip archive creation as suggested by Siri Hansen
1. manually insert directory entries to work around issues fixed in
   R15B02 erl_prim_loader
2. put the escript archive's beams in appname/appname/ebin

Tested with R13B03 and R15B01.
2012-08-11 18:47:25 +02:00
Tuncer Ayaz
795f9345a7 New upstream mustache.erl 2012-08-11 15:04:09 +02:00
Tuncer Ayaz
5d6b82390f rebar_eunit: fix typo 2012-08-10 16:05:00 +02:00
Tuncer Ayaz
8f3873e061 rebar_utils: refactor get_experimental and get_deprecated funs 2012-08-10 14:28:42 +02:00
Tuncer Ayaz
75a6de27e7 rebar_qc: ensure_dir/1 the same way as in rebar_eunit 2012-08-09 18:44:08 +02:00
Tuncer Ayaz
e47d643ea3 Use separate dirs for eunit and qc 2012-08-09 18:37:26 +02:00
Tuncer Ayaz
b5e0d6d5db Fix rebar_core:restore_code_path (Reported-by: Siri Hansen)
Use erl_prim_loader:read_file_info instead of filelib:is_file to make
sure paths inside the escript archive are handled properly.
2012-08-09 16:15:10 +02:00
Tuncer Ayaz
16091f9934 rebar_utils: fix whitespace error 2012-08-09 16:14:42 +02:00
Tuncer Ayaz
99b645e4a3 Separate eunit and qc compile options 2012-08-09 14:04:53 +02:00
Tuncer Ayaz
803f6e8ecd Replace test-compile with compile_only=true option 2012-08-09 14:04:53 +02:00
Motiejus Jakštys
8f01d0de60 Add skip_deps=AppListSeparatedByCommas feature 2012-08-09 09:48:16 +02:00
Tuncer Ayaz
e5569e6862 rebar_qc: use lists:flatmap/2 2012-08-08 23:28:00 +02:00
Tuncer Ayaz
3f2ad54ebc rebar_qc: fix #292 (Reported-by: Brian L. Troutwine) 2012-08-08 23:27:47 +02:00
Lev Walkin
f2f294d812 Do not rewrite .app file if it didn't change 2012-08-08 00:52:54 +02:00
Edwin Fine
ca8d7cc95d Ensure edocs are also built if only overview.edoc changes 2012-08-08 00:52:42 +02:00
DeadZen
f1d35f9d06 Add ct_log_dir option, skip test dir with no SUITE
When rebar ct executes with its default common test directory of "test",
it will generate a hardcoded "logs" directory in every application with
a test directory present, causing an overlap with eunit's test framework
so even test directories with only eunit tests will be processed by ct.
2012-08-07 14:22:59 +02:00
Tuncer Ayaz
888bbc8ee2 Fix whitespace error 2012-08-07 14:03:58 +02:00
Tuncer Ayaz
fdc1425a3b Use rebar_utils:test_dir/0 for coverdata export file 2012-08-07 14:02:13 +02:00
David Åberg
43d5b6257e Enable export of cover data from eunit testrun 2012-08-07 13:44:40 +02:00
Tuncer Ayaz
aec71f93cb Clean up specs 2012-08-06 19:52:09 +02:00
Tuncer Ayaz
1b9f2a5981 rebar_utils: fix whitespace error 2012-08-06 19:35:46 +02:00
Tuncer Ayaz
491d52298e Re-use rebar_utils:ebin_dir() 2012-08-06 19:00:18 +02:00
Tuncer Ayaz
e2492eb37f rebar_utils: call get_cwd/1 locally 2012-08-06 19:00:03 +02:00
Tuncer Ayaz
870f8cfbb4 rebar_utils: clean up specs 2012-08-06 18:52:33 +02:00
Tuncer Ayaz
70c82ba1c1 Fix arg order in rebar_erlc_compiler:compile_mib/3 2012-08-06 17:44:13 +02:00
Tuncer Ayaz
0b18b208e2 Only print absolute filename if not in base_dir 2012-08-05 19:56:27 +02:00
Tuncer Ayaz
4f19572ff9 Remove two comments 2012-08-04 14:04:59 +02:00
Tuncer Ayaz
392adcf967 Refactor setup_env rebar_config funs 2012-08-04 14:04:27 +02:00
Tuncer Ayaz
c9ddb8325a Quote EUnit User's guide about _tests.beam handling 2012-07-31 16:39:25 +02:00
Tuncer Ayaz
ad2e94b96b Add experimental notice to test-compile and shell 2012-07-31 15:39:36 +02:00
Tuncer Ayaz
636c02f0be Fix R13B03 build (Reported-by: Sergey Nartimov) 2012-07-28 19:51:57 +02:00
Joseph Wayne Norton
2d62896de0 Fix -D handling 2012-07-28 19:36:46 +02:00
Tuncer Ayaz
74a82fa104 Fix -c typo (Noticed-by: Joe Norton) 2012-07-28 11:48:54 +02:00
Tuncer Ayaz
64972a0be5 Fix trivial comment typo 2012-07-26 18:36:59 +02:00
Tuncer Ayaz
228f39efa1 Rename old eunit compile options for consistency with test-compile 2012-07-26 17:15:01 +02:00
Steven Gravell
093f160be5 relative libs in RELEASES file 2012-07-26 13:40:36 +02:00
Daniel Luna
d496be2871 rebar_rel_utils: remove two lines of noop 2012-07-24 20:34:02 +02:00
Tuncer Ayaz
70d27c5720 rebar_deps: use xconf for deps_dir 2012-07-23 20:53:43 +02:00
Tuncer Ayaz
f6cfc74dc0 Fix indenting 2012-07-23 20:41:22 +02:00
Tuncer Ayaz
c648af3697 Finalize port_compiler deprecations 2012-07-23 20:41:22 +02:00
Tuncer Ayaz
c0644dc195 Finalize app=, skip_app=, suite= deprecations 2012-07-23 16:48:15 +02:00
Tuncer Ayaz
e75a97ad33 Add 'qc' cmd and rename eunit-compile to test-compile 2012-07-23 16:22:06 +02:00
Tuncer Ayaz
902dcdf3ff Add 'eunit-compile' cmd (Suggested-by: Joe Norton) 2012-07-23 13:28:38 +02:00
Tuncer Ayaz
252757c753 Do not use application:set_env 2012-07-23 13:17:11 +02:00
Tuncer Ayaz
3c56fbab6f Restore old reltool vsn check
reltool is missing an app resource file before R14A.
Therefore, restore the old check and add TODO.
2012-07-22 12:41:55 +02:00
Tuncer Ayaz
86c69bc253 Fix Dialyzer warning 2012-07-21 17:56:53 +02:00
Ulf Wiger
6996cd4fcc Use a more appropriate method to check reltool's vsn
If running e.g. rebar generate using an OTP development build,
rebar will complain that reltool has the version "", which is
less than the required "0.5.2". This is because rebar_reltool
simply checks the path returned by code:which(reltool), which
doesn't yield version information if used in a development build.

This patch substitutes a more robust method (load reltool and
fetch the info from application:loaded_applications()).

As it happens, this will not be enough to make things work,
but now Reltool will explain that it cannot generate a spec
from a system that is not installed, giving a better hint
as to what needs to be done.
2012-07-21 17:52:01 +02:00
Tuncer Ayaz
5a4ddd5524 Do not keep eunit config 2012-07-13 22:48:20 +02:00
Tuncer Ayaz
e1c9d69d1d Do not use rebar_config:set_global in rebar_templater 2012-07-13 21:43:30 +02:00
Tuncer Ayaz
d9e6cc3d90 Do not use process dict in rebar_templater 2012-07-13 21:43:14 +02:00
Tuncer Ayaz
4fe3306d99 Document rebar_config TODOs 2012-07-13 15:22:01 +02:00
Tuncer Ayaz
db78956295 Make sure cached setup_envs are reset 2012-07-13 15:22:01 +02:00
Tuncer Ayaz
e185e86bff Remove shared state 2012-07-13 15:21:56 +02:00
Tuncer Ayaz
1948eb4a47 Re-word comment 2012-07-12 00:39:30 +02:00
Tuncer Ayaz
94958d05d5 Add missing comment in rebar_erlc_compiler 2012-07-12 00:37:10 +02:00
Tuncer Ayaz
e4fb80799b Remove debug log 2012-07-11 23:40:28 +02:00
Tuncer Ayaz
015858b2d3 Simplify eunit 2012-07-11 20:36:41 +02:00
Tuncer Ayaz
990e60f120 Use filename:join 2012-07-11 18:44:48 +02:00
Dave Smith
ce39b1d8bd Merge pull request #157 from dch/dch-windows-msvc-support
add native Windows compiler support
2012-07-11 07:58:51 -07:00
Kresten Krab Thorup
4541f8f5db Fix crazy indentation :-) 2012-07-11 08:42:48 -06:00
Kresten Krab Thorup
b890421cae Allow crypto to already be loaded when starting rebar 2012-07-11 08:42:48 -06:00
Kresten Krab Thorup
c71bbf6a0d untabify and add some comments 2012-07-11 08:42:48 -06:00
Kresten Krab Thorup
5b765e028f Initial version of "rebar shell" command
For now, this is just a proof of concept; would make sense to add a lot
of things, such as quick access to invoking rebar itself (with approproate 
code reloading), as well as an eunit-aware version so that tests could be 
run interactively.
2012-07-11 08:42:47 -06:00
Fred Hebert
57fc7f6474 Change escriptize archive permissions to a+x
By default, executables in paths such as /bin and /usr/local/bin have
the mode saying they can be executed by all.

The current version of escriptize only sets u+x, which creates problems
when copied directly in repositories and requiring other programs to
interact with them.

This change makes rebar follow the standard of linuxes and unixes by
setting the permission flag to a+x, allowing users, the group and others
to execute it.
2012-07-10 10:42:41 +02:00
Eric B Merritt
ec3927f9b0 Fix eunit testing of apps that have no erl files
'Erlang' projects that do not contain any erlang files (Joxa, LFE,
Elixir, etc) break the eunit task. It attempts to copy an empty list
of source files to the .eunit directory. This change makes copying an
empty list a simple no-op.
2012-07-03 15:18:09 +02:00
Tuncer Ayaz
f5af9d6c21 Fix rebar_eunit whitespace issues 2012-07-02 19:23:25 +02:00
Tuncer Ayaz
9521d3fd86 Clean up rebar_utils exports 2012-07-02 19:13:11 +02:00
Tuncer Ayaz
df9b77633a Move erl_opts/1 and src_dirs/1 to proper place 2012-07-02 18:47:06 +02:00
Motiejus Jakštys
ad2f30ccb9 Fix cover crash if src_dirs is not default
Make sure files from erl_opts->src_dirs are copied to .eunit for cover
inspection.

Without this patch cover failed to find source files which were in
src_dirs, and threw the following exception:

ERROR: eunit failed while processing
/path/to/project:
{'EXIT',{{badmatch,{error,no_source_code_found}},
         [{rebar_eunit,'-cover_analyze/3-fun-0-',1,
                       [{file,"src/rebar_eunit.erl"},{line,280}]},
          {lists,foreach,2,[{file,"lists.erl"},{line,1262}]},
          {rebar_eunit,cover_analyze,3,
                       [{file,"src/rebar_eunit.erl"},{line,279}]},
          {rebar_eunit,eunit,2,[{file,"src/rebar_eunit.erl"},{line,140}]},
          {rebar_core,run_modules,4,[{file,"src/rebar_core.erl"},{line,425}]},
          {rebar_core,execute,5,[{file,"src/rebar_core.erl"},{line,359}]},
          {rebar_core,process_dir0,6,[{file,"src/rebar_core.erl"},{line,223}]},
          {rebar_core,process_dir,4,
                      [{file,"src/rebar_core.erl"},{line,130}]}]}}

Now all source files are copied to .eunit.
2012-07-02 18:46:00 +02:00
Motiejus Jakštys
394c0f43f8 Move erl_opts/1 and src_dirs/1 to rebar_utils.erl
These functions will be necessary in rebar_eunit.erl, too.
2012-07-02 18:46:00 +02:00
Tuncer Ayaz
fd0697239d Use lists:foreach because result is ignored 2012-06-30 23:17:22 +02:00
Tuncer Ayaz
385e3f09ba Decrease indentation in list-templates printout 2012-06-30 22:28:30 +02:00
Tuncer Ayaz
49f3cc4108 Fix crash introduced in 4414f65 via pull/245 2012-06-30 22:14:08 +02:00
Tuncer Ayaz
0c27fd4f7f rebar_templater: fix comment 2012-06-30 22:13:26 +02:00
Daniel Luna
d560ccda0d Use ~p for file:consult/1 {error, Reason} printout 2012-06-29 21:39:20 +02:00
Tuncer Ayaz
4e9e89bd0d Append os family to arch string 2012-06-23 22:05:43 +02:00
Tuncer Ayaz
c41fda6a2f rebar_utils: move internal fun to proper place 2012-06-23 22:00:38 +02:00
Evan Vigil-McClanahan
a78e6cd740 Add support for minimum OTP versions.
Since you can't really do math with regexps and it's a pain to
repeatedly update the config for each new version or erlang, I wanted
to add support for minium OTP versions.  This is a fix for
https://github.com/basho/riaknostic/issues/38
2012-06-21 14:44:51 -07:00
Tuncer Ayaz
4fc3e9bfb6 Add missing comment 2012-06-21 23:01:32 +02:00
Tuncer Ayaz
8bb62032a0 Update -c string 2012-06-21 21:28:34 +02:00
Tuncer Ayaz
e6165c7146 Fix #252 (Reported-by: Maxim-Vladimirsky) 2012-06-21 00:08:51 +02:00
Tuncer Ayaz
b9c6888883 rebar_ct: rename function for clarity 2012-06-21 00:06:40 +02:00
Yurin Slava
7bef458163 Add support for errors without line number 2012-06-18 12:09:58 +02:00
Tuncer Ayaz
3dce05314b Fix rebar_eunit comments 2012-06-18 00:55:51 +02:00
Tuncer Ayaz
c91250d2df Use [{File,Bin}, ...] in escriptize zip:create 2012-06-17 23:03:29 +02:00
Tuncer Ayaz
83879c22e1 Add missing escriptize comments 2012-06-17 22:57:33 +02:00
Tuncer Ayaz
0f961d86c6 Fix #247 (Reported-by: Uvarov Michael) 2012-06-17 16:11:59 +02:00
Tuncer Ayaz
d7037165fd Remove debug log 2012-06-15 19:42:11 +02:00
Tuncer Ayaz
e65455b6ef Simplify temp dir creation 2012-06-14 23:59:36 +02:00
Tuncer Ayaz
1e980859e2 Extend escriptize and reuse in bootstrap 2012-06-14 23:46:55 +02:00
Tuncer Ayaz
8fb552b73f Sync rebar_escripter with bootstrap escript 2012-06-14 23:46:55 +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
c3fc279ff9 Manually format lfe errors/warnings 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
4e64e0c675 Manually format port_compiler errors with absolute path 2012-06-11 19:40:59 +02:00
Tuncer Ayaz
4b9fcda7ab Manually format leex/yecc errors/warnings 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
Tuncer Ayaz
8d81b322ed Fix whitespace errors 2012-06-11 19:33:16 +02:00
hirschen
4414f6548a List substitution variable names in 'list-templates' command. 2012-06-11 15:01:12 +02:00
Tuncer Ayaz
b1d06a4d14 Fix unsafe use of var 2012-06-08 22:14:32 +02:00