Mantid
Loading...
Searching...
No Matches
MantidVersion.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7//----------------------------------------------------------------------
8// Includes
9//----------------------------------------------------------------------
10
11/********** PLEASE NOTE! THIS FILE WAS AUTO-GENERATED FROM CMAKE. ***********************/
12/********** Source = MantidVersion.cpp.in *****************************************************/
13
15
16#include <sstream>
17
18namespace Mantid::Kernel {
19
21{
22 // The major and minor version numbers are specified in Build/CMake/VersionNumber.cmake
23 // The patch number is the number of commits since the most recent tag of the repository
24 return "6.5.20230103.858";
25}
26
28{
29 // The major and minor version numbers are specified in Build/CMake/VersionNumber.cmake
30 return "6.5";
31}
32
34 return {"6", "5", "20230103.858"};
35}
36
38{
39
40 const std::string STEM = "qthelp://org.mantidproject/doc/release/v";
41 const std::string END = "/index.html";
42 // Cast here in those cases where patch number is of the form 20131022.1356.
43 const unsigned int patchVersion = static_cast<unsigned int>(20230103.858);
44
45 // For major/minor/patch releases we point users to a specific release-notes, for
46 // dev versions we point to the next main release notes. A simple way to see whether or not
47 // we're currently in a dev version is to check if the patch version is larger than
48 // some arbitrarily low value.
49
50 // for now the code assumes that the next main release version number will be one minor version higher
51
52 std::stringstream versionLabel;
53
54 if ( patchVersion < 100 ) {
55 versionLabel << versionShort();
56 versionLabel << "." << patchVersion;
57 }
58 else {
59 const unsigned int minorVersion = static_cast<unsigned int>(5);
60 versionLabel << "6." << minorVersion + 1 << "." << "0";
61 }
62
63 std::stringstream url;
64 url << STEM << versionLabel.str() << END;
65
66 return url.str();
67}
68
70{
71 return "g6552560c5be";
72}
73
75{
76 return "6552560c5be67b70738fb1ce2cc48cf76e286b7b";
77}
78
80{
81 return "Tue, 3 Jan 2023 ";
82}
83
84std::string MantidVersion::doi()
85{
86 const std::string MAIN = "http://dx.doi.org/10.5286/Software/Mantid";
87 // Cast here in those cases where patch number is of the form 20131022.1356.
88 const unsigned int patchVersion = static_cast<unsigned int>(20230103.858);
89
90 // For major/minor/patch releases we point users to a specific release-notes DOI, for
91 // dev versions we just point to the main DOI. A simple way to see whether or not
92 // we're currently in a dev version is to check if the patch version is larger than
93 // some arbitrarily low value.
94 if( patchVersion > 100 )
95 return MAIN;
96
97 std::stringstream doi;
98 doi << MAIN << 6 << "." << 5;
99
100 // Keep to the convention where we write a version number like "3.0.0" as "3.0".
101 if( patchVersion != 0 )
102 doi << "." << patchVersion;
103
104 return doi.str();
105}
106
108{
109 return "http://dx.doi.org/10.1016/j.nima.2014.07.029";
110}
111
112} // namespace Mantid::Kernel
static const VersionInfo versionInfo()
A data structure containing the full version info.
static const char * version()
The full version number.
static std::string doi()
The DOI for this release of Mantid.
static const char * versionShort()
The version number of the last full version.
static std::string releaseNotes()
The url to the most applicable release notes.
static std::string paperCitation()
The citation for the Mantid paper.
static const char * revisionFull()
The full SHA-1 of the last commit.
static const char * releaseDate()
The date of the last commit.
static const char * revision()
The abbreviated SHA-1 of the last commit.