Adding a Build Number...

Issue #356 resolved
ByteC created an issue

Hi Thomas, would you mind to add a build number to your version system, e.g. 1.5.1.234

This would be very helpful if you have more than one version installed. Perhaps with a build date added as well…

Comments (11)

  1. Thomas Larsson repo owner

    Is it possible to automate that? If I need to update a counter manually, then the answer is no. I’m not that disciplined.

  2. ByteC reporter

    I will have a look into some source snippets. Seems I’m spoiled by my EMBA RAD compilers, hehe. Perhaps a combo of a file creation date/time can be extracted, independently from the os.

    digging for old blender python courses right now, hrhr…

  3. Xin

    Thomas, you could look at the script I attached to generate a hash of relative filepaths + file data. It would be more sensitive than simple version numbering but it’s better than having no indication of what version you are running.

  4. Thomas Larsson repo owner

    Xin, doesn’t this mean that I would have to run the script every time before making a commit? So how is this more automatic than just updating a build counter for each commit?

  5. Xin

    The idea would be for the addon to perform the hash every time it loads, just like it already loads settings. It doesn’t take long. Or just make it perform the hash only the first time and save it to a .json.

  6. Xin

    You mean manually?

    Thomas could write a console script that creates a file with a generated id just before the addon’s changes are committed by the same script to Bitbucket, then the addon could read the id from that file. But I don’t know what Thomas currently uses. Even in that case, the commit id could be fake since the current addon updater would update that id file but not the .json files. Hashing would detect that difference.

  7. Thomas Larsson repo owner

    Git already generates a hash which unique identifies the commit. The advantage with a build number or a timestamp is that it orders the commits in time, so you can easily see which commit comes first. I wrote a small script which generates a build number automatically and then invokes Tortoisegit from the command line; turned out it wasn’t that hard. The build number is displayed at the top of the Setup menu, and only there. It starts from 1001.

    That the updater does not update the json files is a separate problem, which I should look into at some point. A simple but not very elegant solution would be to change the extension to something else, which does not collidide with the addon updater. Another problem, which I have neglected before, is that using the addon updater is not strictly legal; it is GPL whereas the Daz importer uses a BSD-like license.

  8. Log in to comment