mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 01:24:27 +00:00
feat(build): manage patch version in Makefile
Add VERSION_PATCH macro in Makefile. This will help LTS releases. While at it, handle VERSION_PATCH macro in .versionrc.js script. Change-Id: Id3ec359f7768a90ba5c67e35d29736a46eb402b5 Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
parent
18b47a9ca4
commit
055ebeca1b
2 changed files with 6 additions and 2 deletions
|
@ -129,16 +129,19 @@ module.exports = {
|
|||
"readVersion": function (contents) {
|
||||
const major = contents.match(/^VERSION_MAJOR\s*:=\s*(\d+?)$/m)[1];
|
||||
const minor = contents.match(/^VERSION_MINOR\s*:=\s*(\d+?)$/m)[1];
|
||||
const patch = contents.match(/^VERSION_PATCH\s*:=\s*(\d+?)$/m)[1];
|
||||
|
||||
return `${major}.${minor}.0`;
|
||||
return `${major}.${minor}.${patch}`;
|
||||
},
|
||||
|
||||
"writeVersion": function (contents, version) {
|
||||
const major = version.split(".")[0];
|
||||
const minor = version.split(".")[1];
|
||||
const patch = version.split(".")[2];
|
||||
|
||||
contents = contents.replace(/^(VERSION_MAJOR\s*:=\s*)(\d+?)$/m, `$1${major}`);
|
||||
contents = contents.replace(/^(VERSION_MINOR\s*:=\s*)(\d+?)$/m, `$1${minor}`);
|
||||
contents = contents.replace(/^(VERSION_PATCH\s*:=\s*)(\d+?)$/m, `$1${patch}`);
|
||||
|
||||
return contents;
|
||||
}
|
||||
|
|
3
Makefile
3
Makefile
|
@ -9,7 +9,8 @@
|
|||
#
|
||||
VERSION_MAJOR := 2
|
||||
VERSION_MINOR := 9
|
||||
VERSION := ${VERSION_MAJOR}.${VERSION_MINOR}
|
||||
VERSION_PATCH := 0
|
||||
VERSION := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
|
||||
|
||||
# Default goal is build all images
|
||||
.DEFAULT_GOAL := all
|
||||
|
|
Loading…
Add table
Reference in a new issue