diff options
author | Steven Noonan <steven@uplinklabs.net> | 2009-10-18 07:58:32 -0700 |
---|---|---|
committer | Steven Noonan <steven@uplinklabs.net> | 2009-10-18 07:59:54 -0700 |
commit | 2f656a0430f31656ebf81b6ee0690bc6ad04268f (patch) | |
tree | 3559bd9779bbbdb9dad67d315e1ade4c5008e805 /crawl-ref/source/version.h | |
parent | 4a5e72289713324ce6ff6000276bd81681b18666 (diff) | |
download | crawl-ref-2f656a0430f31656ebf81b6ee0690bc6ad04268f.tar.gz crawl-ref-2f656a0430f31656ebf81b6ee0690bc6ad04268f.zip |
versioning: remove SVN-specific revision data, add Git versioning
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/version.h')
-rw-r--r-- | crawl-ref/source/version.h | 121 |
1 files changed, 72 insertions, 49 deletions
diff --git a/crawl-ref/source/version.h b/crawl-ref/source/version.h index 2a0e251113..8b8341b2a3 100644 --- a/crawl-ref/source/version.h +++ b/crawl-ref/source/version.h @@ -3,65 +3,88 @@ * Summary: Contains version information */ -/* Crawl versioning: - * Crawl uses three numbers to determine the version: - * Version, which changes when the dev team makes enormous overhauls - * to the game (which may cause savefiles from previous versions to - * temporarily stop working, for example) - * Release, which changes when siginficant new features have been - * added to the game. - * Mod, which changes with every publicly released version that - * contains nothing more than bug fixes, cosmetic changes, - * internal cleanup, etc. - * - * Further, any source or binary uploaded anywhere that is _not_ of - * release quality should be labelled as such: - * alpha for potentially unstable dev versions, or - * beta for feature-complete and mostly balanced versions - * - * several alphas or betas in a row should be labelled incrementally; - * alpha1 -> alpha2 -> alpha3 -> beta1 -> beta2 -> ... - */ - - #ifndef VERSION_H #define VERSION_H #define CRAWL "Dungeon Crawl Stone Soup" -#define VER_NUM "0.6" -#define VER_QUAL "-git" +namespace Version +{ + //! The short version string. + /*! + * This version will generally match the last version tag. For instance, + * if the last tag of Crawl before this build was '0.1.2', you'd see + * '0.1.2'. This version number does not include some rather important + * extra information useful for getting the exact revision (the Git commit + * hash and the number of revisions since the tag). For that extra information, + * use Version::Long() instead. + * + * For extracting individual components of the version, you should use the + * Major(), Minor(), Revision() and Build() functions. + */ + std::string Short(); -// Undefine for official releases. -#define DISPLAY_BUILD_REVISION + //! The long version string. + /*! + * This string contains detailed version information about the CrissCross + * build in use. The string will always start with the Git tag that this + * build descended from. If this build is not an exact match for a given + * tag, this string will also include the number of commits since the tag + * and the Git commit id (the SHA-1 hash). + */ + std::string Long(); -// last updated 07august2001 {mv} -/* *********************************************************************** - * called from: chardump - command - newgame - * *********************************************************************** */ -#define VERSION VER_NUM VER_QUAL " (crawl-ref)" + //! The major version number. + /*! + * This is the first number to appear in a version tag. For instance, + * if the tag is '0.1.2.3', this function would return '0'. + */ + int Major(); -// last updated 20feb2001 {GDL} -/* *********************************************************************** - * called from: command - * *********************************************************************** */ -#define VERSION_DETAIL __DATE__ + //! The minor version number. + /*! + * This is the second number to appear in a version tag. For instance, + * if the tag is '0.1.2.3', this function would return '1'. + */ + int Minor(); -// Returns the largest SVN revision number that a source file has been updated -// to. This is not perfectly accurate, but should be good enough for save -// files, as breaking a save almost always involves changing a source file. -int svn_revision(); + //! The revision number. + /*! + * This is the third number to appear in a version tag. For instance, + * if the tag is '0.1.2.3', this function would return '2'. + */ + int Revision(); -class check_revision -{ -public: - check_revision(const char *rev_string); - static int max_rev; -}; + //! The build number. + /*! + * This is the fourth number to appear in a version tag. For instance, + * if the tag is '0.1.2.3', this function would return '3'. + */ + int Build(); + + typedef enum { + DEV, /*!< In-development version (does not exactly match a tag). i.e. '0.1.2-3-g3af4131'. */ + ALPHA, /*!< An alpha release. i.e. '0.1.2-a3' */ + BETA, /*!< A beta release. i.e. '0.1.2-b3' */ + RC, /*!< A release candidate. i.e. '0.1.2-rc3' */ + FINAL /*!< A final release. i.e. '0.1.2' */ + } Class; + + //! The release class. + /*! + * Indicates the type of release. For instance, if you have a tag such + * as '0.1.2-b1', the class is 'BETA'. Valid suffixes are '-a', '-b', + * '-rc'. If the version string does not precisely match a tag, then it + * is considered an in-development version. + */ + Class ReleaseType(); -// This macro is meant to be used once per source file. -// It can't be put in header files, as there's no way to generate a unique -// object name across includes. Blame the lack of cross-platform __COUNTER__. -#define REVISION(rev) static check_revision check_this_source_file_revision(rev) + //! The release ID. + /*! + * If this is a special type of release (alpha, beta, rc), then this + * will return the alpha/beta/rc number. Otherwise, this returns 0. + */ + int ReleaseID(); +} #endif |