NoJobEngine 2.0.7
Loading...
Searching...
No Matches
StandaloneBuilder.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <filesystem>
9#include <functional>
10#include <string>
11#include <vector>
13
14namespace NoJob
15{
17 {
18 public:
19 using LogFunction = std::function<void(std::string)>;
20 using ProcessFunction = std::function<int(
21 const std::filesystem::path&,
22 const std::vector<std::wstring>&,
23 const std::string&)>;
24
25 struct Result
26 {
27 bool Succeeded = false;
28 std::filesystem::path OutputDirectory;
29 std::string Error;
30 };
31
32 // Performs the complete standalone build/cook/package pipeline synchronously.
33 // EditorLayer owns the worker thread so standalone and script compilation keep
34 // their existing mutual-exclusion/lifetime behavior.
35 static Result Build(
36 const std::filesystem::path& projectRoot,
37 const std::filesystem::path& cmakeExecutable,
38 const BuildSettings& settings,
39 const LogFunction& log,
40 const ProcessFunction& runProcess);
41
42 private:
43 static std::string ReadProjectName(const std::filesystem::path& root);
44 static std::filesystem::path FindBuiltRuntimeExecutable(
45 const std::filesystem::path& buildRoot,
46 const std::wstring& configuration);
47 static bool IsRuntimeAssetExtension(const std::filesystem::path& path);
48 static bool CopyRuntimeAsset(
49 const std::filesystem::path& root,
50 const std::filesystem::path& source,
51 const std::filesystem::path& outputRoot,
52 std::vector<std::filesystem::path>& cooked,
53 std::string& error);
54 static bool CookRuntimeAssets(
55 const std::filesystem::path& root,
56 const BuildSettings& settings,
57 const std::filesystem::path& outputRoot,
58 std::vector<std::filesystem::path>& cooked,
59 std::string& error);
60 static bool ValidateStandalonePackage(
61 const std::filesystem::path& outputRoot,
62 const std::string& buildName,
63 std::string& error);
64 };
65}
BuildSettings declarations for the Build and Packaging subsystem.
static Result Build(const std::filesystem::path &projectRoot, const std::filesystem::path &cmakeExecutable, const BuildSettings &settings, const LogFunction &log, const ProcessFunction &runProcess)
std::function< void(std::string)> LogFunction
std::function< int( const std::filesystem::path &, const std::vector< std::wstring > &, const std::string &)> ProcessFunction
std::filesystem::path OutputDirectory