|
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
|
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 | Cancel ()=0 |
| Cancels the current operation. | |
| virtual void | CheckForToolchainUpdates (std::function< void()> onComplete=nullptr) |
| Checks for toolchain updates asynchronously and calls onComplete when done. | |
| virtual void | Clean (const std::string &projectPath, BuildOutputCallback outputCallback=nullptr, BuildProgressCallback progressCallback=nullptr)=0 |
| Cleans the build directory. | |
| virtual void | ClearPlatformConfig ()=0 |
| 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 void | Deploy (const std::string &projectPath, const std::string &deployTargetId, BuildOutputCallback outputCallback=nullptr, BuildProgressCallback progressCallback=nullptr) |
| Deploys the last build. | |
| 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< DeployTarget > | EnumerateDeployTargets () const |
| What a deploy can be aimed at right now: serial ports, devkits on the network, paired devices. | |
| 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::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 | GetBuildDirectory (const std::string &projectPath) const =0 |
| The builder's build directory for a project. | |
| virtual const BuildOptions & | GetBuildOptions () const =0 |
| virtual const char * | GetDeployLabel () const |
| The verb for the button and the log: "Flash", "Run", "Install". | |
| virtual const char * | GetDescription () const |
| virtual std::string | GetEnginePath (const std::string &projectPath) const =0 |
| The engine path for a project. | |
| 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 * | GetName () const =0 |
| The backend's name, for the user. | |
| 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". | |
| virtual std::string | GetPlatformKey () const =0 |
| Platform key for resolving dependencies in package.json / .deki-package.json. | |
| virtual BuildProgress | GetProgress () const =0 |
| virtual const char * | GetSimulatorName () const |
| The simulator's name, for the UI and the log: "QEMU". | |
| virtual BuildState | GetState () const =0 |
| virtual std::vector< ToolchainComponent > | GetToolchainComponents () const |
| The toolchain's components and their status. | |
| virtual std::string | GetToolchainStatus () const =0 |
| The toolchain's status, as text for the user. | |
| virtual void | InstallToolchainComponent (const std::string &componentId, BuildProgressCallback cb=nullptr) |
| Installs or reinstalls one toolchain component. | |
| virtual bool | IsBuilding () const =0 |
| 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 bool | IsToolchainBusy () const |
| Whether a toolchain install or update check is in progress. | |
| virtual bool | IsToolchainInstalled () const =0 |
| True when the required toolchain is installed. | |
| virtual bool | MakeSimulationBootScene (std::string &scene, const PlatformConfig &config, std::vector< std::string > ¬es, std::string &error) const |
| Makes the simulated build's boot scene. | |
| virtual void | SetBuildOptions (const BuildOptions &options)=0 |
| virtual void | SetPackageDefines (const std::vector< std::string > &defines)=0 |
| Sets the package defines, found by scanning the scenes. | |
| virtual void | SetPlatformConfig (const PlatformConfig &config)=0 |
| Sets the platform's hardware configuration (display, memory, etc.). | |
| virtual void | SetupToolchainComponent (const std::string &componentId, BuildProgressCallback cb=nullptr) |
| Runs the postInstall setup script of an installed component. | |
| virtual bool | SupportsDeploy () const =0 |
| Whether this target has a deploy step at all. | |
| virtual bool | SupportsSimulation () const |
| Whether this backend can build a platform's firmware for a simulator (BuildOptions::simulate). | |
| virtual std::vector< std::string > | ValidatePlatform (const PlatformConfig &config) const |
| Problems with a platform aimed at this builder; empty when it is fine. | |
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.
|
virtualdefault |
|
pure virtual |
Builds firmware for the project.
|
pure virtual |
Cancels the current operation.
Implemented in DekiEditor::FirmwareBuilderBase.
|
inlinevirtual |
Checks for toolchain updates asynchronously and calls onComplete when done.
Reimplemented in DekiEditor::FirmwareBuilderBase.
|
pure virtual |
Cleans the build directory.
|
pure virtual |
Implemented in DekiEditor::FirmwareBuilderBase.
|
inlinevirtual |
Creates this builder's settings UI for the platform editor, or nullptr if it has none.
The dialog owns the result.
|
inlinevirtual |
Deploys the last build.
deployTargetId is a DeployTarget::id from EnumerateDeployTargets, or empty to let the backend pick.
|
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.
|
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.
|
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.
|
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.
|
pure virtual |
The builder's build directory for a project.
|
pure virtual |
Implemented in DekiEditor::FirmwareBuilderBase.
|
inlinevirtual |
The verb for the button and the log: "Flash", "Run", "Install".
|
inlinevirtual |
|
pure virtual |
The engine path for a project.
Implemented in DekiEditor::FirmwareBuilderBase.
|
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.
|
inlinevirtual |
Optional self-description for the platform editor's builder picker, so a third-party builder is not anonymous in the UI.
|
pure virtual |
The backend's name, for the user.
|
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.
|
pure virtual |
Platform key for resolving dependencies in package.json / .deki-package.json.
Implemented in DekiEditor::FirmwareBuilderBase.
|
pure virtual |
Implemented in DekiEditor::FirmwareBuilderBase.
|
inlinevirtual |
The simulator's name, for the UI and the log: "QEMU".
|
pure virtual |
Implemented in DekiEditor::FirmwareBuilderBase.
|
inlinevirtual |
The toolchain's components and their status.
Reimplemented in DekiEditor::FirmwareBuilderBase.
|
pure virtual |
The toolchain's status, as text for the user.
|
inlinevirtual |
Installs or reinstalls one toolchain component.
Reimplemented in DekiEditor::FirmwareBuilderBase.
|
pure virtual |
Implemented in DekiEditor::FirmwareBuilderBase.
|
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.
|
inlinevirtual |
Whether a toolchain install or update check is in progress.
Reimplemented in DekiEditor::FirmwareBuilderBase.
|
pure virtual |
True when the required toolchain is installed.
|
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.
|
pure virtual |
Implemented in DekiEditor::FirmwareBuilderBase.
|
pure virtual |
Sets the package defines, found by scanning the scenes.
Implemented in DekiEditor::FirmwareBuilderBase.
|
pure virtual |
Sets the platform's hardware configuration (display, memory, etc.).
Implemented in DekiEditor::FirmwareBuilderBase.
|
inlinevirtual |
Runs the postInstall setup script of an installed component.
Reimplemented in DekiEditor::FirmwareBuilderBase.
|
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.
|
inlinevirtual |
Whether this backend can build a platform's firmware for a simulator (BuildOptions::simulate).
False by default.
|
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.