File indexing completed on 2025-01-18 10:17:39
0001
0002
0003
0004
0005 #include <JANA/JVersion.h>
0006 #include <sstream>
0007
0008
0009 constexpr uint64_t JVersion::GetVersionNumber() {
0010 return 1000000*GetMajorNumber() + 1000*minor + patch;
0011 }
0012
0013 std::string JVersion::GetVersion() {
0014 std::stringstream ss;
0015 PrintVersionNumbers(ss);
0016 return ss.str();
0017 }
0018
0019 void JVersion::PrintVersionNumbers(std::ostream& os) {
0020 os << major << "." << minor << "." << patch;
0021 }
0022
0023 void JVersion::PrintSplash(std::ostream& os) {
0024 os << std::endl;
0025 os << " | \\ \\ | \\ ___ \\ " << std::endl;
0026 os << " | _ \\ \\ | _ \\ ) |" << std::endl;
0027 os << " \\ | ___ \\ |\\ | ___ \\ __/" << std::endl;
0028 os << " \\___/ _/ _\\ _| \\_| _/ _\\ _____|" << std::endl;
0029 os << std::endl;
0030 }
0031
0032 void JVersion::PrintVersionDescription(std::ostream& os) {
0033
0034 os << " JANA2 version: " << JVersion::GetVersion() << " ";
0035 if (is_unknown) {
0036 os << " (unknown git status)";
0037 }
0038 else if (is_release) {
0039 os << " (release)";
0040 }
0041 else if (is_modified) {
0042 os << " (uncommitted changes)";
0043 }
0044 else {
0045 os << " (committed changes)";
0046 }
0047 os << std::endl;
0048 if (!JVersion::is_unknown) {
0049 os << " Commit hash: " << JVersion::GetCommitHash() << std::endl;
0050 os << " Commit date: " << JVersion::GetCommitDate() << std::endl;
0051 }
0052 os << " Install prefix: " << JVersion::GetInstallDir() << std::endl;
0053 if (JVersion::HasPodio() || JVersion::HasROOT() || JVersion::HasXerces()) {
0054 os << " Optional deps: ";
0055 if (JVersion::HasPodio()) os << "Podio ";
0056 if (JVersion::HasROOT()) os << "ROOT ";
0057 if (JVersion::HasXerces()) os << "Xerces ";
0058 os << std::endl;
0059 }
0060 }
0061
0062