-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPipelineSteps.hpp
More file actions
133 lines (110 loc) · 7.35 KB
/
Copy pathPipelineSteps.hpp
File metadata and controls
133 lines (110 loc) · 7.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef RUNCPP2_PIPELINE_STEPS_HPP
#define RUNCPP2_PIPELINE_STEPS_HPP
#include "runcpp2/Data/Profile.hpp"
#include "runcpp2/Data/PipelineResult.hpp"
#include "runcpp2/Data/ProfilesCommands.hpp"
#include "runcpp2/Data/ScriptInfo.hpp"
#include "runcpp2/Data/CmdOptions.hpp"
#include "runcpp2/BuildsManager.hpp"
#include "runcpp2/IncludeManager.hpp"
#if !defined(NOMINMAX)
#define NOMINMAX 1
#endif
#include "ghc/filesystem.hpp"
#include <string>
#include <vector>
#include <unordered_map>
namespace runcpp2
{
DS::Result<void> CopyFiles( const ghc::filesystem::path& destDir,
const std::vector<std::string>& filePaths,
std::vector<std::string>& outCopiedPaths);
DS::Result<void> RunProfileCommands(const Data::ProfilesCommands* commands,
const Data::Profile& profile,
const std::string& workingDir,
const std::string& commandType);
DS::Result<void> ValidateInputs(const std::string& scriptPath,
const std::vector<Data::Profile>& profiles,
ghc::filesystem::path& outAbsoluteScriptPath,
ghc::filesystem::path& outScriptDirectory,
std::string& outScriptName);
DS::Result<void> ParseAndValidateScriptInfo(const ghc::filesystem::path& absoluteScriptPath,
const ghc::filesystem::path& scriptDirectory,
const std::string& scriptName,
const bool buildExecutable,
Data::ScriptInfo& outScriptInfo);
DS::Result<void> HandleCleanup( const Data::ScriptInfo& scriptInfo,
const Data::Profile& profile,
const ghc::filesystem::path& scriptDirectory,
const ghc::filesystem::path& buildDir,
const ghc::filesystem::path& absoluteScriptPath,
BuildsManager& buildsManager);
DS::Result<void> InitializeBuildDirectory( const ghc::filesystem::path& configDir,
const ghc::filesystem::path& absoluteScriptPath,
bool useLocalBuildDir,
BuildsManager& outBuildsManager,
ghc::filesystem::path& outBuildDir,
IncludeManager& outIncludeManager);
DS::Result<void> ResolveScriptImports( Data::ScriptInfo& scriptInfo,
const ghc::filesystem::path& scriptPath,
const ghc::filesystem::path& buildDir);
DS::Result<void> CheckScriptInfoChanges(const ghc::filesystem::path& buildDir,
const Data::ScriptInfo& scriptInfo,
const Data::Profile& profile,
const ghc::filesystem::path& absoluteScriptPath,
const Data::ScriptInfo* lastScriptInfo,
const int maxThreads,
bool& outAllRecompileNeeded,
bool& outRelinkNeeded,
std::vector<std::string>& outChangedDependencies);
DS::Result<void>
ProcessDependencies(Data::ScriptInfo& scriptInfo,
const Data::Profile& profile,
const ghc::filesystem::path& absoluteScriptPath,
const ghc::filesystem::path& buildDir,
const std::unordered_map<CmdOptions, std::string>& currentOptions,
const std::vector<std::string>& changedDependencies,
const int maxThreads,
std::vector<Data::DependencyInfo*>& outAvailableDependencies,
std::vector<std::string>& outGatheredBinariesPaths);
void SeparateDependencyFiles( const Data::FilesTypesInfo& filesTypes,
const std::vector<std::string>& gatheredBinariesPaths,
std::vector<std::string>& outLinkFilesPaths,
std::vector<std::string>& outFilesToCopyPaths);
DS::Result<void> HandlePreBuild(const Data::ScriptInfo& scriptInfo,
const Data::Profile& profile,
const ghc::filesystem::path& buildDir);
DS::Result<void> HandlePostBuild( const Data::ScriptInfo& scriptInfo,
const Data::Profile& profile,
const ghc::filesystem::path& buildDir);
DS::Result<void>
RunCompiledOutput( const ghc::filesystem::path& target,
const ghc::filesystem::path& absoluteScriptPath,
const Data::ScriptInfo& scriptInfo,
const std::vector<std::string>& runArgs,
const std::unordered_map<CmdOptions, std::string>& currentOptions,
int& returnStatus);
DS::Result<void> GetBuiltTargetPaths( const ghc::filesystem::path& buildDir,
const std::string& scriptName,
const Data::Profile& profile,
const std::unordered_map< CmdOptions,
std::string>& currentOptions,
const Data::ScriptInfo& scriptInfo,
std::vector<ghc::filesystem::path>& outTargets,
ghc::filesystem::path* outRunnableTarget);
DS::Result<void> GatherSourceFiles( const ghc::filesystem::path& absoluteScriptPath,
const Data::ScriptInfo& scriptInfo,
const Data::Profile& currentProfile,
std::vector<ghc::filesystem::path>& outSourcePaths);
DS::Result<void> GatherIncludePaths(const ghc::filesystem::path& scriptDirectory,
const Data::ScriptInfo& scriptInfo,
const Data::Profile& currentProfile,
const std::vector<Data::DependencyInfo*>& dependencies,
std::vector<ghc::filesystem::path>& outIncludePaths);
using SourceIncludeMap = std::unordered_map<std::string, std::vector<ghc::filesystem::path>>;
DS::Result<void> GatherFilesIncludes( const std::vector<ghc::filesystem::path>& sourceFiles,
const std::vector<bool>& sourceHasCache,
const std::vector<ghc::filesystem::path>& includePaths,
SourceIncludeMap& outSourceIncludes);
}
#endif