Repository navigation
Simplify version string generation and handling - #1083
Conversation
6a1a4a6 to
17a07c1
Compare
CMake calls make_version.py which now can generate the following version
string formats:
Uncrustify-0.64 - when last commit has a tag
Uncrustify-0.64-518-0dda18c9 - when last commit is preceding a tagged commit
Uncrustify-0dda18c - when N commits are pulled and no tags are
available in the repository
If the repository is in a dirty state a '-dirty' suffix is attached
Uncrustify-0.64-dirty
If CMAKE_BUILD_TYPE is set to Debug a '_d' suffix is attached to
Uncrustify:
Uncrustify_d-0.64
Note that the '_d' suffix is handled while CMake is running, Visual Studio
builds will always have this generated prefix, even if the build type is
changed in the .sln file.
Also fixes these windows problems when executing make_version.py:
- os.EX_* is cannot be imported
- return error codes with sys.exit()
|
@andrewhit posted:
What do you guys think about this? Making the build depending on the Git history is highly unusual though. I didn't consider this previously. if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release )
endif()
set( FALLBACK_VERSION "Uncrustify-0.64_f" )
....
message(STATUS )
if (make_version_error)
message(WARNING "${make_version_error}: ${make_version_output}, scripts/make_version.py doesn't work properly")
set( CURRENT_VERSION ${FALLBACK_VERSION} )
else()
string(STRIP ${make_version_output} CURRENT_VERSION)
endif()That would mean that we would have to manually bump the version of that version string for every release, and that there still would be the possibility to get logs with not enough version info ("Uncrustify-0.64_f"). Both of those points defeat the main purpose of this PR. The only benefits that would remain are the introduced processing of the version string, if the git history is available, and it would fix the current |
37f6139 to
cebd65d
Compare
Depends upon: #1102
CMake calls
make_version.pywhich now can generate the following versionstring formats:
If the repository is in a dirty state a
-dirtysuffix is attachedIf CMAKE_BUILD_TYPE is set to Debug a
_dsuffix is attached to Uncrustify:Note that the
_dsuffix is handled while CMake is running, Visual Studio builds will always have this generated prefix, even if the build type is changed in the .sln file.Also fixes these Windows problems when executing
make_version.py:NOTE: If this is merged all new tags must adhere the current syntax, adding differently formatted tags
will break the regex and therefore the build.E: will use the fallback version string.ref: #1069, #1081, #1074, #776