Documentation for OpenFLUID 2.2.2
Loading...
Searching...
No Matches
WareSetManager.hpp
Go to the documentation of this file.
1/*
2
3 This file is part of OpenFLUID software
4 Copyright(c) 2021-2026, INRAE
5
6
7 == GNU General Public License Usage ==
8
9 OpenFLUID is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 OpenFLUID is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21
22
23 == Other Usage ==
24
25 Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26 license, and requires a written agreement between You and INRA.
27 Licensees for Other Usage of OpenFLUID may use this file in accordance
28 with the terms contained in the written agreement between You and INRA.
29
30 */
31
32
33/**
34 @file WareSetManager.hpp
35
36 @author Armel THÖNI <armel.thoni@inrae.fr>
37*/
38
39
40#ifndef __OPENFLUID_WARESDEV_WARESETMANAGER_HPP__
41#define __OPENFLUID_WARESDEV_WARESETMANAGER_HPP__
42
43
44#include <map>
45
48
49
50namespace openfluid { namespace waresdev {
51
52const std::string OK_STRING = "[OK]";
53const std::string KO_STRING = "[KO]";
54const std::string MULTIBUILD_STR = "<Common>";
55
57{
58 private:
59
60 std::string m_WareSourceType;
61 std::string m_WaresetSourceType;
62 openfluid::thirdparty::json m_JSONWareset;
63 std::string m_ID;
64 std::string m_WaresOrigin;
65 std::string m_CustomCMakeContent;
66 bool m_IsPreconfigureCommand;
67
68 std::map<std::string, std::map<std::string, std::string>> m_WareStatus;
69
70
71 public:
72 unsigned int m_Problems;
73
75
76 // constructor also deduce expected wares from set and complementary information from eventual datasetinfo.json
77 WareSetManager(const std::string& WareSourceType, const std::string& WaresetSourceType,
78 const std::string& SetOption, const std::string& WaresOrigin, std::string& ID);
79
80 void setStatus(const std::string& Line, const std::string& Step, const std::string& Status)
81 {
82 m_WareStatus[Line][Step] = Status;
83 }
84
85 // writes a table in cout with status for each ware and each step
87
88 // runs the fetch, checkout, configure, build, install for all wares of the set and may run the simulation
89 int scaffoldWareset(const std::string& UserdataPathStr,
90 const std::string& WareSourceURL,
91 const std::string& WorkspaceName="",
92 bool IsStrict=true, bool NoBuild=false, unsigned int JobsNbr=2, bool BuildTogether=false,
93 bool Overwrite=false);
94
95 // generates a lock file with precise hash version of git repo for each ware
96 void freeze(const std::string& UserdataPathStr);
97
99 {
100 return m_JSONWareset;
101 }
102};
103
104
105} } // namespaces
106
107
108#endif /* __OPENFLUID_WARESDEV_WARESETMANAGER_HPP__ */
Definition WareSetManager.hpp:57
unsigned int m_Problems
Definition WareSetManager.hpp:72
void setStatus(const std::string &Line, const std::string &Step, const std::string &Status)
Definition WareSetManager.hpp:80
int scaffoldWareset(const std::string &UserdataPathStr, const std::string &WareSourceURL, const std::string &WorkspaceName="", bool IsStrict=true, bool NoBuild=false, unsigned int JobsNbr=2, bool BuildTogether=false, bool Overwrite=false)
WareSetManager()
Definition WareSetManager.hpp:74
void freeze(const std::string &UserdataPathStr)
WareSetManager(const std::string &WareSourceType, const std::string &WaresetSourceType, const std::string &SetOption, const std::string &WaresOrigin, std::string &ID)
openfluid::thirdparty::json getWaresetData()
Definition WareSetManager.hpp:98
#define OPENFLUID_API
Definition dllexport.hpp:86
nlohmann::ordered_json json
Definition JSON.hpp:52
const std::string OK_STRING
Definition WareSetManager.hpp:52
const std::string KO_STRING
Definition WareSetManager.hpp:53
const std::string MULTIBUILD_STR
Definition WareSetManager.hpp:54
Definition ApplicationException.hpp:47