11#ifndef RUNCPP2_RUNCPP2_HPP
22#define RUNCPP2_RUNCPP2_HPP
33
4+ #include " runcpp2/Data/CmdOptions.hpp"
45#include " runcpp2/Data/Profile.hpp"
56#include " runcpp2/Data/ScriptInfo.hpp"
6- #include " runcpp2/BuildsManager .hpp"
7+ #include " runcpp2/Data/PipelineResult .hpp"
78
89#include < string>
910#include < vector>
1011
1112namespace runcpp2
1213{
13- enum class CmdOptions
14- {
15- NONE,
16- RESET_CACHE,
17- RESET_USER_CONFIG,
18- EXECUTABLE,
19- HELP,
20- RESET_DEPENDENCIES,
21- LOCAL,
22- SHOW_USER_CONFIG,
23- SCRIPT_TEMPLATE,
24- WATCH,
25- BUILD,
26- VERSION,
27- LOG_LEVEL,
28- CONFIG_FILE,
29- CLEANUP,
30- BUILD_SOURCE_ONLY,
31- COUNT
32- };
33-
34- enum class PipelineResult
35- {
36- UNEXPECTED_FAILURE,
37- SUCCESS,
38- EMPTY_PROFILES,
39- INVALID_SCRIPT_PATH,
40- INVALID_CONFIG_PATH,
41- INVALID_BUILD_DIR,
42- INVALID_SCRIPT_INFO,
43- NO_AVAILABLE_PROFILE,
44- DEPENDENCIES_FAILED,
45- COMPILE_LINK_FAILED,
46- INVALID_PROFILE,
47- RUN_SCRIPT_FAILED,
48- INVALID_OPTION,
49- COUNT
50- };
51-
5214 struct OptionInfo
5315 {
5416 CmdOptions Option;
@@ -63,92 +25,6 @@ namespace runcpp2
6325
6426 void SetLogLevel (const std::string& logLevel);
6527
66- PipelineResult RunProfileCommands ( const Data::ProfilesCommands* commands,
67- const Data::Profile& profile,
68- const std::string& workingDir,
69- const std::string& commandType);
70-
71- PipelineResult ValidateInputs ( const std::string& scriptPath,
72- const std::vector<Data::Profile>& profiles,
73- ghc::filesystem::path& outAbsoluteScriptPath,
74- ghc::filesystem::path& outScriptDirectory,
75- std::string& outScriptName);
76-
77- PipelineResult
78- ParseAndValidateScriptInfo ( const ghc::filesystem::path& absoluteScriptPath,
79- const ghc::filesystem::path& scriptDirectory,
80- const std::string& scriptName,
81- const Data::ScriptInfo* lastScriptInfo,
82- Data::ScriptInfo& outScriptInfo);
83-
84- PipelineResult HandleCleanup ( const Data::ScriptInfo& scriptInfo,
85- const Data::Profile& profile,
86- const ghc::filesystem::path& scriptDirectory,
87- const ghc::filesystem::path& buildDir,
88- const ghc::filesystem::path& absoluteScriptPath,
89- BuildsManager& buildsManager);
90-
91- PipelineResult
92- InitializeBuildDirectory ( const ghc::filesystem::path& configDir,
93- const ghc::filesystem::path& absoluteScriptPath,
94- bool useLocalBuildDir,
95- BuildsManager& outBuildsManager,
96- ghc::filesystem::path& outBuildDir);
97-
98- PipelineResult CheckScriptInfoChanges ( const ghc::filesystem::path& buildDir,
99- const Data::ScriptInfo& scriptInfo,
100- const Data::Profile& profile,
101- const ghc::filesystem::path& scriptDirectory,
102- const Data::ScriptInfo* lastScriptInfo,
103- bool & outRecompileNeeded,
104- bool & outRelinkNeeded,
105- std::vector<std::string>& outChangedDependencies);
106-
107- PipelineResult
108- ProcessDependencies (Data::ScriptInfo& scriptInfo,
109- const Data::Profile& profile,
110- const ghc::filesystem::path& absoluteScriptPath,
111- const ghc::filesystem::path& buildDir,
112- const std::unordered_map<CmdOptions, std::string>& currentOptions,
113- const std::vector<std::string>& changedDependencies,
114- std::vector<Data::DependencyInfo*>& outAvailableDependencies,
115- std::vector<std::string>& outGatheredBinariesPaths);
116-
117- void SeparateDependencyFiles ( const Data::FilesTypesInfo& filesTypes,
118- const std::vector<std::string>& gatheredBinariesPaths,
119- std::vector<std::string>& outLinkFilesPaths,
120- std::vector<std::string>& outFilesToCopyPaths);
121-
122- PipelineResult HandlePreBuild ( const Data::ScriptInfo& scriptInfo,
123- const Data::Profile& profile,
124- const ghc::filesystem::path& buildDir);
125-
126- PipelineResult HandlePostBuild ( const Data::ScriptInfo& scriptInfo,
127- const Data::Profile& profile,
128- const ghc::filesystem::path& buildDir);
129-
130- PipelineResult
131- RunCompiledOutput ( const ghc::filesystem::path& target,
132- const ghc::filesystem::path& absoluteScriptPath,
133- const Data::ScriptInfo& scriptInfo,
134- const std::vector<std::string>& runArgs,
135- const std::unordered_map<CmdOptions, std::string>& currentOptions,
136- int & returnStatus);
137-
138- PipelineResult
139- HandleBuildOutput ( const ghc::filesystem::path& target,
140- const std::vector<std::string>& filesToCopyPaths,
141- const Data::ScriptInfo& scriptInfo,
142- const Data::Profile& profile,
143- const std::string& buildOutputDir,
144- const std::unordered_map<CmdOptions, std::string>& currentOptions);
145-
146- PipelineResult GetTargetPath ( const ghc::filesystem::path& buildDir,
147- const std::string& scriptName,
148- const Data::Profile& profile,
149- const std::unordered_map<CmdOptions, std::string>& currentOptions,
150- ghc::filesystem::path& outTarget);
151-
15228 PipelineResult StartPipeline ( const std::string& scriptPath,
15329 const std::vector<Data::Profile>& profiles,
15430 const std::string& configPreferredProfile,
0 commit comments