Commit graph

139 commits

Author SHA1 Message Date
Jared Morrow
988c9cd574 Merge pull request #155 from tuncer/fixes
Fixes for #137 and #142
2013-11-26 06:18:30 -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
Tuncer Ayaz
348d13b064 'current_command' has to be stored in xconf 2013-10-16 12:29:54 +02:00
Andrew Thompson
e74de95eeb Address review comments and add inttest for update-deps 2013-09-30 16:57:50 -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
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
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
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
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
c77f8e13ca Fix missing call to cwd_predirs 2013-03-02 08:25:28 -07: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
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
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
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
0b18b208e2 Only print absolute filename if not in base_dir 2012-08-05 19:56:27 +02:00
Tuncer Ayaz
392adcf967 Refactor setup_env rebar_config funs 2012-08-04 14:04:27 +02:00
Tuncer Ayaz
636c02f0be Fix R13B03 build (Reported-by: Sergey Nartimov) 2012-07-28 19:51:57 +02:00
Tuncer Ayaz
252757c753 Do not use application:set_env 2012-07-23 13:17:11 +02:00
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
50fbabda68 Manually report errors/warnings with absolute path 2012-06-11 19:40:59 +02:00
Tuncer Ayaz
8a046d898a Fix whitespace errors 2012-06-08 21:56:18 +02:00
Dave Smith
a7d64deb43 Introduce -k flag 2012-06-08 07:06:15 -06:00
Dave Smith
c86c99940d Remove ?FAIL in favor of ?ABORT 2012-06-08 07:06:15 -06:00
Tuncer Ayaz
15d1c275f8 Simplify and fix check if enter/leaving should be printed 2012-05-18 20:14:33 +02:00
Tuncer Ayaz
4f6ea2fd11 Do not print entering/leaving message if skip_dir 2012-05-18 19:56:02 +02:00
Tuncer Ayaz
7c418ed2b4 Add support for target-specific port options
{port_specs, [{".*", "priv/foo.so", ["c_src/foo.c"], [{env, []}]}]}.
2012-04-16 23:17:24 +02:00
Tuncer Ayaz
0e7defaf64 Fix typo in comment (thanks Michael Santos) 2012-04-16 17:42:48 +02:00
Tuncer Ayaz
4a9dae76a4 Fix #197 by printing 'Entering/Leaving directory' 2012-04-03 20:54:34 +02:00
Tuncer Ayaz
7bd8cbd8d9 Make error message more descriptive 2012-03-31 19:21:41 +02:00
Tuncer Ayaz
b7fb2aeec6 Fix loading of local plugins in sub directories 2012-02-03 17:37:41 +01:00
Yurii Rashkovskii
fe1652e137 Cache vsn info to avoid expensive vcs cmd calls 2012-02-02 21:54:15 +01:00
Tuncer Ayaz
5b15c851d8 Check for .app.src first 2012-01-13 19:39:28 +01:00
Tuncer Ayaz
eab5ae5298 Fix code clarity in dir type check 2012-01-13 19:00:44 +01:00
Tuncer Ayaz
7c327c1195 Fix rebar_core crash (reported-by: Jeremy Raymond) 2011-12-18 13:29:58 +01:00
Tuncer Ayaz
8c89a388bf Universally support apps=/skip_apps= 2011-12-12 21:20:34 +01:00
Tuncer Ayaz
8de2c84d89 Add support for arch-specific hooks
{pre_hooks,  [{"linux", compile, "c_src/build_linux.sh"}]}.
{post_hooks, [{"linux", compile, "c_src/build_linux.sh clean"}]}.
2011-12-05 14:17:18 +01:00
Tim Watson
86325b616d Allow plugins to participate in pre and post processing
This patch modifies rebar_core to allow plugins to participate in the
pre and post processing steps, giving plugin authors more flexibility
and control.
2011-10-20 16:31:08 +02:00
Tim Watson
30d1cdb31b Fix config handling in root_dir
Avoid overwriting custom config (passed with -C) when we are processing
the base_dir in rebar_core.
2011-10-05 13:49:27 +02:00
Tim Watson
36a40d3351 Fix missing plugin warnings
This patch fixes the warning logging when the number of missing plugins
is greater than one. The current code only works by accident, when a
single plugin is all that is missing.
2011-09-20 13:15:03 +02:00
Tuncer Ayaz
93128f2f6b Search plugin sources in base_dir and plugin_dir 2011-08-29 17:27:45 +02:00
Tuncer Ayaz
00b3d9d3cc Only compile relevant plugin sources 2011-08-29 17:27:45 +02:00
Tuncer Ayaz
4fe651cb5b Simplify check for empty list 2011-08-29 17:27:45 +02:00
Tim Watson
3b58935b86 Load plugins dynamically from source
This patch updates rebar_core to look for missing plugins (i.e. those
that aren't found on the code path at runtime) in a configurable
plugin directory, and dynamically compile and load them at runtime.

By default, the directory "plugins" is searched, although this can be
overriden by setting the plugin_dir in your rebar.config.
2011-08-29 17:27:45 +02:00
Tuncer Ayaz
1dcf0d15dc Log a more descriptive message 2011-08-23 18:54:05 +02:00