27std::chrono::month to_month(
const std::string &month) {
29 return std::chrono::January;
30 else if (month ==
"Feb")
31 return std::chrono::February;
32 else if (month ==
"Mar")
33 return std::chrono::March;
34 else if (month ==
"Apr")
35 return std::chrono::April;
36 else if (month ==
"May")
37 return std::chrono::May;
38 else if (month ==
"Jun")
39 return std::chrono::June;
40 else if (month ==
"Jul")
41 return std::chrono::July;
42 else if (month ==
"Aug")
43 return std::chrono::August;
44 else if (month ==
"Sep")
45 return std::chrono::September;
46 else if (month ==
"Oct")
47 return std::chrono::October;
48 else if (month ==
"Nov")
49 return std::chrono::November;
50 else if (month ==
"Dec")
51 return std::chrono::December;
53 throw std::runtime_error(
"Cannot convert \"" + month +
"\" to a month object");
56Types::Core::DateAndTime create_releaseDateAndTime() {
57 const std::string REVISION_DATE{
"Tue, 3 Feb 2026 00:30:06 +0000"};
59 Types::Core::DateAndTime release;
61 if (REVISION_DATE ==
"UNKNOWN") {
66 std::regex format(R
"(^.+,\s+(\d{1,2})\s+(\w{3})\s+(\d{4})\s+(.+)\s*$)");
68 if (std::regex_search(REVISION_DATE, matches, format)) {
69 constexpr size_t INDEX_DAY{1};
70 constexpr size_t INDEX_MONTH{2};
71 constexpr size_t INDEX_YEAR{3};
72 constexpr size_t INDEX_TIME{4};
75 const auto day = std::chrono::day(std::stoi(matches[INDEX_DAY].str()));
77 const auto month = to_month(matches[INDEX_MONTH].str());
79 const auto year = std::chrono::year(std::stoi(matches[INDEX_YEAR].str()));
81 std::string time = matches[INDEX_TIME].str();
86 time.erase(find_if(time.begin(), time.end(), isspace));
90 std::chrono::year_month_day ymd(year, month, day);
93 std::stringstream isostr;
94 isostr << ymd <<
"T" << time;
97 release.setFromISO8601(isostr.str());
103const std::string DOI{
"http://dx.doi.org/10.1016/j.nima.2014.07.029"};
104const std::string VERSION_FULL{
"6.14.20260127.2059.dev78"};
105const std::string VERSION_SHORT{
"6.14"};
106const std::string REVISION_SHORT{
"g5ce2ef3fa27"};
107const std::string REVISION_FULL{
"5ce2ef3fa273feb1e9f4e5a5d3ed2fd61af7226c"};
108const Types::Core::DateAndTime REVISION_DATE_AND_TIME = create_releaseDateAndTime();
122 return {
"6",
"14",
"20260127.2059",
".dev78"};
127 const unsigned long patchVersion = std::stoul(
version.patch);
132 std::stringstream versionLabel;
134 if ((patchVersion < 100 &&
version.tweak.empty()) ||
version.tweak[0] ==
'+' ||
version.tweak.substr(0, 2) ==
"rc") {
136 versionLabel <<
"." << patchVersion;
138 const unsigned long minorVersion = std::stoul(
version.minor);
139 versionLabel <<
version.major <<
"." << minorVersion + 1 <<
"." <<
"0";
142 return versionLabel.str();
146 const std::string STEM =
"release/v";
147 const std::string END =
"/index.html";
149 std::stringstream url;
161 return REVISION_DATE_AND_TIME;
165 const std::string GIT_DATE_FMT(
"%a, %e %b %Y");
167 return release.toFormattedString(GIT_DATE_FMT);
171 const std::string MAIN =
"http://dx.doi.org/10.5286/Software/Mantid";
173 const unsigned int patchVersion =
static_cast<unsigned int>(20260127.2059);
179 const std::string tweakVersion(
".dev78");
181 if (patchVersion > 100 || !tweakVersion.empty())
184 std::stringstream
doi;
185 doi << MAIN << 6 <<
"." << 14;
188 if (patchVersion != 0)
189 doi <<
"." << patchVersion;
static const std::string & revision()
The abbreviated SHA-1 of the last commit.
static const std::string & version()
The full version number.
static const VersionInfo versionInfo()
A data structure containing the full version info.
static std::string doi()
The DOI for this release of Mantid.
static Types::Core::DateAndTime releaseDateAndTime()
The DateAndTime of the last commit.
static std::string releaseDate()
The date of the last commit.
static const std::string & paperCitation()
The citation for the Mantid paper.
static std::string releaseNotes()
The url to the most applicable release notes.
static std::string versionForReleaseNotes(const VersionInfo &)
The version of mantid for the release notes url.
static const std::string & versionShort()
The version number of the last full version.
static const std::string & revisionFull()
The full SHA-1 of the last commit.