[VERSIONING] add class for version
The class clea-os-versioning.bbclass allows to read important variable such as: CLEA_OS_IMAGE_ID, CLEA_OS_IMAGE_VERSION, CLEA_OS_MANIFEST_DATE and CLEA_OS_BUILD_DATE.
- CLEA_OS_IMAGE_ID: show the tag, if not assigned it show the branch name; if the current commit is not tagged the id contains the SHA; if there are changes in local the flag DIRTY is added to the id.
- CLEA_OS_IMAGE_VERSION: if the version is in the tag, it is extracted and rewritten following a specified syntax(e.g. kirkstone_1-06-00 -> 1.6.0). If the version is not provided the value is set initially to "0.0.1".
- CLEA_OS_MANIFEST_DATE: show the date of the most recent commit.
- CLEA_OS_BUILD_DATE: show the present date of the build. Furthermore, it is created a file clea-os-version.manifest to memorize the version of the case in which no version is signed.
The class clea-os-image.bbclass allows to an image or recipe that inherit it to increment the version when built, in the case in which the branch name is used to characterize the "CLEA_OS_IMAGE_ID". If the process of building concludes successfully the incremented version is saved in the clea-os-version.manifest ready to be used as the global variable "CLEA_OS_IMAGE_VERSION". If the process of building fail the incremented version is not saved lefting unchanged the clea-os-versioning.manifest.
The os-release directory contain the os-release.bbappend which assign the "CLEA_OS_IMAGE_ID" and "CLEA_OS_IMAGE_VERSION" to "IMAGE_ID" and "IMAGE_VERSION", respectively.
If the increment of the version is not needed the user can select in the configurator menu the option STATIC VERSIONING.
Signed-off-by: carlo carlo.ferriolo@seco.com