-
Notifications
You must be signed in to change notification settings - Fork 205
app: Add example of VERSION file tracking git index file #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds an example of how to add the git index file (if this is inside of a git repo) to the dependencies of the application version file, which allows the git commit of the application version to be updated as new commits are added Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
henrikbrixandersen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat. I wonder if this could somehow be added as a hook in the main Zephyr repo?
It was added with one originally but Torsten did not like introducing a git dependency on application repos: zephyrproject-rtos/zephyr#98210 (comment) |
tejlmand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, some small observations
| OUTPUT_STRIP_TRAILING_WHITESPACE | ||
| ERROR_STRIP_TRAILING_WHITESPACE | ||
| ERROR_VARIABLE stderr | ||
| RESULT_VARIABLE return_code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit.
| RESULT_VARIABLE return_code) | |
| RESULT_VARIABLE return_code | |
| ) |
| # without a dependency, this will be the case with freestanding applications. | ||
| if(NOT return_code) | ||
| if(NOT "${stderr}" STREQUAL "") | ||
| message(WARNING "APPLICATION_BUILD_VERSION: git rev-parse warned: ${stderr}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using upper case and _ makes APPLICATION_BUILD_VERSION looks like it's referring to a CMake var, which doesn't seem the case, so can be a bit misleading / confusing.
What's the reason for APPLICATION_BUILD_VERSION: first, or could there be another option ?
Adds an example of how to add the git index file (if this is inside of a git repo) to the dependencies of the application version file, which allows the git commit of the application version to be updated as new commits are added