Changeset 1299ea5b49 in tspsg


Ignore:
Timestamp:
Jul 10, 2012, 5:34:54 PM (12 years ago)
Author:
Oleksii Serdiuk
Branches:
appveyor, imgbot, master, readme
Children:
b26801b000
Parents:
7ba743d983
Message:

Updated version info to be set based on git tags.

'git describe' is now used for version definition. Major, minor and
release are taken from the latest git tag. Build is defined as number of
commits since the latest tag. If we're out of source, then .tag file
should contain output of 'git describe --abbrev=40' command.

Also, moved version related code from tspsg.pro to version.pri.

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • resources/tspsg.rc

    r7ba743d983 r1299ea5b49  
    2323        PRODUCTVERSION BUILD_VERSION_MAJOR,BUILD_VERSION_MINOR,BUILD_RELEASE,BUILD_NUMBER
    2424        FILEFLAGSMASK 0x17L
    25 #if defined(DEBUG)
     25#ifdef DEBUG
    2626        FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE | VS_FF_PRIVATEBUILD
    27 #elif !defined(TSPSG_RELEASE_BUILD) || (BUILD_NUMBER == 65535)
    28         FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
    29 #elif BUILD_RELEASE < 11
     27#elif !defined(TSPSG_RELEASE_BUILD)
    3028        FILEFLAGS VS_FF_PRERELEASE
    3129#else
     
    5149            VALUE "InternalName", "TSPSG"
    5250            VALUE "LegalCopyright", "Copyright © 2007-2010 Oleksii ""Lёppa"" Serdiuk <contacts[at]oleksii[dot]name>"
    53 #ifdef QT_NO_DEBUG
     51#ifdef DEBUG
     52            VALUE "OriginalFilename", "tspsgd.exe"
     53#else
    5454            VALUE "OriginalFilename", "tspsg.exe"
    55 #else
    56             VALUE "OriginalFilename", "tspsgd.exe"
    5755#endif
    58 #ifndef QT_NO_DEBUG
     56#ifdef DEBUG
    5957            VALUE "PrivateBuild", "Debug development build"
    60 #elif BUILD_NUMBER == 65535
    61             VALUE "SpecialBuild", "Internal development build"
    6258#endif
    6359        END
  • src/main.cpp

    r7ba743d983 r1299ea5b49  
    4242{
    4343#ifdef Q_WS_S60
    44     // No enough memory for solution graph generation with tasks
     44    // Not enough memory for solution graph generation with tasks
    4545    // of 20 and more cities if we use non-raster graphics system.
    4646    QApplication::setGraphicsSystem("raster");
  • src/mainwindow.cpp

    r7ba743d983 r1299ea5b49  
    552552    about += QString("&nbsp;&nbsp;&nbsp;&nbsp;%1: <b>%2</b><br>").arg(tr("Runtime"), qVersion());
    553553    about.append(QString("%1: <b>%2x%3</b><br>").arg(tr("Logical screen DPI")).arg(logicalDpiX()).arg(logicalDpiY()));
    554     about += tr("Buid <b>%1</b>, built on <b>%2</b> at <b>%3</b> with <b>%4</b> compiler.").arg(BUILD_NUMBER).arg(__DATE__).arg(__TIME__).arg(COMPILER) + "<br>";
     554QString tag;
     555#ifdef REVISION_STR
     556    tag = tr(" from git revision <b>%1</b>").arg(REVISION_STR);
     557#endif
     558    about += tr("Build <b>%1</b>, built%5 on <b>%2</b> at <b>%3</b> with <b>%4</b> compiler.").arg(BUILD_NUMBER).arg(__DATE__).arg(__TIME__).arg(COMPILER).arg(tag) + "<br>";
    555559    about += QString("%1: <b>%2</b><br>").arg(tr("Algorithm"), CTSPSolver::getVersionId());
    556560    about += "<br>";
  • src/version.h

    r7ba743d983 r1299ea5b49  
    4949/*!
    5050 * \def BUILD_STATUS
    51  * \brief TSPSG build status
     51 * \brief TSPSG build status (e.g., alpha1, beta3)
    5252 */
    5353#ifdef DEBUG
    54 #   ifndef BUILD_STATUS_TYPE
    55 #       define BUILD_STATUS (debug build BUILD_NUMBER)
     54#   ifndef BUILD_STATUS
     55#       define BUILD_STATUS_STR (debug build)
    5656#   else
    57 #       define BUILD_STATUS (debug BUILD_STATUS_TYPE BUILD_STATUS_NUMBER)
     57#       define BUILD_STATUS_STR (debug BUILD_STATUS)
    5858#   endif
    5959#else
    6060#   if !defined(TSPSG_RELEASE_BUILD)
    61 #       define BUILD_STATUS (nightly build)
    62 #   elif !defined(BUILD_STATUS_TYPE)
    63 #       define BUILD_STATUS (build BUILD_NUMBER)
     61#       define BUILD_STATUS_STR (nightly build)
     62#   elif !defined(BUILD_STATUS)
     63#       define BUILD_STATUS_STR (build BUILD_NUMBER)
    6464#   else
    65 #       define BUILD_STATUS (BUILD_STATUS_TYPE BUILD_STATUS_NUMBER)
     65#       define BUILD_STATUS_STR (BUILD_STATUS)
    6666#   endif // TSPSG_RELEASE_BUILD
    6767#endif // DEBUG
     
    7373
    7474//! Full version of TSPSG in the form: \c major.minor.release.build \c status.
    75 #define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE BUILD_STATUS)
     75#define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE BUILD_STATUS_STR)
     76
     77/*!
     78 * \def REVISION_STR
     79 * \brief Git revision from which build was made
     80 */
     81#ifdef REVISION
     82#   define REVISION_STR QUOTE(REVISION)
     83#else
     84#   define REVISION_STR "$Format:%H$"
     85#endif
    7686
    7787#endif // VERSION_H
  • tspsg.pro

    r7ba743d983 r1299ea5b49  
    3131QMAKE_TARGET_COPYRIGHT = Copyright © 2007-2011 Oleksii "Lёppa" Serdiuk <contacts[at]oleksii[dot]name>
    3232
    33 # Versioning
    34 BUILD_VERSION_MAJOR = 0
    35 BUILD_VERSION_MINOR = 1
    36 BUILD_RELEASE = 5
    37 
    38 # These are only defined on releases
    39 #DEFINES += TSPSG_RELEASE_BUILD
    40 #DEFINES += BUILD_STATUS_TYPE=beta
    41 #DEFINES += BUILD_STATUS_NUMBER=2
    42 
    43 #REVISION = 170
    44 isEmpty(REVISION) {
    45     REVISION = $$system(svnversion)
    46 }
    47 isEmpty(REVISION)|isEqual(REVISION,exported) {
    48     REVISION = 0
    49 } else {
    50     REVISION = $$replace(REVISION,":","")
    51     REVISION = $$replace(REVISION,"M","")
    52 }
    53 SHORT_VERSION = $$sprintf("%1.%2",$$BUILD_VERSION_MAJOR,$$BUILD_VERSION_MINOR)
    54 win32-msvc*|wincewm* {
    55     VERSION = $$SHORT_VERSION
    56 } else {
    57     VERSION = $$sprintf("%1.%2",$$SHORT_VERSION,$$BUILD_RELEASE)
    58 }
     33# Version detection
     34include(version.pri)
    5935
    6036DEFINES += BUILD_VERSION_MAJOR=$$BUILD_VERSION_MAJOR \
    6137    BUILD_VERSION_MINOR=$$BUILD_VERSION_MINOR \
    6238    BUILD_RELEASE=$$BUILD_RELEASE \
    63     BUILD_NUMBER=$$REVISION
     39    BUILD_NUMBER=$$BUILD_NUMBER
    6440
    6541CONFIG(release, debug|release) {
Note: See TracChangeset for help on using the changeset viewer.