DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
DekiEditor::FirmwareBuilderBase Class Reference

#include <C:/Users/kirby/Documents/Github/deki/deki-editor/deki-editor/include/deki-editor/build/FirmwareBuilderBase.h>

Inherits DekiEditor::ITargetBuilder.

Public Member Functions

 ~FirmwareBuilderBase () override=default
void Cancel () override
 Cancels the current operation.
bool IsBuilding () const override
BuildState GetState () const override
BuildProgress GetProgress () const override
void SetBuildOptions (const BuildOptions &options) override
const BuildOptions & GetBuildOptions () const override
void SetPlatformConfig (const PlatformConfig &config) override
 Sets the platform's hardware configuration (display, memory, etc.).
void ClearPlatformConfig () override
void SetPackageDefines (const std::vector< std::string > &defines) override
 Sets the package defines, found by scanning the scenes.
std::string GetEnginePath (const std::string &projectPath) const override
 The engine path for a project.
std::string GetPlatformKey () const override
 Platform key for resolving dependencies in package.json / .deki-package.json.
bool IsPackageCompatible (const std::string &metadataPath) const override
 Whether a package works with this builder, from the dependencies in its metadata file (package.json or .deki-package.json).
std::vector< std::string > GetPackageSupportedPlatforms (const std::string &metadataPath) const override
 The platform keys a package's metadata file lists under dependencies, with "default" reported as "all".
std::vector< ToolchainComponent > GetToolchainComponents () const override
 The toolchain's components and their status.
void InstallToolchainComponent (const std::string &componentId, BuildProgressCallback cb=nullptr) override
 Installs or reinstalls one toolchain component.
void SetupToolchainComponent (const std::string &componentId, BuildProgressCallback cb=nullptr) override
 Runs the postInstall setup script of an installed component.
void CheckForToolchainUpdates (std::function< void()> onComplete=nullptr) override
 Checks for toolchain updates asynchronously and calls onComplete when done.
bool IsToolchainBusy () const override
 Whether a toolchain install or update check is in progress.
Public Member Functions inherited from DekiEditor::ITargetBuilder
virtual ~ITargetBuilder ()=default
virtual void Build (const std::string &projectPath, BuildOutputCallback outputCallback=nullptr, BuildProgressCallback progressCallback=nullptr)=0
 Builds firmware for the project.
virtual void Clean (const std::string &projectPath, BuildOutputCallback outputCallback=nullptr, BuildProgressCallback progressCallback=nullptr)=0
 Cleans the build directory.
virtual bool SupportsDeploy () const =0
 Whether this target has a deploy step at all.
virtual const char * GetDeployLabel () const
 The verb for the button and the log: "Flash", "Run", "Install".
virtual std::vector< DeployTarget > EnumerateDeployTargets () const
 What a deploy can be aimed at right now: serial ports, devkits on the network, paired devices.
virtual void Deploy (const std::string &projectPath, const std::string &deployTargetId, BuildOutputCallback outputCallback=nullptr, BuildProgressCallback progressCallback=nullptr)
 Deploys the last build.
virtual bool IsToolchainInstalled () const =0
 True when the required toolchain is installed.
virtual std::string GetToolchainStatus () const =0
 The toolchain's status, as text for the user.
virtual bool GenerateBuildFiles (const std::string &projectPath, const PlatformConfig &config, const std::vector< std::string > &packageDefines)=0
 Generates the build files (CMakeLists.txt, etc.) for config, in the builder's own project structure.
virtual std::unique_ptr< IPlatformEditorUI > CreateEditorUI (const PlatformConfig &config) const
 Creates this builder's settings UI for the platform editor, or nullptr if it has none.
virtual const char * GetName () const =0
 The backend's name, for the user.
virtual std::vector< std::pair< std::string, std::string > > DescribePlatform (const PlatformConfig &config) const
 What the Build panel shows about a platform aimed at this backend, as label/value rows: a chip and its memory, a devkit model, or nothing.
virtual std::vector< std::string > ValidatePlatform (const PlatformConfig &config) const
 Problems with a platform aimed at this builder; empty when it is fine.
virtual std::string GetFrameworkId () const =0
 The build framework this backend serves, as a lowercase id.
virtual const char * GetIcon () const
 Optional self-description for the platform editor's builder picker, so a third-party builder is not anonymous in the UI.
virtual const char * GetDescription () const
virtual std::string GetBuildDirectory (const std::string &projectPath) const =0
 The builder's build directory for a project.
virtual bool SupportsSimulation () const
 Whether this backend can build a platform's firmware for a simulator (BuildOptions::simulate).
virtual const char * GetSimulatorName () const
 The simulator's name, for the UI and the log: "QEMU".
virtual bool MakeSimulationBootScene (std::string &scene, const PlatformConfig &config, std::vector< std::string > &notes, std::string &error) const
 Makes the simulated build's boot scene.
virtual std::string GetBootPayloadDirectory (const std::string &projectPath) const =0
 Where the editor writes the boot payload before Build(): the compiled project settings (dproject.bin) and the platform's boot scene.

Protected Member Functions

bool RunOnBuildThread (std::function< void()> work)
void SetProgress (BuildState state, const std::string &text, float progress)
void SetError (const std::string &error)
std::vector< DependencyInfo > ReadEnginePackageDeps (const std::string &enginePath, const std::string &projectPath, const std::string &platformKey) const

Protected Attributes

std::thread m_BuildThread
std::atomic< bool > m_IsBuilding { false }
std::atomic< bool > m_CancelRequested { false }
std::mutex m_ProgressMutex
BuildProgress m_Progress
BuildOptions m_BuildOptions
bool m_HasPlatformConfig = false
PlatformConfig m_PlatformConfig
std::vector< std::string > m_PackageDefines
ToolchainComponentManager m_ToolchainMgr

Constructor & Destructor Documentation

◆ ~FirmwareBuilderBase()

DekiEditor::FirmwareBuilderBase::~FirmwareBuilderBase ( )
overridedefault

Member Function Documentation

◆ Cancel()

void DekiEditor::FirmwareBuilderBase::Cancel ( )
overridevirtual

Cancels the current operation.

Implements DekiEditor::ITargetBuilder.

◆ IsBuilding()

bool DekiEditor::FirmwareBuilderBase::IsBuilding ( ) const
inlineoverridevirtual

◆ GetState()

BuildState DekiEditor::FirmwareBuilderBase::GetState ( ) const
overridevirtual

◆ GetProgress()

BuildProgress DekiEditor::FirmwareBuilderBase::GetProgress ( ) const
overridevirtual

◆ SetBuildOptions()

void DekiEditor::FirmwareBuilderBase::SetBuildOptions ( const BuildOptions & options)
inlineoverridevirtual

◆ GetBuildOptions()

const BuildOptions & DekiEditor::FirmwareBuilderBase::GetBuildOptions ( ) const
inlineoverridevirtual

◆ SetPlatformConfig()

void DekiEditor::FirmwareBuilderBase::SetPlatformConfig ( const PlatformConfig & config)
overridevirtual

Sets the platform's hardware configuration (display, memory, etc.).

Implements DekiEditor::ITargetBuilder.

◆ ClearPlatformConfig()

void DekiEditor::FirmwareBuilderBase::ClearPlatformConfig ( )
overridevirtual

◆ SetPackageDefines()

void DekiEditor::FirmwareBuilderBase::SetPackageDefines ( const std::vector< std::string > & defines)
inlineoverridevirtual

Sets the package defines, found by scanning the scenes.

Implements DekiEditor::ITargetBuilder.

◆ GetEnginePath()

std::string DekiEditor::FirmwareBuilderBase::GetEnginePath ( const std::string & projectPath) const
overridevirtual

The engine path for a project.

Implements DekiEditor::ITargetBuilder.

◆ GetPlatformKey()

std::string DekiEditor::FirmwareBuilderBase::GetPlatformKey ( ) const
overridevirtual

Platform key for resolving dependencies in package.json / .deki-package.json.

Implements DekiEditor::ITargetBuilder.

◆ IsPackageCompatible()

bool DekiEditor::FirmwareBuilderBase::IsPackageCompatible ( const std::string & metadataPath) const
overridevirtual

Whether a package works with this builder, from the dependencies in its metadata file (package.json or .deki-package.json).

True when they name this platform's key or "default", or when there are none (pure code works everywhere).

Reimplemented from DekiEditor::ITargetBuilder.

◆ GetPackageSupportedPlatforms()

std::vector< std::string > DekiEditor::FirmwareBuilderBase::GetPackageSupportedPlatforms ( const std::string & metadataPath) const
overridevirtual

The platform keys a package's metadata file lists under dependencies, with "default" reported as "all".

Empty if the file is missing or has no dependencies.

Reimplemented from DekiEditor::ITargetBuilder.

◆ GetToolchainComponents()

std::vector< ToolchainComponent > DekiEditor::FirmwareBuilderBase::GetToolchainComponents ( ) const
overridevirtual

The toolchain's components and their status.

Reimplemented from DekiEditor::ITargetBuilder.

◆ InstallToolchainComponent()

void DekiEditor::FirmwareBuilderBase::InstallToolchainComponent ( const std::string & componentId,
BuildProgressCallback cb = nullptr )
overridevirtual

Installs or reinstalls one toolchain component.

Reimplemented from DekiEditor::ITargetBuilder.

◆ SetupToolchainComponent()

void DekiEditor::FirmwareBuilderBase::SetupToolchainComponent ( const std::string & componentId,
BuildProgressCallback cb = nullptr )
overridevirtual

Runs the postInstall setup script of an installed component.

Reimplemented from DekiEditor::ITargetBuilder.

◆ CheckForToolchainUpdates()

void DekiEditor::FirmwareBuilderBase::CheckForToolchainUpdates ( std::function< void()> onComplete = nullptr)
overridevirtual

Checks for toolchain updates asynchronously and calls onComplete when done.

Reimplemented from DekiEditor::ITargetBuilder.

◆ IsToolchainBusy()

bool DekiEditor::FirmwareBuilderBase::IsToolchainBusy ( ) const
overridevirtual

Whether a toolchain install or update check is in progress.

Reimplemented from DekiEditor::ITargetBuilder.

◆ RunOnBuildThread()

bool DekiEditor::FirmwareBuilderBase::RunOnBuildThread ( std::function< void()> work)
protected

◆ SetProgress()

void DekiEditor::FirmwareBuilderBase::SetProgress ( BuildState state,
const std::string & text,
float progress )
protected

◆ SetError()

void DekiEditor::FirmwareBuilderBase::SetError ( const std::string & error)
protected

◆ ReadEnginePackageDeps()

std::vector< DependencyInfo > DekiEditor::FirmwareBuilderBase::ReadEnginePackageDeps ( const std::string & enginePath,
const std::string & projectPath,
const std::string & platformKey ) const
protected

Member Data Documentation

◆ m_BuildThread

std::thread DekiEditor::FirmwareBuilderBase::m_BuildThread
protected

◆ m_IsBuilding

std::atomic<bool> DekiEditor::FirmwareBuilderBase::m_IsBuilding { false }
protected

◆ m_CancelRequested

std::atomic<bool> DekiEditor::FirmwareBuilderBase::m_CancelRequested { false }
protected

◆ m_ProgressMutex

std::mutex DekiEditor::FirmwareBuilderBase::m_ProgressMutex
mutableprotected

◆ m_Progress

BuildProgress DekiEditor::FirmwareBuilderBase::m_Progress
protected

◆ m_BuildOptions

BuildOptions DekiEditor::FirmwareBuilderBase::m_BuildOptions
protected

◆ m_HasPlatformConfig

bool DekiEditor::FirmwareBuilderBase::m_HasPlatformConfig = false
protected

◆ m_PlatformConfig

PlatformConfig DekiEditor::FirmwareBuilderBase::m_PlatformConfig
protected

◆ m_PackageDefines

std::vector<std::string> DekiEditor::FirmwareBuilderBase::m_PackageDefines
protected

◆ m_ToolchainMgr

ToolchainComponentManager DekiEditor::FirmwareBuilderBase::m_ToolchainMgr
protected

The documentation for this class was generated from the following file: