|
| 1 | +#ifndef RUNCPP2_PIPELINE_STEPS_HPP |
| 2 | +#define RUNCPP2_PIPELINE_STEPS_HPP |
| 3 | + |
| 4 | +#include "runcpp2/Data/Profile.hpp" |
| 5 | +#include "runcpp2/Data/PipelineResult.hpp" |
| 6 | +#include "runcpp2/Data/ProfilesCommands.hpp" |
| 7 | +#include "runcpp2/Data/ScriptInfo.hpp" |
| 8 | +#include "runcpp2/Data/CmdOptions.hpp" |
| 9 | + |
| 10 | +#include "runcpp2/BuildsManager.hpp" |
| 11 | + |
| 12 | +#include "ghc/filesystem.hpp" |
| 13 | + |
| 14 | +#include <string> |
| 15 | +#include <vector> |
| 16 | + |
| 17 | +namespace runcpp2 |
| 18 | +{ |
| 19 | + bool CopyFiles( const ghc::filesystem::path& destDir, |
| 20 | + const std::vector<std::string>& filePaths, |
| 21 | + std::vector<std::string>& outCopiedPaths); |
| 22 | + |
| 23 | + PipelineResult RunProfileCommands( const Data::ProfilesCommands* commands, |
| 24 | + const Data::Profile& profile, |
| 25 | + const std::string& workingDir, |
| 26 | + const std::string& commandType); |
| 27 | + |
| 28 | + PipelineResult ValidateInputs( const std::string& scriptPath, |
| 29 | + const std::vector<Data::Profile>& profiles, |
| 30 | + ghc::filesystem::path& outAbsoluteScriptPath, |
| 31 | + ghc::filesystem::path& outScriptDirectory, |
| 32 | + std::string& outScriptName); |
| 33 | + |
| 34 | + PipelineResult |
| 35 | + ParseAndValidateScriptInfo( const ghc::filesystem::path& absoluteScriptPath, |
| 36 | + const ghc::filesystem::path& scriptDirectory, |
| 37 | + const std::string& scriptName, |
| 38 | + const Data::ScriptInfo* lastScriptInfo, |
| 39 | + Data::ScriptInfo& outScriptInfo); |
| 40 | + |
| 41 | + PipelineResult HandleCleanup( const Data::ScriptInfo& scriptInfo, |
| 42 | + const Data::Profile& profile, |
| 43 | + const ghc::filesystem::path& scriptDirectory, |
| 44 | + const ghc::filesystem::path& buildDir, |
| 45 | + const ghc::filesystem::path& absoluteScriptPath, |
| 46 | + BuildsManager& buildsManager); |
| 47 | + |
| 48 | + PipelineResult |
| 49 | + InitializeBuildDirectory( const ghc::filesystem::path& configDir, |
| 50 | + const ghc::filesystem::path& absoluteScriptPath, |
| 51 | + bool useLocalBuildDir, |
| 52 | + BuildsManager& outBuildsManager, |
| 53 | + ghc::filesystem::path& outBuildDir); |
| 54 | + |
| 55 | + PipelineResult CheckScriptInfoChanges( const ghc::filesystem::path& buildDir, |
| 56 | + const Data::ScriptInfo& scriptInfo, |
| 57 | + const Data::Profile& profile, |
| 58 | + const ghc::filesystem::path& scriptDirectory, |
| 59 | + const Data::ScriptInfo* lastScriptInfo, |
| 60 | + bool& outRecompileNeeded, |
| 61 | + bool& outRelinkNeeded, |
| 62 | + std::vector<std::string>& outChangedDependencies); |
| 63 | + |
| 64 | + PipelineResult |
| 65 | + ProcessDependencies(Data::ScriptInfo& scriptInfo, |
| 66 | + const Data::Profile& profile, |
| 67 | + const ghc::filesystem::path& absoluteScriptPath, |
| 68 | + const ghc::filesystem::path& buildDir, |
| 69 | + const std::unordered_map<CmdOptions, std::string>& currentOptions, |
| 70 | + const std::vector<std::string>& changedDependencies, |
| 71 | + std::vector<Data::DependencyInfo*>& outAvailableDependencies, |
| 72 | + std::vector<std::string>& outGatheredBinariesPaths); |
| 73 | + |
| 74 | + void SeparateDependencyFiles( const Data::FilesTypesInfo& filesTypes, |
| 75 | + const std::vector<std::string>& gatheredBinariesPaths, |
| 76 | + std::vector<std::string>& outLinkFilesPaths, |
| 77 | + std::vector<std::string>& outFilesToCopyPaths); |
| 78 | + |
| 79 | + PipelineResult HandlePreBuild( const Data::ScriptInfo& scriptInfo, |
| 80 | + const Data::Profile& profile, |
| 81 | + const ghc::filesystem::path& buildDir); |
| 82 | + |
| 83 | + PipelineResult HandlePostBuild( const Data::ScriptInfo& scriptInfo, |
| 84 | + const Data::Profile& profile, |
| 85 | + const ghc::filesystem::path& buildDir); |
| 86 | + |
| 87 | + PipelineResult |
| 88 | + RunCompiledOutput( const ghc::filesystem::path& target, |
| 89 | + const ghc::filesystem::path& absoluteScriptPath, |
| 90 | + const Data::ScriptInfo& scriptInfo, |
| 91 | + const std::vector<std::string>& runArgs, |
| 92 | + const std::unordered_map<CmdOptions, std::string>& currentOptions, |
| 93 | + int& returnStatus); |
| 94 | + |
| 95 | + PipelineResult |
| 96 | + HandleBuildOutput( const ghc::filesystem::path& target, |
| 97 | + const std::vector<std::string>& filesToCopyPaths, |
| 98 | + const Data::ScriptInfo& scriptInfo, |
| 99 | + const Data::Profile& profile, |
| 100 | + const std::string& buildOutputDir, |
| 101 | + const std::unordered_map<CmdOptions, std::string>& currentOptions); |
| 102 | + |
| 103 | + PipelineResult GetTargetPath( const ghc::filesystem::path& buildDir, |
| 104 | + const std::string& scriptName, |
| 105 | + const Data::Profile& profile, |
| 106 | + const std::unordered_map<CmdOptions, std::string>& currentOptions, |
| 107 | + ghc::filesystem::path& outTarget); |
| 108 | +} |
| 109 | + |
| 110 | + |
| 111 | +#endif |
0 commit comments