aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuan Facorro <[email protected]>2014-10-27 12:55:37 -0300
committerJuan Facorro <[email protected]>2014-10-31 10:18:02 -0300
commit73e0b0dd8eabc1151b76cc88bb5af7535a56aa23 (patch)
tree3b65c5876093f391a866e20f2cb2f26f906fdf2c
parentdda03b624fcc288be48c83ba391e21fb5c8d320a (diff)
downloaderlang.mk-73e0b0dd8eabc1151b76cc88bb5af7535a56aa23.tar.gz
erlang.mk-73e0b0dd8eabc1151b76cc88bb5af7535a56aa23.tar.bz2
erlang.mk-73e0b0dd8eabc1151b76cc88bb5af7535a56aa23.zip
[inaka/elvis#96] Elvis plugin.
-rw-r--r--build.config1
-rw-r--r--erlang.mk42
-rw-r--r--plugins/elvis.mk41
3 files changed, 84 insertions, 0 deletions
diff --git a/build.config b/build.config
index 7bc09ff..f608559 100644
--- a/build.config
+++ b/build.config
@@ -13,6 +13,7 @@ plugins/bootstrap
#plugins/c_src
plugins/ct
plugins/dialyzer
+plugins/elvis
plugins/erlydtl
plugins/edoc
plugins/relx
diff --git a/erlang.mk b/erlang.mk
index 4d4d138..b731299 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -652,6 +652,48 @@ dialyze: $(DIALYZER_PLT)
endif
@dialyzer --no_native --src -r src $(DIALYZER_OPTS)
+# Copyright (c) 2014, Juan Facorro <[email protected]>
+# This file is part of erlang.mk and subject to the terms of the ISC License.
+
+.PHONY: elvis distclean-elvis
+
+# Configuration.
+
+ELVIS_CONFIG ?= $(CURDIR)/elvis.config
+
+ELVIS ?= $(CURDIR)/elvis
+export ELVIS
+
+ELVIS_URL ?= https://github.com/inaka/elvis/releases/download/0.2.3/elvis
+ELVIS_CONFIG_URL ?= https://github.com/inaka/elvis/releases/download/0.2.3/elvis.config
+ELVIS_OPTS ?=
+
+# Core targets.
+
+help::
+ @printf "%s\n" "" \
+ "Elvis targets:" \
+ " elvis Run Elvis using the local elvis.config or download the default otherwise"
+
+ifneq ($(wildcard $(ELVIS_CONFIG)),)
+rel:: distclean-elvis
+endif
+
+distclean:: distclean-elvis
+
+# Plugin-specific targets.
+
+$(ELVIS):
+ @$(call core_http_get,$(ELVIS_CONFIG),$(ELVIS_CONFIG_URL))
+ @$(call core_http_get,$(ELVIS),$(ELVIS_URL))
+ @chmod +x $(ELVIS)
+
+elvis: $(ELVIS)
+ @$(ELVIS) rock -c $(ELVIS_CONFIG) $(ELVIS_OPTS)
+
+distclean-elvis:
+ $(gen_verbose) rm -rf $(ELVIS)
+
# Copyright (c) 2013-2014, Loïc Hoguin <[email protected]>
# This file is part of erlang.mk and subject to the terms of the ISC License.
diff --git a/plugins/elvis.mk b/plugins/elvis.mk
new file mode 100644
index 0000000..f3e75a8
--- /dev/null
+++ b/plugins/elvis.mk
@@ -0,0 +1,41 @@
+# Copyright (c) 2014, Juan Facorro <[email protected]>
+# This file is part of erlang.mk and subject to the terms of the ISC License.
+
+.PHONY: elvis distclean-elvis
+
+# Configuration.
+
+ELVIS_CONFIG ?= $(CURDIR)/elvis.config
+
+ELVIS ?= $(CURDIR)/elvis
+export ELVIS
+
+ELVIS_URL ?= https://github.com/inaka/elvis/releases/download/0.2.3/elvis
+ELVIS_CONFIG_URL ?= https://github.com/inaka/elvis/releases/download/0.2.3/elvis.config
+ELVIS_OPTS ?=
+
+# Core targets.
+
+help::
+ @printf "%s\n" "" \
+ "Elvis targets:" \
+ " elvis Run Elvis using the local elvis.config or download the default otherwise"
+
+ifneq ($(wildcard $(ELVIS_CONFIG)),)
+rel:: distclean-elvis
+endif
+
+distclean:: distclean-elvis
+
+# Plugin-specific targets.
+
+$(ELVIS):
+ @$(call core_http_get,$(ELVIS_CONFIG),$(ELVIS_CONFIG_URL))
+ @$(call core_http_get,$(ELVIS),$(ELVIS_URL))
+ @chmod +x $(ELVIS)
+
+elvis: $(ELVIS)
+ @$(ELVIS) rock -c $(ELVIS_CONFIG) $(ELVIS_OPTS)
+
+distclean-elvis:
+ $(gen_verbose) rm -rf $(ELVIS)