Skip to content

Commit

Permalink
Fix reltool config handling during execution hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperthunk committed Aug 1, 2011
1 parent f97e36a commit 6e437d1
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 16 deletions.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/make -f
# Makefile wrapper

all: clean-build

build:
@(./rebar compile)

clean:
@(./rebar clean)

clean-build: clean build

test: test-deps
@(./rebar -C test.config retest -v)

test-deps:
@(./rebar -C test.config get-deps compile-deps)

.PHONY: all build clean clean-build test
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Then you will be able to fetch and install the plugin (locally) with rebar:
user@host$ rebar get-deps compile
user@host$ rebar dist skip_deps=true

Alternatively, you may put the plugin into your `ERL_LIBS` path somewhere and
Alternatively, you may put the plugin into your `ERL_LIBS` path somewhere and
use it in many projects. This can be done manually, or using a package manager:

user@host$ epm install hyperthunk/rebar-dist-plugin # or
Expand All @@ -46,3 +46,10 @@ You execute the plugin like any other rebar command:

rebar clean generate # if you're hooked into a release
rebar distclean dist # if you wish to explicitly assemble a distribution

## Running the tests

The project ships with a `Makefile` wrapper that will execute a bunch of tests
against the examples directory using the [rebar_retest_plugin](https://github.com/hyperthunk/rebar_retest_plugin). As this
configuration has separate dependencies (for test only), the simplest way to run
these is to execute `make test` on the command line.
Binary file added rebar
Binary file not shown.
15 changes: 1 addition & 14 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@

{deps, [
{rebar_retest_plugin, ".*"}
]}.

{erl_opts, [{outdir, "ebin"},
debug_info,
warnings_as_errors]}.

%% ReTest config
{rebar_plugins, [rebar_retest_plugin]}.
{retest_testdir, "inttest"}.
{retest_verbose, true}.
{retest_loglevel, debug}.

{erl_opts, [warnings_as_errors]}.
3 changes: 2 additions & 1 deletion src/rebar_dist_plugin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ release_vsn(Dir) ->
File = filename:join(Dir, "reltool.config"),
case filelib:is_regular(File) of
true ->
rebar_rel_utils:get_reltool_release_info(File);
{ok, Config} = file:consult(File),
rebar_rel_utils:get_reltool_release_info(Config);
_ ->
""
end.
Expand Down
17 changes: 17 additions & 0 deletions test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

{deps, [
{retest, ".*",
{git, "https://github.com/hyperthunk/retest.git", "master"}},
{rebar_retest_plugin, ".*",
{git, "https://github.com/hyperthunk/rebar_retest_plugin.git", "master"}}
]}.

{erl_opts, [{outdir, "ebin"},
debug_info,
warnings_as_errors]}.

%% ReTest config
{rebar_plugins, [rebar_retest_plugin]}.
{retest_testdir, "inttest"}.
{retest_verbose, true}.
{retest_loglevel, debug}.

0 comments on commit 6e437d1

Please sign in to comment.