-
Notifications
You must be signed in to change notification settings - Fork 622
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
API function to get BTstack version #408
Comments
Hi. I like the idea. I'd prefer to have both the release version (e.g. v1.5.3) as well as the git commit hash available. However, I don't know how to provide the git version in a source file (there could be a script that fetches the git commit hash, but that would depend on the build system: cmake, make, IDEs, ...) Is the release version enough for your use case? Any idea how to automatically provide the git commit hash? |
Hi Matthias, To give you an idea, on my previous projects, I was calling the following script just before the build operation. (For Linux)
Script:
|
Later on I switched to a different approach: Using the git commit count as a version number.
I don't know if this idea is suitable for multi branch development. For our use case, we have only one master branch and this idea is working great. |
Thanks for the suggestions. My point was less on how to get the version in a script, but that a) running a script is a pain in one of the ports where a vendor IDE has to be used and b) shell scripts are a bit tricky on Windows. Nevertheless, most ports use either make or cmake, where running a script is easy (which we use for the Python GATT DB 'compiler'), we could run a script that writes the version into a file which is then picked up by the port specific main.c file and used there. Btw. we're used this one for the daemon version: And that one just to get the version for the package.sh script: I haven't used git hooks in any way, trying to avoid complexity where possible. I'll have a go at providing a version to unix-style targets (namely libusb and posix-*). For others, I don't want to introduce the risk of build errors for Windows users. Any idea how to get git version without a shell? I think the ESP32 esp-idf does not have a proper unix-y environment, but I guess git could be run from a Python script (and we mandate Python already). |
It would be really nice to have BTstack version info within the source files.
An API function like
const char *get_btstack_version(void)
would be useful for us to track the library version within our firmware. Using preprocessor define's is also fine.We regularly update the btstack source code in our project and feel the absence of such a version retrieval function.
Regards
The text was updated successfully, but these errors were encountered: