Closed Jake-Carter closed 6 months ago
What happens in the case of working off the master branch for example versus a release? Will the new constants be loaded with the latest release, empty, or another unknown value?
@BrentK-ADI I just added some minor Makefile black magic to check whether you're working off the git repo, and if you've got a valid python installation. If those conditions are met, the version info files will be updated every time you run a build. (https://github.com/analogdevicesinc/msdk/pull/937/commits/f7d335ceadba37f26fe1a88e9a0793b49e0f99fa)
If you're exactly on a release tag, you should see your version info match the tag exactly. If you're on a development branch, you'll get a modified version string with the following format: [latest release tag]-[commits since latest release tag]-g[commit SHA]
I'm not sure if this is too annoying for every day development, since the version info files will always show as changed and you should be adding them into all your commits from here on out. Open to feedback here.
Pull Request Template
Description
This PR adds a
mxc_version.h
info file with the following definitions that can be used by application code to check against a specific release of the MSDK.MSDK_VERSION_STRING
MSDK_VERSION_YEAR
MSDK_VERSION_MONTH
It also merges the release branch back into main, so that main can see the latest release tag.
The definitions are generated by a Python script. It uses
git describe --tags
to get an info string in relation to the latest tag. It also generates a version info file for the build system.The result is that the build output will now print:
and application code can include the version info file.
Workflow
A workflow has also been added that will update newly created tags on the release branch with the latest version info files.
I am not triggering the workflow to run automatically on any branches, because that would generate a lot of upstream commits. In the future, I will set up another workflow to trigger on approved PRs
Checklist Before Requesting Review