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

A build backend: everything the editor knows about one kind of target. More...

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

Inherited by DekiEditor::FirmwareBuilderBase.

Public Member Functions

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 void Cancel ()=0
 Cancels the current operation.
virtual bool IsBuilding () const =0
virtual BuildState GetState () const =0
virtual BuildProgress GetProgress () const =0
virtual void SetBuildOptions (const BuildOptions &options)=0
virtual const BuildOptions & GetBuildOptions () const =0
virtual void SetPlatformConfig (const PlatformConfig &config)=0
 Sets the platform's hardware configuration (display, memory, etc.).
virtual void ClearPlatformConfig ()=0
virtual void SetPackageDefines (const std::vector< std::string > &defines)=0
 Sets the package defines, found by scanning the scenes.
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 std::vector< ToolchainComponent > GetToolchainComponents () const
 The toolchain's components and their status.
virtual void InstallToolchainComponent (const std::string &componentId, BuildProgressCallback cb=nullptr)
 Installs or reinstalls one toolchain component.
virtual void SetupToolchainComponent (const std::string &componentId, BuildProgressCallback cb=nullptr)
 Runs the postInstall setup script of an installed component.
virtual void CheckForToolchainUpdates (std::function< void()> onComplete=nullptr)
 Checks for toolchain updates asynchronously and calls onComplete when done.
virtual bool IsToolchainBusy () const
 Whether a toolchain install or update check is in progress.
virtual std::string GetEnginePath (const std::string &projectPath) const =0
 The engine path for a project.
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.
virtual std::string GetPlatformKey () const =0
 Platform key for resolving dependencies in package.json / .deki-package.json.
virtual bool IsPackageCompatible (const std::string &metadataPath) const
 Whether a package works with this builder, from the dependencies in its metadata file (package.json or .deki-package.json).
virtual std::vector< std::string > GetPackageSupportedPlatforms (const std::string &metadataPath) const
 The platform keys a package's metadata file lists under dependencies, with "default" reported as "all".

Detailed Description

A build backend: everything the editor knows about one kind of target.

One implementation per build framework: a microcontroller SDK, the desktop the editor runs on, an app format for someone else's firmware, a console SDK. It generates the target's build files, drives its toolchain and knows what getting a build onto a device means there.

The editor ships none. A backend comes in a package's editor-side DLL (see BuilderPlugin.h) or as a plugin under ~/.deki-editor/builders/, so a target can be added without an editor release, even one whose SDK cannot be published.

Constructor & Destructor Documentation

◆ ~ITargetBuilder()

virtual DekiEditor::ITargetBuilder::~ITargetBuilder ( )
virtualdefault

Member Function Documentation

◆ Build()

virtual void DekiEditor::ITargetBuilder::Build ( const std::string & projectPath,
BuildOutputCallback outputCallback = nullptr,
BuildProgressCallback progressCallback = nullptr )
pure virtual

Builds firmware for the project.

◆ Clean()

virtual void DekiEditor::ITargetBuilder::Clean ( const std::string & projectPath,
BuildOutputCallback outputCallback = nullptr,
BuildProgressCallback progressCallback = nullptr )
pure virtual

Cleans the build directory.

◆ SupportsDeploy()

virtual bool DekiEditor::ITargetBuilder::SupportsDeploy ( ) const
pure virtual

Whether this target has a deploy step at all.

Pure virtual, so every backend says so either way rather than inheriting a button that cannot work.

◆ GetDeployLabel()

virtual const char * DekiEditor::ITargetBuilder::GetDeployLabel ( ) const
inlinevirtual

The verb for the button and the log: "Flash", "Run", "Install".

◆ EnumerateDeployTargets()

virtual std::vector< DeployTarget > DekiEditor::ITargetBuilder::EnumerateDeployTargets ( ) const
inlinevirtual

What a deploy can be aimed at right now: serial ports, devkits on the network, paired devices.

Empty means there is nothing to choose (the machine the editor runs on), and the UI shows no selector.

◆ Deploy()

virtual void DekiEditor::ITargetBuilder::Deploy ( const std::string & projectPath,
const std::string & deployTargetId,
BuildOutputCallback outputCallback = nullptr,
BuildProgressCallback progressCallback = nullptr )
inlinevirtual

Deploys the last build.

deployTargetId is a DeployTarget::id from EnumerateDeployTargets, or empty to let the backend pick.

◆ Cancel()

virtual void DekiEditor::ITargetBuilder::Cancel ( )
pure virtual

Cancels the current operation.

Implemented in DekiEditor::FirmwareBuilderBase.

◆ IsBuilding()

virtual bool DekiEditor::ITargetBuilder::IsBuilding ( ) const
pure virtual

◆ GetState()

virtual BuildState DekiEditor::ITargetBuilder::GetState ( ) const
pure virtual

◆ GetProgress()

virtual BuildProgress DekiEditor::ITargetBuilder::GetProgress ( ) const
pure virtual

◆ SetBuildOptions()

virtual void DekiEditor::ITargetBuilder::SetBuildOptions ( const BuildOptions & options)
pure virtual

◆ GetBuildOptions()

virtual const BuildOptions & DekiEditor::ITargetBuilder::GetBuildOptions ( ) const
pure virtual

◆ SetPlatformConfig()

virtual void DekiEditor::ITargetBuilder::SetPlatformConfig ( const PlatformConfig & config)
pure virtual

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

Implemented in DekiEditor::FirmwareBuilderBase.

◆ ClearPlatformConfig()

virtual void DekiEditor::ITargetBuilder::ClearPlatformConfig ( )
pure virtual

◆ SetPackageDefines()

virtual void DekiEditor::ITargetBuilder::SetPackageDefines ( const std::vector< std::string > & defines)
pure virtual

Sets the package defines, found by scanning the scenes.

Implemented in DekiEditor::FirmwareBuilderBase.

◆ IsToolchainInstalled()

virtual bool DekiEditor::ITargetBuilder::IsToolchainInstalled ( ) const
pure virtual

True when the required toolchain is installed.

◆ GetToolchainStatus()

virtual std::string DekiEditor::ITargetBuilder::GetToolchainStatus ( ) const
pure virtual

The toolchain's status, as text for the user.

◆ GetToolchainComponents()

virtual std::vector< ToolchainComponent > DekiEditor::ITargetBuilder::GetToolchainComponents ( ) const
inlinevirtual

The toolchain's components and their status.

Reimplemented in DekiEditor::FirmwareBuilderBase.

◆ InstallToolchainComponent()

virtual void DekiEditor::ITargetBuilder::InstallToolchainComponent ( const std::string & componentId,
BuildProgressCallback cb = nullptr )
inlinevirtual

Installs or reinstalls one toolchain component.

Reimplemented in DekiEditor::FirmwareBuilderBase.

◆ SetupToolchainComponent()

virtual void DekiEditor::ITargetBuilder::SetupToolchainComponent ( const std::string & componentId,
BuildProgressCallback cb = nullptr )
inlinevirtual

Runs the postInstall setup script of an installed component.

Reimplemented in DekiEditor::FirmwareBuilderBase.

◆ CheckForToolchainUpdates()

virtual void DekiEditor::ITargetBuilder::CheckForToolchainUpdates ( std::function< void()> onComplete = nullptr)
inlinevirtual

Checks for toolchain updates asynchronously and calls onComplete when done.

Reimplemented in DekiEditor::FirmwareBuilderBase.

◆ IsToolchainBusy()

virtual bool DekiEditor::ITargetBuilder::IsToolchainBusy ( ) const
inlinevirtual

Whether a toolchain install or update check is in progress.

Reimplemented in DekiEditor::FirmwareBuilderBase.

◆ GetEnginePath()

virtual std::string DekiEditor::ITargetBuilder::GetEnginePath ( const std::string & projectPath) const
pure virtual

The engine path for a project.

Implemented in DekiEditor::FirmwareBuilderBase.

◆ GenerateBuildFiles()

virtual bool DekiEditor::ITargetBuilder::GenerateBuildFiles ( const std::string & projectPath,
const PlatformConfig & config,
const std::vector< std::string > & packageDefines )
pure virtual

Generates the build files (CMakeLists.txt, etc.) for config, in the builder's own project structure.

Called on a platform switch and when a project is created.

◆ CreateEditorUI()

virtual std::unique_ptr< IPlatformEditorUI > DekiEditor::ITargetBuilder::CreateEditorUI ( const PlatformConfig & config) const
inlinevirtual

Creates this builder's settings UI for the platform editor, or nullptr if it has none.

The dialog owns the result.

◆ GetName()

virtual const char * DekiEditor::ITargetBuilder::GetName ( ) const
pure virtual

The backend's name, for the user.

◆ DescribePlatform()

virtual std::vector< std::pair< std::string, std::string > > DekiEditor::ITargetBuilder::DescribePlatform ( const PlatformConfig & config) const
inlinevirtual

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.

◆ ValidatePlatform()

virtual std::vector< std::string > DekiEditor::ITargetBuilder::ValidatePlatform ( const PlatformConfig & config) const
inlinevirtual

Problems with a platform aimed at this builder; empty when it is fine.

The backend owns its settings, so it validates them: the editor does not know which chip names a framework accepts, and a new chip is a backend update, not an editor release.

◆ GetFrameworkId()

virtual std::string DekiEditor::ITargetBuilder::GetFrameworkId ( ) const
pure virtual

The build framework this backend serves, as a lowercase id.

This is the dispatch key: a platform names its framework and the registry hands it to whoever claims that id.

Not the vendor family, which cannot tell apart two backends for the same silicon (an app format that runs on a chip, and that chip's own SDK). Not GetPlatformKey() either, which reads the platform config this builder was already given, so it cannot be used to choose the builder.

◆ GetIcon()

virtual const char * DekiEditor::ITargetBuilder::GetIcon ( ) const
inlinevirtual

Optional self-description for the platform editor's builder picker, so a third-party builder is not anonymous in the UI.

◆ GetDescription()

virtual const char * DekiEditor::ITargetBuilder::GetDescription ( ) const
inlinevirtual

◆ GetBuildDirectory()

virtual std::string DekiEditor::ITargetBuilder::GetBuildDirectory ( const std::string & projectPath) const
pure virtual

The builder's build directory for a project.

◆ SupportsSimulation()

virtual bool DekiEditor::ITargetBuilder::SupportsSimulation ( ) const
inlinevirtual

Whether this backend can build a platform's firmware for a simulator (BuildOptions::simulate).

False by default.

◆ GetSimulatorName()

virtual const char * DekiEditor::ITargetBuilder::GetSimulatorName ( ) const
inlinevirtual

The simulator's name, for the UI and the log: "QEMU".

◆ MakeSimulationBootScene()

virtual bool DekiEditor::ITargetBuilder::MakeSimulationBootScene ( std::string & scene,
const PlatformConfig & config,
std::vector< std::string > & notes,
std::string & error ) const
inlinevirtual

Makes the simulated build's boot scene.

scene comes in as the board's boot scene (JSON text; empty when the platform has none) and goes out as the simulated build's: every board step kept, the simulator's own added (AddSimulationSteps), and a step changed where the simulator must run it another way (a card on a bus the simulator does not have). notes says what was done, one line each, for the build log. The editor writes the result under kSimulationSceneDir and the build compiles it; the board's boot scene is never changed, and a real build never sees any of it. False, with error set, when it cannot be made.

◆ GetBootPayloadDirectory()

virtual std::string DekiEditor::ITargetBuilder::GetBootPayloadDirectory ( const std::string & projectPath) const
pure virtual

Where the editor writes the boot payload before Build(): the compiled project settings (dproject.bin) and the platform's boot scene.

What becomes of the directory is up to the backend: packed into a flash filesystem image, copied beside an executable, bundled into an app archive. Empty means this target takes no boot payload, and the editor writes none. Pure virtual on purpose: only the backend knows.

◆ GetPlatformKey()

virtual std::string DekiEditor::ITargetBuilder::GetPlatformKey ( ) const
pure virtual

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

Implemented in DekiEditor::FirmwareBuilderBase.

◆ IsPackageCompatible()

virtual bool DekiEditor::ITargetBuilder::IsPackageCompatible ( const std::string & metadataPath) const
inlinevirtual

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 in DekiEditor::FirmwareBuilderBase.

◆ GetPackageSupportedPlatforms()

virtual std::vector< std::string > DekiEditor::ITargetBuilder::GetPackageSupportedPlatforms ( const std::string & metadataPath) const
inlinevirtual

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 in DekiEditor::FirmwareBuilderBase.


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