Просмотр исходного кода

Try an experimental Erlang.mk CI feature

Loïc Hoguin 9 лет назад
Родитель
Сommit
8fd7364517
2 измененных файлов с 19 добавлено и 7 удалено
  1. 1 1
      circle.yml
  2. 18 6
      erlang.mk

+ 1 - 1
circle.yml

@@ -13,7 +13,7 @@ dependencies:
     - sudo apt-get install autoconf2.59
     - cd $HOME/bin && ln -s /usr/bin/autoconf2.59 autoconf
     - cd $HOME/bin && ln -s /usr/bin/autoheader2.59 autoheader
-    - MAKEFLAGS="-j 32" make ci-prepare:
+    - KERL_MAKEFLAGS="-j 32 -O" make ci-prepare:
         timeout: 3600
 
 test:

+ 18 - 6
erlang.mk

@@ -16,7 +16,7 @@
 
 ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST)))
 
-ERLANG_MK_VERSION = 2.0.0-pre.2-73-g87285ad
+ERLANG_MK_VERSION = 2.0.0-pre.2-73-g87285ad-dirty
 
 # Core configuration.
 
@@ -5850,12 +5850,22 @@ endif
 # Copyright (c) 2015, Loïc Hoguin <essen@ninenines.eu>
 # This file is part of erlang.mk and subject to the terms of the ISC License.
 
-.PHONY: ci ci-setup distclean-kerl
+.PHONY: ci ci-prepare ci-setup distclean-kerl
+
+ifndef KERL
+KERL := $(shell which kerl 2>/dev/null)
+
+ifeq ($(strip $(KERL)),)
+KERL := $(CURDIR)/.erlang.mk/kerl/kerl
+endif
+endif
 
-KERL ?= $(CURDIR)/kerl
 export KERL
 
-KERL_URL ?= https://raw.githubusercontent.com/yrashk/kerl/master/kerl
+KERL_GIT ?= https://github.com/yrashk/kerl
+KERL_COMMIT ?= 4e7c4349ddcd46ac11cd4cd50bfbda25f1f11ca2
+
+KERL_MAKEFLAGS ?=
 
 OTP_GIT ?= https://github.com/erlang/otp
 
@@ -5888,7 +5898,7 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp))))
 define ci_otp_target
 ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),)
 $(CI_INSTALL_DIR)/$(1): $(KERL)
-	$(KERL) build git $(OTP_GIT) $(1) $(1)
+	$(KERL_MAKEFLAGS) $(KERL) build git $(OTP_GIT) $(1) $(1)
 	$(KERL) install $(1) $(CI_INSTALL_DIR)/$(1)
 endif
 endef
@@ -5896,7 +5906,9 @@ endef
 $(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp))))
 
 $(KERL):
-	$(gen_verbose) $(call core_http_get,$(KERL),$(KERL_URL))
+	$(verbose) mkdir -p $(ERLANG_MK_TMP)
+	$(gen_verbose) git clone $(KERL_GIT) $(ERLANG_MK_TMP)/kerl
+	$(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT)
 	$(verbose) chmod +x $(KERL)
 
 help::