lineage: Isolate LineageOS versions properties for build.prop

 * Our properties were supposed to go to /system/etc/prop.default
    after the following commit:
    "lineage: Move to Google's method of defining system default props"
    Change-Id: I6cb0e28a7599b010b389cc541015a37010a00f4b

 * However if BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED is not true,
    only /default.prop will retain the properties contents of
    ADDITIONAL_DEFAULT_PROPERTIES and PRODUCT_SYSTEM_DEFAULT_PROPERTIES,
    and none of our versioning identification was held in the system

 * Enabling BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED globally would
    break all properties on devices that handle partitions usually
    at the device level rather than the kernel due to mounting races

 * Create a new main_version.mk file to isolate LineageOS properties
    that define the system's versions identifications, and use the
    ADDITIONAL_BUILD_PROPERTIES internal build variable to include
    from build/make through a common vendor main.mk entrypoint

Change-Id: I0060141c097b3d14c3710eee1e0caf7110634967
Signed-off-by: Adrian DC <radian.dc@gmail.com>
diff --git a/config/common.mk b/config/common.mk
index 1c20a77..a5b3532 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -328,13 +328,6 @@
     endif
 endif
 
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
-    ro.lineage.version=$(LINEAGE_VERSION) \
-    ro.lineage.releasetype=$(LINEAGE_BUILDTYPE) \
-    ro.lineage.build.version=$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR) \
-    ro.modversion=$(LINEAGE_VERSION) \
-    ro.lineagelegal.url=https://lineageos.org/legal
-
 PRODUCT_EXTRA_RECOVERY_KEYS += \
     vendor/lineage/build/target/product/security/lineage
 
@@ -365,9 +358,6 @@
 endif
 endif
 
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
-    ro.lineage.display.version=$(LINEAGE_DISPLAY_VERSION)
-
 -include $(WORKSPACE)/build_env/image-auto-bits.mk
 -include vendor/lineage/config/partner_gms.mk
 
diff --git a/config/lineage_sdk_common.mk b/config/lineage_sdk_common.mk
index d92ed2d..38495d6 100644
--- a/config/lineage_sdk_common.mk
+++ b/config/lineage_sdk_common.mk
@@ -38,12 +38,3 @@
   # If you are doing a release and this is NOT 0, you are almost certainly doing it wrong
   LINEAGE_PLATFORM_REV := 0
 endif
-
-# LineageOS Platform SDK Version
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
-  ro.lineage.build.version.plat.sdk=$(LINEAGE_PLATFORM_SDK_VERSION)
-
-# LineageOS Platform Internal
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
-  ro.lineage.build.version.plat.rev=$(LINEAGE_PLATFORM_REV)
-
diff --git a/config/main.mk b/config/main.mk
new file mode 100644
index 0000000..038a846
--- /dev/null
+++ b/config/main.mk
@@ -0,0 +1,2 @@
+# Include LineageOS versions
+include vendor/lineage/config/main_version.mk
diff --git a/config/main_version.mk b/config/main_version.mk
new file mode 100644
index 0000000..96213b0
--- /dev/null
+++ b/config/main_version.mk
@@ -0,0 +1,19 @@
+# LineageOS System Version
+ADDITIONAL_BUILD_PROPERTIES += \
+    ro.lineage.version=$(LINEAGE_VERSION) \
+    ro.lineage.releasetype=$(LINEAGE_BUILDTYPE) \
+    ro.lineage.build.version=$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR) \
+    ro.modversion=$(LINEAGE_VERSION) \
+    ro.lineagelegal.url=https://lineageos.org/legal
+
+# LineageOS Platform Display Version
+ADDITIONAL_BUILD_PROPERTIES += \
+    ro.lineage.display.version=$(LINEAGE_DISPLAY_VERSION)
+
+# LineageOS Platform SDK Version
+ADDITIONAL_BUILD_PROPERTIES += \
+    ro.lineage.build.version.plat.sdk=$(LINEAGE_PLATFORM_SDK_VERSION)
+
+# LineageOS Platform Internal Version
+ADDITIONAL_BUILD_PROPERTIES += \
+    ro.lineage.build.version.plat.rev=$(LINEAGE_PLATFORM_REV)