μHAL (v2.8.22)
Part of the IPbus software repository
Loading...
Searching...
No Matches
version.hpp
Go to the documentation of this file.
1#ifndef _uhal_version_hpp_
2#define _uhal_version_hpp_
3
4#include <chrono>
5#include <cstddef>
6#include <string>
7#include <utility>
8
9#include "boost/optional.hpp"
10#include "boost/variant.hpp"
11
12
13#define UHAL_VERSION_MAJOR __PROJECT_VERSION_MAJOR__
14#define UHAL_VERSION_MINOR __PROJECT_VERSION_MINOR__
15#define UHAL_VERSION_PATCH __PROJECT_VERSION_PATCH__
16
17#define UHAL_VERSION (10000 * UHAL_VERSION_MAJOR + 100 * UHAL_VERSION_MINOR + UHAL_VERSION_PATCH)
18
19
20namespace uhal {
21
22// Based on swatch::phase2::PackageInfo
24
25 struct Version {
26 size_t major;
27 size_t minor;
28 size_t patch;
29 boost::optional<std::string> prerelease;
30 };
31
32 struct Git {
33 enum RefType {
36 };
37
38 std::string sha;
39 bool clean;
40 boost::optional<std::pair<RefType, std::string>> ref;
41 };
42
43 struct LocalBuild {
44 size_t epochTime;
45 std::string hostname;
46 std::string username;
47 };
48
49 struct GitLabBuild {
50 size_t epochTime;
51 std::string serverURL;
52 std::string projectPath;
53 size_t projectID;
54 size_t pipelineID;
55 size_t jobID;
56 };
57
59
60 // Information from version control system
61 boost::optional<Git> vcs;
62
63 // Build info
64 boost::variant<LocalBuild, GitLabBuild> build;
65};
66
68
70
71} // namespace uhal
72
73#endif /* _uhal_version_hpp_ */
const PackageInfo & getPackageInfo()
Definition: version.cpp:64
const PackageInfo::Version & getVersion()
Definition: version.cpp:58
boost::optional< std::pair< RefType, std::string > > ref
Definition: version.hpp:40
boost::optional< std::string > prerelease
Definition: version.hpp:29
boost::variant< LocalBuild, GitLabBuild > build
Definition: version.hpp:64
Version version
Definition: version.hpp:58
boost::optional< Git > vcs
Definition: version.hpp:61