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
26{
27 return "6.14.20251211.2005.dev5";
28}
29
31{
32 return "6.14";
33}
34
36 return {"6", "14", "20251211.2005", ".dev5"};
37}
38
40 // Convert here in those cases where patch number is of the form "20131022.1356".
41 const unsigned long patchVersion = std::stoul(version.patch);
42 // For major/minor/patch/rc/local releases we point users to a specific release-notes.
43 // For dev and nightly versions we point to the next main release notes.
44 // We assume that the next main release version number will be one minor version higher.
45
46 std::stringstream versionLabel;
47
48 if ( (patchVersion < 100 && version.tweak.empty())
49 || version.tweak[0] == '+'
50 || version.tweak.substr(0, 2) == "rc") {
51 versionLabel << version.major << "." << version.minor;
52 versionLabel << "." << patchVersion;
53 }
54 else {
55 const unsigned long minorVersion = std::stoul(version.minor);
56 versionLabel << version.major << "." << minorVersion + 1 << "." << "0";
57 }
58
59 return versionLabel.str();
60}
61
63{
64 const std::string STEM = "release/v";
65 const std::string END = "/index.html";
66
67 std::stringstream url;
68
69 url << STEM << versionForReleaseNotes(versionInfo()) << END;
70
71 return url.str();
72}
73
75{
76 return "g85781e38a56";
77}
78
80{
81 return "85781e38a56bfa04ca21f837108bbcffcb0f080c";
82}
83
85{
86 return "Fri, 12 Dec 2025";
87}
88
89std::string MantidVersion::doi()
90{
91 const std::string MAIN = "http://dx.doi.org/10.5286/Software/Mantid";
92 // Cast here in those cases where patch number is of the form 20131022.1356.
93 const unsigned int patchVersion = static_cast<unsigned int>(20251211.2005);
94
95 // For major/minor/patch releases we point users to a specific release-notes DOI, for
96 // dev versions we just point to the main DOI. A simple way to see whether or not
97 // we're currently in a dev version is to check if the patch version is larger than
98 // some arbitrarily low value.
99 const std::string tweakVersion(".dev5");
100 if( patchVersion > 100 || !tweakVersion.empty())
101 return MAIN;
102
103 std::stringstream doi;
104 doi << MAIN << 6 << "." << 14;
105
106 // Keep to the convention where we write a version number like "3.0.0" as "3.0".
107 if( patchVersion != 0 )
108 doi << "." << patchVersion;
109
110 return doi.str();
111}
112
114{
115 return "http://dx.doi.org/10.1016/j.nima.2014.07.029";
116}
117
118} // 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 std::string versionForReleaseNotes(const VersionInfo &)
The version of mantid for the release notes url.
static const char * releaseDate()
The date of the last commit.
static const char * revision()
The abbreviated SHA-1 of the last commit.