aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/compat.mk8
-rw-r--r--core/erlc.mk2
-rw-r--r--doc/src/guide/external_plugins_list.asciidoc6
-rw-r--r--index/bitcask.mk2
-rw-r--r--index/geode.mk7
-rw-r--r--index/kafka_protocol.mk7
-rw-r--r--plugins/bootstrap.mk4
-rw-r--r--plugins/ct.mk4
-rw-r--r--plugins/escript.mk4
-rw-r--r--test/core_compat.mk37
-rw-r--r--test/plugin_ct.mk13
11 files changed, 80 insertions, 14 deletions
diff --git a/core/compat.mk b/core/compat.mk
index c7faf9b..239bc1c 100644
--- a/core/compat.mk
+++ b/core/compat.mk
@@ -19,8 +19,12 @@ define compat_erlc_opts_to_list
endef
define compat_rebar_config
-{deps, [$(call comma_list,$(foreach d,$(DEPS),\
- {$(call dep_name,$d),".*",{git,"$(call dep_repo,$d)","$(call dep_commit,$d)"}}))]}.
+{deps, [
+$(call comma_list,$(foreach d,$(DEPS),\
+ $(if $(filter hex,$(call dep_fetch,$d)),\
+ {$(call dep_name,$d)$(comma)"$(call dep_repo,$d)"},\
+ {$(call dep_name,$d)$(comma)".*"$(comma){git,"$(call dep_repo,$d)"$(comma)"$(call dep_commit,$d)"}})))
+]}.
{erl_opts, $(call compat_erlc_opts_to_list,$(ERLC_OPTS))}.
endef
diff --git a/core/erlc.mk b/core/erlc.mk
index 2297047..dc98bb3 100644
--- a/core/erlc.mk
+++ b/core/erlc.mk
@@ -244,7 +244,7 @@ ifeq ($(wildcard src/$(PROJECT).app.src),)
$(app_verbose) printf "$(subst $(newline),\n,$(subst ",\",$(call app_file,$(GITDESCRIBE),$(MODULES))))" \
> ebin/$(PROJECT).app
else
- $(verbose) if [ -z "$$(grep -E '^[^%]*{\s*modules\s*,' src/$(PROJECT).app.src)" ]; then \
+ $(verbose) if [ -z "$$(grep -e '^[^%]*{\s*modules\s*,' src/$(PROJECT).app.src)" ]; then \
echo "Empty modules entry not found in $(PROJECT).app.src. Please consult the erlang.mk README for instructions." >&2; \
exit 1; \
fi
diff --git a/doc/src/guide/external_plugins_list.asciidoc b/doc/src/guide/external_plugins_list.asciidoc
index 7e79757..f30797f 100644
--- a/doc/src/guide/external_plugins_list.asciidoc
+++ b/doc/src/guide/external_plugins_list.asciidoc
@@ -37,6 +37,12 @@ An https://github.com/ninenines/lfe.mk[LFE plugin] for Erlang.mk.
LFE, or http://lfe.io/[Lisp Flavoured Erlang], is an alternative
language for the BEAM.
+=== mix.mk
+
+A https://github.com/botsunit/mix.mk[Mix plugin] for Erlang.mk,
+to generate a compatible configuration file for
+http://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html[Mix].
+
=== reload.mk
A https://github.com/bullno1/reload.mk[live reload plugin] for Erlang.mk.
diff --git a/index/bitcask.mk b/index/bitcask.mk
index 2bc7af8..31930f3 100644
--- a/index/bitcask.mk
+++ b/index/bitcask.mk
@@ -4,4 +4,4 @@ pkg_bitcask_description = because you need another a key/value storage engine
pkg_bitcask_homepage = https://github.com/basho/bitcask
pkg_bitcask_fetch = git
pkg_bitcask_repo = https://github.com/basho/bitcask
-pkg_bitcask_commit = master
+pkg_bitcask_commit = develop
diff --git a/index/geode.mk b/index/geode.mk
new file mode 100644
index 0000000..4eaec34
--- /dev/null
+++ b/index/geode.mk
@@ -0,0 +1,7 @@
+PACKAGES += geode
+pkg_geode_name = geode
+pkg_geode_description = geohash/proximity lookup in pure, uncut erlang.
+pkg_geode_homepage = https://github.com/bradfordw/geode
+pkg_geode_fetch = git
+pkg_geode_repo = https://github.com/bradfordw/geode
+pkg_geode_commit = master
diff --git a/index/kafka_protocol.mk b/index/kafka_protocol.mk
new file mode 100644
index 0000000..8a9fb2f
--- /dev/null
+++ b/index/kafka_protocol.mk
@@ -0,0 +1,7 @@
+PACKAGES += kafka_protocol
+pkg_kafka_protocol_name = kafka_protocol
+pkg_kafka_protocol_description = Kafka protocol Erlang library
+pkg_kafka_protocol_homepage = https://github.com/klarna/kafka_protocol
+pkg_kafka_protocol_fetch = git
+pkg_kafka_protocol_repo = https://github.com/klarna/kafka_protocol.git
+pkg_kafka_protocol_commit = master
diff --git a/plugins/bootstrap.mk b/plugins/bootstrap.mk
index 5ece8f9..d608d28 100644
--- a/plugins/bootstrap.mk
+++ b/plugins/bootstrap.mk
@@ -11,8 +11,8 @@ help::
" bootstrap Generate a skeleton of an OTP application" \
" bootstrap-lib Generate a skeleton of an OTP library" \
" bootstrap-rel Generate the files needed to build a release" \
- " new-app n=NAME Create a new local OTP application NAME" \
- " new-lib n=NAME Create a new local OTP library NAME" \
+ " new-app in=NAME Create a new local OTP application NAME" \
+ " new-lib in=NAME Create a new local OTP library NAME" \
" new t=TPL n=NAME Generate a module NAME based on the template TPL" \
" new t=T n=N in=APP Generate a module NAME based on the template TPL in APP" \
" list-templates List available templates"
diff --git a/plugins/ct.mk b/plugins/ct.mk
index c8f7bf8..4d0c020 100644
--- a/plugins/ct.mk
+++ b/plugins/ct.mk
@@ -31,7 +31,7 @@ help::
CT_RUN = ct_run \
-no_auto_compile \
-noinput \
- -pa $(CURDIR)/ebin $(DEPS_DIR)/*/ebin $(TEST_DIR) \
+ -pa $(CURDIR)/ebin $(DEPS_DIR)/*/ebin $(APPS_DIR)/*/ebin $(TEST_DIR) \
-dir $(TEST_DIR) \
-logdir $(CURDIR)/logs
@@ -51,7 +51,7 @@ endef
$(foreach app,$(ALL_APPS_DIRS),$(eval $(call ct_app_target,$(app))))
-apps-ct: $(addprefix apps-ct-,$(ALL_APPS_DIRS))
+apps-ct: test-build $(addprefix apps-ct-,$(ALL_APPS_DIRS))
endif
ifndef t
diff --git a/plugins/escript.mk b/plugins/escript.mk
index 42133eb..16f8ba6 100644
--- a/plugins/escript.mk
+++ b/plugins/escript.mk
@@ -6,6 +6,8 @@
# Configuration.
ESCRIPT_NAME ?= $(PROJECT)
+ESCRIPT_FILE ?= $(ESCRIPT_NAME)
+
ESCRIPT_COMMENT ?= This is an -*- erlang -*- file
ESCRIPT_BEAMS ?= "ebin/*", "deps/*/ebin/*"
@@ -51,7 +53,7 @@ define ESCRIPT_RAW
' ]),'\
' file:change_mode(Escript, 8#755)'\
'end,'\
-'Ez("$(ESCRIPT_NAME)"),'\
+'Ez("$(ESCRIPT_FILE)"),'\
'halt().'
endef
diff --git a/test/core_compat.mk b/test/core_compat.mk
index d38d4ef..ea994f5 100644
--- a/test/core_compat.mk
+++ b/test/core_compat.mk
@@ -2,10 +2,11 @@
#
# Note: autopatch functionality is covered separately.
-CORE_COMPAT_CASES = auto-rebar rebar rebar-deps rebar-deps-pkg rebar-erlc-opts rebar-pt
+CORE_COMPAT_CASES = auto-rebar rebar rebar-deps-git rebar-deps-hex rebar-deps-pkg rebar-erlc-opts rebar-pt
CORE_COMPAT_TARGETS = $(addprefix core-compat-,$(CORE_COMPAT_CASES))
REBAR_BINARY = https://github.com/rebar/rebar/releases/download/2.6.0/rebar
+REBAR3_BINARY = https://s3.amazonaws.com/rebar3/rebar3
.PHONY: core-compat $(CORE_COMPAT_TARGETS)
@@ -92,7 +93,7 @@ core-compat-rebar: build clean
$i "Use rebar to build the application"
$t cd $(APP) && ./rebar compile $v
-core-compat-rebar-deps: build clean
+core-compat-rebar-deps-git: build clean
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/
@@ -124,6 +125,38 @@ core-compat-rebar-deps: build clean
$i "Use rebar to build the application"
$t cd $(APP) && ./rebar get-deps compile $v
+core-compat-rebar-deps-hex: build clean
+
+ $i "Bootstrap a new OTP library named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
+
+ $i "Add Cowboy as a dependency"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = hex 1.0.0\n"}' $(APP)/Makefile
+
+ $i "Run 'make rebar.config'"
+ $t $(MAKE) -C $(APP) rebar.config $v
+
+ $i "Check that rebar.config was created"
+ $t test -f $(APP)/rebar.config
+
+ $i "Check that Cowboy is listed in rebar.config"
+ $t $(ERL) -eval " \
+ {ok, C} = file:consult(\"$(APP)/rebar.config\"), \
+ {_, [{cowboy, \"1.0.0\"}]} = lists:keyfind(deps, 1, C), \
+ halt()"
+
+ $i "Distclean the application"
+ $t $(MAKE) -C $(APP) distclean $v
+
+ $i "Download rebar3"
+ $t curl -s -L -o $(APP)/rebar3 $(REBAR3_BINARY)
+ $t chmod +x $(APP)/rebar3
+
+ $i "Use rebar to build the application"
+ $t cd $(APP) && ./rebar3 compile $v
+
core-compat-rebar-deps-pkg: build clean
$i "Bootstrap a new OTP library named $(APP)"
diff --git a/test/plugin_ct.mk b/test/plugin_ct.mk
index dd36801..c32fa36 100644
--- a/test/plugin_ct.mk
+++ b/test/plugin_ct.mk
@@ -63,6 +63,12 @@ ct-apps-only: build clean
$i "Create a new library named my_lib"
$t $(MAKE) -C $(APP) new-lib in=my_lib $v
+ $i "Populate my_lib"
+ $t printf "%s\n" \
+ "-module(my_lib)." \
+ "-export([random_int/0])." \
+ "random_int() -> 4." > $(APP)/apps/my_lib/src/my_lib.erl
+
$i "Check that Common Test detects no tests"
$t $(MAKE) -C $(APP) ct | grep -q "Nothing to be done for 'ct'."
@@ -70,9 +76,10 @@ ct-apps-only: build clean
$t mkdir $(APP)/apps/my_app/test
$t printf "%s\n" \
"-module(my_app_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> ok." > $(APP)/apps/my_app/test/my_app_SUITE.erl
+ "-export([all/0, ok/1, call_my_lib/1])." \
+ "all() -> [ok, call_my_lib]." \
+ "ok(_) -> ok." \
+ "call_my_lib(_) -> 4 = my_lib:random_int()." > $(APP)/apps/my_app/test/my_app_SUITE.erl
$i "Generate a Common Test suite in my_lib"
$t mkdir $(APP)/apps/my_lib/test