Initial versioning
Change-Id: I04a09c19fd09973046c61f496860464e8fc06399
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/build/core/main.mk b/build/core/main.mk
new file mode 100644
index 0000000..2adf853
--- /dev/null
+++ b/build/core/main.mk
@@ -0,0 +1,2 @@
+# Include ShiftOS versions
+include $(TOPDIR)vendor/shiftos/build/core/main_version.mk
diff --git a/build/core/main_version.mk b/build/core/main_version.mk
new file mode 100644
index 0000000..5c81542
--- /dev/null
+++ b/build/core/main_version.mk
@@ -0,0 +1,16 @@
+# ShiftOS system version
+ADDITIONAL_SYSTEM_PROPERTIES += \
+ ro.shift.sos.version=$(SHIFT_SOFTWARE_VERSION) \
+ ro.shift.sos.version.extra=$(SHIFT_SOS_VERSION_EXTRA) \
+ ro.shift.sos.version.name=$(SHIFT_SOS_VERSION_NAME) \
+ ro.shift.sos.version.number=$(SHIFT_SOS_VERSION_NUMBER) \
+
+ADDITIONAL_SYSTEM_PROPERTIES += \
+ ro.shift.version.base=$(SHIFT_SOFTWARE_VERSION_BASE) \
+ ro.shift.version.date=$(SHIFT_BUILD_DATE) \
+ ro.shift.version.display=$(SHIFT_SOFTWARE_VERSION) \
+ ro.shift.version.timestamp=$(SHIFT_BUILD_TIMESTAMP) \
+
+# ShiftOS release type
+ADDITIONAL_SYSTEM_PROPERTIES += \
+ ro.shift.release.type=$(SHIFT_SOFTWARE_BUILD_TYPE) \
diff --git a/config/common.mk b/config/common.mk
new file mode 100644
index 0000000..c366e0d
--- /dev/null
+++ b/config/common.mk
@@ -0,0 +1,4 @@
+PRODUCT_BRAND ?= SHIFT
+
+# If not set, default to true
+SHIFT_BUILD_WITH_GMS ?= true
diff --git a/config/common_full.mk b/config/common_full.mk
new file mode 100644
index 0000000..858c477
--- /dev/null
+++ b/config/common_full.mk
@@ -0,0 +1 @@
+$(call inherit-product, vendor/shiftos/config/common.mk)
diff --git a/config/version.mk b/config/version.mk
new file mode 100644
index 0000000..d7a553c
--- /dev/null
+++ b/config/version.mk
@@ -0,0 +1,73 @@
+VENDOR_TARGET := $(subst full_,,$(TARGET_PRODUCT))
+VENDOR_TARGET := $(subst lineage_,,$(VENDOR_TARGET))
+
+# Work around qssi
+ifeq ($(VENDOR_TARGET),qssi)
+ VENDOR_TARGET := $(QSSI_BUILD_TARGET_PRODUCT_NAME)
+endif
+
+####################################################################################
+
+SHIFT_SOS_VERSION_MAJOR := 4
+SHIFT_SOS_VERSION_MINOR := 0
+SHIFT_SOS_VERSION_EXTRA :=
+
+ifeq ($(SHIFT_BUILD_WITH_GMS),true)
+ SHIFT_SOS_VERSION_EXTRA += G
+else
+ SHIFT_SOS_VERSION_EXTRA += L
+endif
+SHIFT_SOS_VERSION_EXTRA := $(strip $(SHIFT_SOS_VERSION_EXTRA))
+
+SHIFT_SOS_VERSION_NUMBER := $(SHIFT_SOS_VERSION_MAJOR).$(SHIFT_SOS_VERSION_MINOR)
+SHIFT_SOS_VERSION_NAME := SOS.$(SHIFT_SOS_VERSION_NUMBER).$(SHIFT_SOS_VERSION_EXTRA)
+
+####################################################################################
+
+# SHIFT 5me
+ifeq ($(VENDOR_TARGET),SHIFT5me)
+ SHIFT_SOFTWARE_VERSION_BASE := SHIFT5ME.$(SHIFT_SOS_VERSION_NAME)
+
+ VENDOR_DEFAULT_SERIAL := SP0752454246466
+endif
+
+# SHIFT 6m
+ifeq ($(VENDOR_TARGET),SHIFT6m)
+ SHIFT_SOFTWARE_VERSION_BASE := SHIFT6M.$(SHIFT_SOS_VERSION_NAME)
+
+ VENDOR_DEFAULT_SERIAL := SP0752454246465
+endif
+
+# SHIFT 6mq (axolotl)
+ifeq ($(VENDOR_TARGET),axolotl)
+ SHIFT_SOFTWARE_VERSION_BASE := SHIFT6MQ.$(SHIFT_SOS_VERSION_NAME)
+
+ VENDOR_DEFAULT_SERIAL := SP0752454246472
+endif
+
+# SHIFT 6mq - ROW (axolotl_row)
+ifeq ($(VENDOR_TARGET),axolotl_row)
+ SHIFT_SOFTWARE_VERSION_BASE := SHIFT6MQ_ROW.$(SHIFT_SOS_VERSION_NAME)
+
+ VENDOR_DEFAULT_SERIAL := SP0752454246472
+endif
+
+####################################################################################
+
+ifeq ($(SHIFT_SOFTWARE_VERSION_BASE),)
+ SHIFT_SOFTWARE_VERSION_BASE := $(VENDOR_TARGET).$(SHIFT_SOS_VERSION_NAME)
+endif
+
+SHIFT_BUILD_DATE := $(shell date +%Y%m%d)
+SHIFT_BUILD_TIMESTAMP := $(shell date +%s)
+SHIFT_SOFTWARE_VERSION := $(SHIFT_SOFTWARE_VERSION_BASE).$(SHIFT_BUILD_DATE)
+
+####################################################################################
+
+ifneq ($(SHIFT_BUILD_TYPE),)
+ SHIFT_SOFTWARE_BUILD_TYPE := $(SHIFT_BUILD_TYPE)
+else
+ SHIFT_SOFTWARE_BUILD_TYPE := development
+endif
+
+####################################################################################