diff --git a/.appveyor.yml b/.appveyor.yml index 66a4c85..40d0245 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -27,6 +27,7 @@ install: - set PATH=%PATH%;%QTDIR%/bin build_script: + - git checkout master # re-attach to master to satisfy auto version tooling - mkdir build - cd build - cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_PREFIX_PATH=%QTDIR% .. diff --git a/.travis.yml b/.travis.yml index 45fec74..e97f3a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ install: - source /opt/qt5*/bin/qt5*-env.sh script: + - git fetch --unshallow # restore repository depth to properly count commits in auto versioning + - git checkout master # re-attach to master to satisfy auto versioning - mkdir build - cd build - cmake .. -DCMAKE_INSTALL_PREFIX=/usr diff --git a/.version.in b/.version.in new file mode 100644 index 0000000..f3e763d --- /dev/null +++ b/.version.in @@ -0,0 +1 @@ +@VERSION_STRING@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 885788f..e03fcb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,26 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/" set (WEBSITE "glabels.org") set (BUG_WEBSITE "https://github.com/jimevins/glabels-qt/issues") +execute_process( + COMMAND git symbolic-ref --short HEAD + RESULT_VARIABLE BRANCH_VALID + OUTPUT_VARIABLE BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if (NOT ${BRANCH_VALID} STREQUAL "0") + set (BRANCH "Unkonwn") +endif () + +execute_process( + COMMAND git rev-list --count ${BRANCH} + RESULT_VARIABLE COMMIT_COUNT_VALID + OUTPUT_VARIABLE COMMIT_COUNT + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if (NOT ${COMMIT_COUNT_VALID} STREQUAL "0") + set (COMMIT_COUNT "?") +endif () + execute_process( COMMAND git log -1 --format=%h RESULT_VARIABLE COMMIT_HASH_VALID @@ -38,11 +58,16 @@ if (NOT ${COMMIT_DATE_VALID} STREQUAL "0") endif () # Uncomment for snapshots, comment for releases -set(VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}-snapshot (${COMMIT_HASH} ${COMMIT_DATE})") +set(VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}-${BRANCH}${COMMIT_COUNT}") # Uncomment for releases, comment for snapshots #set(VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") +set(LONG_VERSION_STRING "${VERSION_STRING} (${COMMIT_HASH} ${COMMIT_DATE})") + +# Auto-generate version file +configure_file (.version.in VERSION @ONLY) + #======================================= # Packaging Information @@ -147,7 +172,7 @@ add_subdirectory (data) #======================================= message (STATUS "") message (STATUS "Project name ............ " ${CMAKE_PROJECT_NAME}) -message (STATUS "Project version ......... " ${VERSION_STRING}) +message (STATUS "Project version ......... " ${LONG_VERSION_STRING}) message (STATUS "Installation prefix ..... " ${CMAKE_INSTALL_PREFIX}) message (STATUS "Source code location .... " ${glabels_SOURCE_DIR}) message (STATUS "CMake version ........... " ${CMAKE_VERSION}) diff --git a/glabels-batch/main.cpp b/glabels-batch/main.cpp index e857f44..a89d045 100644 --- a/glabels-batch/main.cpp +++ b/glabels-batch/main.cpp @@ -60,7 +60,7 @@ int main( int argc, char **argv ) QCoreApplication::setOrganizationName( "glabels.org" ); QCoreApplication::setOrganizationDomain( "glabels.org" ); QCoreApplication::setApplicationName( "glabels-batch-qt" ); - QCoreApplication::setApplicationVersion( glabels::model::Version::STRING ); + QCoreApplication::setApplicationVersion( glabels::model::Version::LONG_STRING ); // // Setup translators diff --git a/glabels/AboutDialog.cpp b/glabels/AboutDialog.cpp index ef9ff99..acfb423 100644 --- a/glabels/AboutDialog.cpp +++ b/glabels/AboutDialog.cpp @@ -38,7 +38,7 @@ namespace glabels { setupUi( this ); - QString version = tr("Version") + " " + model::Version::STRING; + QString version = tr("Version") + " " + model::Version::LONG_STRING; QString description = tr("A program to create labels and business cards."); diff --git a/glabels/main.cpp b/glabels/main.cpp index 1acdf1c..67b9c7c 100644 --- a/glabels/main.cpp +++ b/glabels/main.cpp @@ -45,7 +45,7 @@ int main( int argc, char **argv ) QCoreApplication::setOrganizationName( "glabels.org" ); QCoreApplication::setOrganizationDomain( "glabels.org" ); QCoreApplication::setApplicationName( "glabels-qt" ); - QCoreApplication::setApplicationVersion( glabels::model::Version::STRING ); + QCoreApplication::setApplicationVersion( glabels::model::Version::LONG_STRING ); // // Setup translators diff --git a/model/Version.h.in b/model/Version.h.in index b9cf033..0444361 100644 --- a/model/Version.h.in +++ b/model/Version.h.in @@ -37,6 +37,7 @@ namespace glabels const int MICRO = @glabels-qt_VERSION_PATCH@; const QString STRING = "@VERSION_STRING@"; + const QString LONG_STRING = "@LONG_VERSION_STRING@"; } } diff --git a/user-docs/_build/man/glabels-batch-qt.1 b/user-docs/_build/man/glabels-batch-qt.1 index 6fa48b5..ce4b77f 100644 --- a/user-docs/_build/man/glabels-batch-qt.1 +++ b/user-docs/_build/man/glabels-batch-qt.1 @@ -1,8 +1,8 @@ .\" Man page generated from reStructuredText. . -.TH "GLABELS-BATCH-QT" "1" "Dec 29, 2018" "" "gLabels" +.TH "GLABELS-BATCH-QT" "1" "May 05, 2019" "" "gLabels" .SH NAME -glabels-batch-qt \- gLabels Documentation +glabels-batch-qt \- batch creation of labels and business cards . .nr rst2man-indent-level 0 . @@ -108,6 +108,9 @@ templates here!\fP .B ${HOME}/.glabels/ Directory for manually created product templates. .UNINDENT +.SH BUGS +.sp +Bugs and feature requests can be reported via the gLabels issue tracking system at GitHub (<\fI\%https://github.com/jimevins/glabels\-qt/issues\fP>). You will need a GitHub account to submit new issues or to comment on existing issues. .SH SEE ALSO .sp \fBglabels\-qt(1)\fP diff --git a/user-docs/_build/man/glabels-qt.1 b/user-docs/_build/man/glabels-qt.1 index 66bd854..f68653b 100644 --- a/user-docs/_build/man/glabels-qt.1 +++ b/user-docs/_build/man/glabels-qt.1 @@ -1,8 +1,8 @@ .\" Man page generated from reStructuredText. . -.TH "GLABELS-QT" "1" "Dec 29, 2018" "" "gLabels" +.TH "GLABELS-QT" "1" "May 05, 2019" "" "gLabels" .SH NAME -glabels-qt \- gLabels Documentation +glabels-qt \- create labels and business cards . .nr rst2man-indent-level 0 . @@ -67,6 +67,9 @@ templates here!\fP .B ${HOME}/.glabels/ Directory for manually created product templates. .UNINDENT +.SH BUGS +.sp +Bugs and feature requests can be reported via the gLabels issue tracking system at GitHub (<\fI\%https://github.com/jimevins/glabels\-qt/issues\fP>). You will need a GitHub account to submit new issues or to comment on existing issues. .SH SEE ALSO .sp \fBglabels\-batch\-qt(1)\fP diff --git a/user-docs/conf.py b/user-docs/conf.py index 9535f1f..8b957c5 100644 --- a/user-docs/conf.py +++ b/user-docs/conf.py @@ -149,8 +149,8 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('man/glabels-qt', 'glabels-qt', 'gLabels Documentation', [author], 1), - ('man/glabels-batch-qt', 'glabels-batch-qt', 'gLabels Documentation', [author], 1) + ('man/glabels-qt', 'glabels-qt', 'create labels and business cards', [author], 1), + ('man/glabels-batch-qt', 'glabels-batch-qt', 'batch creation of labels and business cards', [author], 1) ] diff --git a/user-docs/man/glabels-batch-qt.rst b/user-docs/man/glabels-batch-qt.rst index 0ad6fdd..5d1baaf 100644 --- a/user-docs/man/glabels-batch-qt.rst +++ b/user-docs/man/glabels-batch-qt.rst @@ -79,6 +79,10 @@ FILES Directory for manually created product templates. +BUGS +---- + +Bugs and feature requests can be reported via the gLabels issue tracking system at GitHub (). You will need a GitHub account to submit new issues or to comment on existing issues. SEE ALSO -------- diff --git a/user-docs/man/glabels-qt.rst b/user-docs/man/glabels-qt.rst index 1c2b152..709d807 100644 --- a/user-docs/man/glabels-qt.rst +++ b/user-docs/man/glabels-qt.rst @@ -43,6 +43,11 @@ FILES Directory for manually created product templates. +BUGS +---- + +Bugs and feature requests can be reported via the gLabels issue tracking system at GitHub (). You will need a GitHub account to submit new issues or to comment on existing issues. + SEE ALSO --------