Permalink
Browse files

Partial rebar-ification. Use rebar to get effigy, build gen_bunny, an…

…d run tests. Move tests to test/*_tests.erl because the src files were getting a little long.

--HG--
rename : src/example_gb.erl => docs/examples/example_gb.erl
  • Loading branch information...
1 parent c1ed319 commit eb2d94487ad59898c3f925b4027ce3fcd88f6bd1 @dreid dreid committed Mar 11, 2010
View
@@ -3,11 +3,6 @@ syntax regex
(^|/)\.hg($|/)
(^|/)\.hgtags($|/)
(^|/)\.DS_Store
-doc/.*(html|css|info|png)$
-www/edoc/*
-www/README
-www/LICENSE
-www/TODO
ebin/.*\.(beam|app)$
(^|/)erl_crash.dump$
.*~$
@@ -17,52 +12,6 @@ priv/rabbit-mnesia/*
deps/.*/*.beam
priv/log/rabbit/*
.*\.pyc
-deps/rabbitmq-erlang-client/rabbitmq_server
-deps/rabbitmq-server/include/rabbit_framing.hrl
-deps/rabbitmq-server/src/rabbit_framing.erl
-deps/rabbitmq-server/codegen/amqp_codegen.pyc
-test\.log
-^test/.*
-deps/effigy/Makefile
-deps/effigy/Makefile.am
-deps/effigy/Makefile.in
-deps/effigy/Makefile.otp
-deps/effigy/ac-init.generated
-deps/effigy/aclocal.m4
-deps/effigy/autom4te.cache/output.0
-deps/effigy/autom4te.cache/output.1
-deps/effigy/autom4te.cache/requests
-deps/effigy/autom4te.cache/traces.0
-deps/effigy/autom4te.cache/traces.1
-deps/effigy/build
-deps/effigy/config.log
-deps/effigy/config.status
-deps/effigy/configure
-deps/effigy/configure.ac
-deps/effigy/create-package
-deps/effigy/doc/.run_edoc
-deps/effigy/doc/Makefile
-deps/effigy/doc/Makefile.am
-deps/effigy/doc/Makefile.in
-deps/effigy/fw-pkgin/.post-install.script_ok
-deps/effigy/fw-pkgin/.post-remove.script_ok
-deps/effigy/fw-pkgin/.pre-install.script_ok
-deps/effigy/fw-pkgin/.pre-remove.script_ok
-deps/effigy/fw-pkgin/.start.script_ok
-deps/effigy/fw-pkgin/.stop.script_ok
-deps/effigy/fw-pkgin/Makefile
-deps/effigy/fw-pkgin/Makefile.am
-deps/effigy/fw-pkgin/Makefile.in
-deps/effigy/fw/share
-deps/effigy/install-sh
-deps/effigy/missing
-deps/effigy/src/Makefile
-deps/effigy/src/Makefile.am
-deps/effigy/src/Makefile.in
-deps/effigy/src/effigy.app
-deps/effigy/src/fw-erl-app-template.app
-deps/effigy/src/fw-erl-app-template.app.in
-deps/effigy/tests/Makefile
-deps/effigy/tests/Makefile.am
-deps/effigy/tests/Makefile.in
-deps/effigy/tests/otp-test-wrapper.sh
+deps/*
+logs/*
+.eunit/*
View
@@ -1,15 +1,12 @@
ERL ?= erl
EBIN_DIRS := deps/effigy/ebin deps/rabbitmq-erlang-client/dist/*/ebin
APP := gen_bunny
+REBAR := ./rebar
-all: rabbitmq-server rabbitmq-erlang-client effigy erl
+all: rabbitmq-server rabbitmq-erlang-client erl
-erl: ebin/$(APP).app src/$(APP).app.src
- @$(ERL) -pa ebin -pa $(EBIN_DIRS) -noinput +B \
- -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
-
-deps/effigy:
- hg clone http://bitbucket.org/dreid/effigy/ deps/effigy
+erl:
+ @$(REBAR) compile
deps/rabbitmq-server:
hg clone -r rabbitmq_v1_7_2 http://hg.rabbitmq.com/rabbitmq-server deps/rabbitmq-server
@@ -26,22 +23,18 @@ rabbitmq-server: deps/rabbitmq-codegen deps/rabbitmq-server
rabbitmq-erlang-client: deps/rabbitmq-erlang-client
@(cd deps/rabbitmq-erlang-client;$(MAKE) BROKER_DIR=../rabbitmq-server)
-effigy: deps/effigy
- @(cd deps/effigy;./rebar compile)
-
-docs:
- @erl -noshell -run edoc_run application '$(APP)' '"."' '[]'
-
-test: erl
- @support/bin/run_tests.escript ebin | tee test/test.log
+test: all
+ @$(REBAR) eunit
clean:
@echo "removing:"
- @rm -fv ebin/*.beam ebin/*.app
+ @$(REBAR) clean
+ (cd deps/rabbitmq-server;$(MAKE) clean)
+ (cd deps/rabbitmq-erlang-client;$(MAKE) clean)
+
+distclean:
+ $(REBAR) distclean
+ @rm -rvf deps/*
dialyzer: erl
@dialyzer -Wno_match -Wno_return -c ebin/ | tee test/dialyzer.log
-
-ebin/$(APP).app: src/$(APP).app.src
- @echo "generating ebin/gen_bunny.app"
- @bash support/bin/make_appfile.sh >ebin/gen_bunny.app
File renamed without changes.
View
@@ -1,7 +1,7 @@
-ifndef(GEN_BUNNY_HRL_PREFIX).
-define(GEN_BUNNY_HRL_PREFIX, true).
--include_lib("amqp_client.hrl").
+-include_lib("amqp_client/include/amqp_client.hrl").
-define(is_queue(X), element(1, X) =:= 'queue.declare').
-define(is_exchange(X), element(1, X) =:= 'exchange.declare').
@@ -26,4 +26,21 @@
-type(binding() :: #binding{}).
-type(durable_obj() :: exchange() | bunny_queue()).
+%% Process state
+-record(gen_bunny_state, {declare_fun,
+ connect_fun,
+ mod,
+ modstate,
+ channel,
+ connection,
+ queue,
+ connection_info,
+ declare_info,
+ consumer_tag,
+ no_ack,
+ channel_mon,
+ connection_mon}).
+
+-record(bunnyc_state, {connection, channel, exchange, queue, key}).
+
-endif. %% GEN_BUNNY_HRL_PREIFX
View
BIN rebar
Binary file not shown.
View
@@ -0,0 +1,4 @@
+% -*- mode: erlang -*-
+{deps, [{effigy, ".*",
+ {hg, "http://bitbucket.org/dreid/effigy/", "tip"}}]}.
+{lib_dirs, [".", "deps/rabbitmq-erlang-client/dist"]}.
Oops, something went wrong.

0 comments on commit eb2d944

Please sign in to comment.