Commit graph

1071 commits

Author SHA1 Message Date
Mark Anderson
e211afdce6 Change env var delimiter to match non-word
If I pass an expression like: "$PWD/deps/local/lib" in the port env
string, it expands to "/deps/local/lib", (variable is expanded to the
empty string) but if I pass "${PWD}/deps/local/lib" it expands
properly. I found that confusing.

This was because we require environment vars to end with whitespace,
while I think requiring a non-word character would be sufficient, since
the variables can only contain word characters.

This changes the expansion system to recognize variables that are
terminated by non word characters.

This includes some fixes as per some comments by tuncer.

Fixes rebar/rebar#457
2015-02-23 19:11:51 -08:00
Fred Hebert
7f73b8d365 Merge pull request #449 from lrascao/feature/support_appup_src_files
Support .appup.src files
2015-02-05 08:12:43 -05:00
Luis Rascao
53fbb7cf8e Support .appup.src[.script] files
Similar to how .app.src are being handled, all files in directory
.src ending with .appup.src are processed, checked for
correctness and copied to ebin without the .src extension.

By way of using rebar_config:consult_file/1, .appup.src.script
files are automatically supported in exactly the same manner
as in .app.src.script.
2015-02-04 22:33:16 +00:00
Pavel Baturko
703a9dae9e deps: fix delete-deps if deps_dir ends with dot
Remove possible last dot from deps dir path by calling
dirname on base_dir, deps_dir and dummy path part.
With this fix delete-deps command deletes dependencies
properly in case of deps dir path ended with dot.
Examples of deps_dir config value that triggers error:
".", "some/path/.".
Code that triggers error: rebar_deps:'delete-deps'/2,
code line lists:prefix(DepsDir, D#dep.dir).
If deps_dir = ".", cwd = "/root", dependency name = "app"
then DepsDir = "/root/." and D#dep.dir = "/root/app" so
prefix fun returns false but should be true.
Dependency app will not be removed because of this.
2015-02-03 23:21:46 +03:00
Fred Hebert
c051530b3c Merge pull request #445 from norton/norton-erlc-order
rebar doesn't respect the order of erl_first_files given in the rebar.conf file
2015-02-02 11:06:12 -05:00
Fred Hebert
7811c1f335 Merge pull request #447 from lrascao/feature/support_custom_proto_dir
Support custom protobuf directory
2015-02-02 11:05:47 -05:00
Luis Rascao
bf2b3e2468 Support custom protobuf directory
proto_opts config option contains the compiler directive
that defines which proto compiler to use, also contains a
src_dirs entry that defines a list of locations for the
.proto files to be processed.

Add integration test that compiles .proto files from src
and from proto directory specified in separate rebar
config files
2015-01-31 19:47:59 +00:00
Fred Hebert
fffc745e11 Merge pull request #305 from liskin/linux-multiarch-64
Fix compiler invocation on multiarch Linux
2015-01-30 11:35:13 -05:00
Tuncer Ayaz
59d1d0c34d Fix incorrect "not an app dir" warning 2015-01-27 12:08:59 +01:00
Slava Yurin
d7657ba732 Keep order for erl_first_files 2015-01-26 20:41:38 -06:00
Fred Hebert
b488179030 Merge pull request #424 from tomas-abrahamsson/gpb-recompilation-detection-2
Gpb recompilation detection (using base compiler)
2015-01-26 18:54:19 -05:00
Tomas Abrahamsson
1ce7059adb 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).

Use the rebar_base_compiler's ability to specify both source and
target file names, to be able to also support prefixes.

This also introduces a call to gpb_compile:format_error, so the xref
recipe needs to be updated to ignore it, to avoid false errors.
2015-01-24 22:11:04 +01:00
Tomas Abrahamsson
2e9706fd61 Make the base compiler accept target file names
The rebar_base_compiler:run/5 is an alternative to run/8, where
instead of source/target dirs and file name extensions, it takes
a list of tuples: [{SourceFileName, TargetFileName}], after the
idea by Tuncer Ayaz in discussion with Luis Rascão and me.

This is useful for situations where the target file name cannot be
expressed as only a new suffix or extension.  For example the gpb
protocol buffer compiler can take an option to add a file name prefix
as well as a suffix.

As a result, the values passed around inside the internal functions in
rebar_base_compiler are either source file names (eg. when the run/4
function has been called), or items, which are two-tuples
{SourceFileName,TargetFileName} (when the run/7,8 or /5 functions have
been called).
2015-01-24 22:11:04 +01:00
Tomas Abrahamsson
135e629bc0 Use rebar_utils:find_files_by_ext/2,3 2015-01-24 22:11:04 +01:00
Tomas Abrahamsson
a04530124f Add rebar_utils:find_files_by_ext/2,3
This finds files by extension, avoiding resource fork files
in Mac OS X.
2015-01-24 22:11:04 +01:00
Vlad Dumitrescu
5f0ab0268e Fix .app.src.script bug introduced in b44b4f4
Handle the case when both .app.src and .app.src.script exist;
the script takes precedence.
2015-01-20 17:09:11 +01:00
Tuncer Ayaz
1d20be707f Document recursive_cmds in -r help string as well
{recursive_cmds, []} was already documented as part of the core
rebar.config options that gets printed via 'rebar -h', but this wasn't
sufficiently informative.  To fix this, explain the use of
recursive_cmds as part of the -r help string.

Reported-by: Stefan Strigler
2015-01-14 20:23:05 +01:00
Tuncer Ayaz
838776326b Fix #415 (reltool vsn check)
* Refactor reltool version check to use vsn app key if ebin/reltool.app
  exists.

  OTP releases prior to R14 didn't install the app file, so we still
  have to support getting the version string from the lib_dir path. If
  you're using an R13B03 or R13B04 install that doesn't have version
  strings in lib_dir paths (lib/reltool vs lib/reltool-0.5.3), we won't
  be able to retrieve the version string. Given R13's age and that it's
  unusual to have vsn-less lib_dir paths, this shouldn't be a problem.

* While at it, delete trailing white space.
2014-12-30 21:38:41 +01:00
Fred Hebert
b8e0018782 Merge pull request #413 from tomas-abrahamsson/undo-386-merge
Revert "Merge pull request #386 ... gpb-recompilation...detection"
2014-12-30 13:27:02 -05:00
Tomas Abrahamsson
a7b7205d07 Revert "Merge pull request #386 from tomas-abrahamsson/gpb-recompilation-detection"
This reverts commit 81063d33f0, reversing
changes made to 6584defdda.

This was reverted because it changed the gpb compiler to
not use rebar_base_compiler.  That change was to add support for
target name prefixes, but it is better to add that support to
rebar_base_compiler.
2014-12-23 16:28:23 +01:00
Igor Savchuk
d5d691d7f7 Fix app.config argument passing when using ct_run (take 2)
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-12-22 21:36:41 +03:00
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