Merge pull request #2009 from emqx/track-vsn-using-git-tag

Track vsn using git tag
This commit is contained in:
spring2maz 2018-11-30 11:29:17 +01:00 committed by GitHub
commit 29f697dd69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 11 deletions

View File

@ -2,7 +2,6 @@
PROJECT = emqx PROJECT = emqx
PROJECT_DESCRIPTION = EMQ X Broker PROJECT_DESCRIPTION = EMQ X Broker
PROJECT_VERSION = 3.0.0
DEPS = jsx gproc gen_rpc ekka esockd cowboy clique DEPS = jsx gproc gen_rpc ekka esockd cowboy clique
@ -48,17 +47,19 @@ PLT_APPS = sasl asn1 ssl syntax_tools runtime_tools crypto xmerl os_mon inets pu
DIALYZER_DIRS := ebin/ DIALYZER_DIRS := ebin/
DIALYZER_OPTS := --verbose --statistics -Werror_handling -Wrace_conditions #-Wunmatched_returns DIALYZER_OPTS := --verbose --statistics -Werror_handling -Wrace_conditions #-Wunmatched_returns
GIT_VSN = $(shell git --version | grep -oE "[0-9]{1,2}\.[0-9]{1,2}") GIT_VSN := $(shell git --version | grep -oE "[0-9]{1,2}\.[0-9]{1,2}")
GIT_VSN_17_COMP = $(shell echo -e "$(GIT_VSN)\n1.7" | sort -V | tail -1) GIT_VSN_17_COMP := $(shell echo -e "$(GIT_VSN)\n1.7" | sort -V | tail -1)
ifeq ($(GIT_VSN_17_COMP),1.7)
MAYBE_SHALLOW =
else
MAYBE_SHALLOW = -c advice.detachedHead=false --depth 1
endif
ifeq ($(GIT_VSN_17_COMP),1.7)
define dep_fetch_git-emqx define dep_fetch_git-emqx
git clone $(MAYBE_SHALLOW) -q -b $(call dep_commit,$(1)) -- $(call dep_repo,$(1)) $(DEPS_DIR)/$(call dep_name,$(1)) > /dev/null 2>&1 git clone -q -n -- $(call dep_repo,$(1)) $(DEPS_DIR)/$(call dep_name,$(1)); \
cd $(DEPS_DIR)/$(call dep_name,$(1)) && git checkout -q $(call dep_commit,$(1))
endef endef
else
define dep_fetch_git-emqx
git clone -q -c advice.detachedHead=false --depth 1 -b $(call dep_commit,$(1)) -- $(call dep_repo,$(1)) $(DEPS_DIR)/$(call dep_name,$(1))
endef
endif
core_http_get-emqx = curl -Lf$(if $(filter-out 0,$(V)),,s)o $(call core_native_path,$1) $2 core_http_get-emqx = curl -Lf$(if $(filter-out 0,$(V)),,s)o $(call core_native_path,$1) $2

2
erlang.mk vendored
View File

@ -1186,7 +1186,7 @@ else
fi fi
$(appsrc_verbose) cat src/$(PROJECT).app.src \ $(appsrc_verbose) cat src/$(PROJECT).app.src \
| sed "s/{[[:space:]]*modules[[:space:]]*,[[:space:]]*\[\]}/{modules, \[$(call comma_list,$(MODULES))\]}/" \ | sed "s/{[[:space:]]*modules[[:space:]]*,[[:space:]]*\[\]}/{modules, \[$(call comma_list,$(MODULES))\]}/" \
| sed "s/{id,[[:space:]]*\"git\"}/{id, \"$(subst /,\/,$(GITDESCRIBE))\"}/" \ | sed "s/{vsn,[[:space:]]*\"git\"}/{vsn, \"$(subst /,\/,$(GITDESCRIBE))\"}/" \
> ebin/$(PROJECT).app > ebin/$(PROJECT).app
endif endif

View File

@ -1,6 +1,6 @@
{application,emqx, {application,emqx,
[{description,"EMQ X Broker"}, [{description,"EMQ X Broker"},
{vsn,"3.0.0"}, {vsn,"git"},
{modules,[]}, {modules,[]},
{registered,[emqx_sup]}, {registered,[emqx_sup]},
{applications,[kernel,stdlib,jsx,gproc,gen_rpc,esockd, {applications,[kernel,stdlib,jsx,gproc,gen_rpc,esockd,