diff options
-rw-r--r-- | core/compat.mk | 8 | ||||
-rw-r--r-- | doc/src/guide/external_plugins_list.asciidoc | 6 | ||||
-rw-r--r-- | index/bitcask.mk | 2 | ||||
-rw-r--r-- | index/geode.mk | 7 | ||||
-rw-r--r-- | index/kafka_protocol.mk | 7 | ||||
-rw-r--r-- | plugins/bootstrap.mk | 4 | ||||
-rw-r--r-- | test/core_compat.mk | 37 |
7 files changed, 64 insertions, 7 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/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 4aa1052..339ef27 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/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)" |