Skip to content
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

fix version #56

Open
jp-embedded opened this issue May 14, 2018 · 3 comments
Open

fix version #56

jp-embedded opened this issue May 14, 2018 · 3 comments

Comments

@jp-embedded
Copy link
Owner

scxmlcc version should be generated equally on windows/linux with make and cmake

note from pull request 55:
Well the version is/should be the same on windows and unix. The thing is, the autorevision tool is currently not used on windows and therefore the postfix part of the version is currently left out on windows (in version.cpp) - I am mainly using linux. If it is possible to use the autorevision tool on windows I think that would be the best solution since autorevision is a more generic way of doing it. Anyway, the goal must be to use the same method on windows/unix/make/cmake. Note that the current method will work also when build from a zip file or even if the source is checked out using subversion.

aboseley added a commit to aboseley/scxmlcc that referenced this issue May 15, 2018
The version.cpp contains the hardcoded base version number.
On linux append the long hash.

issue jp-embedded#56
@jp-embedded
Copy link
Owner Author

note from PR:

Yes, I think that is better. However:

The original versioning idea was to add the postfix like this (from makerevision.sh):

  • if not on version control (code downloaded from zip): no postfix

  • if on master branch: use -$VCS_TICK, if not 0

  • otherwise: Use '-$FULL_HASH'

  • add M if locally modified

so if the base version is e.g. 1.14, the printed version is "1.14" if:

the source is build out of source control - e.g. from a downloaded zip/gz file.
the source is cloned by git/svn, is on master/trunk branch, and there is no commits since last tag and no local modifications
if there is e.g. 3 commits since last tag, the build is no longer equal to 1.14, so add '-3' postfix, resulting in version "1.14-3".

This will be the versions shown for most users of scxmlcc (non developers) "1.14" for a tagged clone or zip/gz download, and "1.14-3" if latest master is cloned.

if not on master branch, it is a 'developer clone'. This can't be described with a simple number, so add full hash, e.g. "1.14-sn34h454s32h5s34hh5s4325"

if there are local modifications, add 'M' postfix to describe the build is modified. e.g. "1.14M" or "1.14M-3"

This is what makerevision.sh does. It may be a bit complicated, but it is the best non-manual method I could come up with to distinguish different versions. The only manual thing to do with this setup is to update the base version when tagging.

aboseley added a commit to aboseley/scxmlcc that referenced this issue May 24, 2018
@aboseley
Copy link
Contributor

aboseley commented May 24, 2018 via email

@jp-embedded
Copy link
Owner Author

With #60, auto versioning now works the same way on make & cmake
Now, it just needs to be implemented on windows also some day...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants