Make `git describe` versioning optional
We're building both development and release builds with detached git
work trees, therefore `git describe` won't ever have anything to
describe. Avoid related warnings, switch to BUILD_ID-based versioning
by default.
Fixes errors like:
fatal: No tags can describe '<frameworks/base-commit>'.
Try --always, or create some tags.
fatal: No names found, cannot describe anything.
Issue: FP3-A11#181
Change-Id: I30d95ae28e1667ef01f1400ee886a2cd6da63571
diff --git a/Android.mk b/Android.mk
index c75befa..6d17a7e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -38,8 +38,16 @@
CFLAGS += -DNL80211_SUPPORT
LOCAL_PATH := $(call my-dir)
+
+TARGET_WLAN_SIGMA_VERSION_USE_GIT_DESCRIBE ?= false
+ifeq ($(TARGET_WLAN_SIGMA_USE_FRAMEWORK_GIT_VERSION), true)
FRAMEWORK_GIT_VER := $(shell cd $(ANDROID_BUILD_TOP/)frameworks/base && git describe)
SIGMA_GIT_VER := $(shell cd $(LOCAL_PATH) && git describe --dirty=+)
+else
+FRAMEWORK_GIT_VER :=
+SIGMA_GIT_VER :=
+endif
+
ifeq ($(SIGMA_GIT_VER),)
ifeq ($(FRAMEWORK_GIT_VER),)
SIGMA_VER = android-$(PLATFORM_VERSION)-$(TARGET_PRODUCT)-$(BUILD_ID)