Engine → Scripting → managed_build.h
managed_build_runner
| Type | Class |
| Namespace | conjure::scripting |
| Include File Path | engine/include/conjure/scripting/managed_build.h |
| Source File Path | engine/src/scripting/managed_build.cpp |
| API ↗ | Hosting, the native API and hot reload, Scripting |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | managed_build_runner(
core::jobs::job_system *jobs = nullptr); | jobs runs the build off the main thread; nullptr runs it inline inside build() (the report is still posted to the main-thread queue so callers behave the same either way). |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~managed_build_runner(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mBuildCount | u32 | 0 | |
| private | m | std::string | "dotnet" | |
| private | mJob | core::jobs::job_handle | {} | |
| private | mJobs | core::jobs::job_system * | nullptr | |
| private | mState | std:: | std:: |
Functions
Public
build
buildvoid build(
const std::filesystem::path &projectPath,
std::string_view configuration,
std::function<void(const build_report &)> onComplete);Spawns dotnet build <project> -c <configuration> on a job; onComplete runs on the main thread at the next drain_main_thread_queue(). Asserts and ignores the call while a build runs.
void build(
const build_request &request,
std::function<void(const build_report &)> onComplete);Same with every option of build_request.
command_line
command_line[[nodiscard]] static core::process_desc command_line(
const build_request &request,
std::string_view dotnet);The process description a request turns into: dotnet build <project> -c <configuration> [-o <output>] --nologo -clp:NoSummary [-p:Name=Value...], run in build_request::workingDirectory. Paths are passed as UTF-8; the output directory and every property value go through msbuild_escape(). It never adds ContinuousIntegrationBuild, so the debug information keeps the real source paths and the built scripts can be debugged; a caller that wants it passes it in build_request::properties.
dotnet_executable
dotnet_executable[[nodiscard]] const std::string &dotnet_executable() const noexcept;is_building
is_building[[nodiscard]] bool is_building() const noexcept;parse_output
parse_output[[nodiscard]] static std::vector<build_diagnostic> parse_output(
std::string_view msbuildOutput);Parses MSBuild output: file(line,col): error CS1002: message and the warning form; other lines are ignored. Paths with spaces and project suffixes [Game.csproj] are handled.
run_blocking
run_blocking[[nodiscard]] static build_report run_blocking(
const build_request &request,
std::string_view dotnet);Runs a request to completion on the calling thread.
set_dotnet_executable
set_dotnet_executablevoid set_dotnet_executable(
std::string executable);The dotnet program to spawn ("dotnet" from PATH by default).
wait
waitvoid wait();Blocks until the running build (if any) finished; the report is then in the main-thread queue.