2#include <NDEVR/GenericOptionGroup.h>
3#include <NDEVR/Model.h>
4#include <NDEVR/ApplicationOptions.h>
5#include <NDEVR/LogStream.h>
6#include "BuildActions.h"
The equivelent of std::vector but with a bit more control.
bool executeChildren(const void *lock_ptr, LogPtr log)
Executes all child actions sequentially.
GenericOptionGroup options() const
Returns the action-specific option group.
Buffer< CommandLineRepresentation > toCommandLine(BuildAction action, bool is_internal=false) const
Converts a specific action type to command-line representations.
void setOptions(const GenericOptionGroup &options)
Sets the action-specific options.
void setOnFailureAction(const OnFailureAction &action)
Sets the on-failure behavior.
bool isSuccess() const
Returns whether this action completed successfully.
void setStartupCriteria(const StringView &label, ExecuteCriteria &criteria, const StringView &value=StringView())
Sets the conditional startup criteria for this action.
BuildActionUIDefinition uiDefinition() const
Returns the UI definition for this action.
void childrenToCommandLine(Buffer< CommandLineRepresentation > &actions, bool is_internal=false) const
Converts all child actions to command-line representations.
Buffer< VariableDefinition > variablesSet() const
Returns all variables set by this action and its children.
BuildActionDefinition()
Default constructor.
GenericOptionGroup getOptions(BuildAction action) const
Returns the option group for a specific action type.
StringView startupCriteriaLabel() const
Returns the startup criteria variable label.
File expandFile(StringView var, bool ignore=false) const
Expands variable references in a file path.
void setOutputLogFile(const File &output_file)
Sets the output log file path for this action.
Buffer< CommandLineRepresentation > toCommandLine(bool is_internal=false) const
Converts this action to command-line representations.
StringView failureKeywords() const
Returns the failure detection keywords.
void setUIDefinition(const BuildActionUIDefinition &def)
Sets the UI definition for this action.
BuildActionDefinition(const Model &model)
Constructs a definition wrapping an existing model.
void setAction(const BuildAction &action)
Sets the build action type.
virtual void setProgress(uint04 id, fltp04 progress) override
Updates the progress for this action in the log stream.
void setFailureKeywords(const StringView &keywords)
Sets keywords that indicate failure when found in output.
void setRunning(const void *lock_ptr)
Marks this action as currently running.
void setDelay(const TimeSpan &delay)
Sets a delay before the action begins execution.
void setupAsRun(const File &location, const StringView &arguments=StringView())
Configures this action as a run operation.
UUID onFailureExecute() const
Returns the UUID of the on-failure action.
StringView successKeywords() const
Returns the success detection keywords.
void toJSON(JSONNode &node)
Serializes this action to a JSON node.
void setVariable(StringView var, StringView value)
Sets a local variable value for this action scope.
bool execute(const void *lock_ptr, LogPtr log=nullptr)
Executes this action synchronously.
void setRetryCount(uint04 retry_count)
Sets the number of retry attempts on failure.
void setBuildProfile(const StringView &profile)
Sets the required build profile for this action.
void executeThreaded(const void *lock_ptr, LogPtr log=nullptr)
Executes this action on a background thread.
void setActive(bool is_active)
Sets the active execution state.
bool readFromLogFile(File file, LogPtr log)
Reads action results from a log file.
void setOnFailureExecute(const UUID &id)
Sets the UUID of an action to execute on failure.
String defaultLogName() const
Returns the default log name for this action.
String expandString(StringView var, bool ignore=false) const
Expands all variable references in a string.
void setupAsGitClone(const File &location, const StringView &repo, const StringView &branch=StringView())
Configures this action as a git clone operation.
BuildActionDefinition createChildBuildDefinition()
Creates a new child build action definition under this one.
StringView startupCriteriaValue() const
Returns the startup criteria comparison value.
void setLaunchOnShow(bool launch_on_show)
Sets whether the action should launch automatically when shown.
void fromJSON(JSONNode &node)
Deserializes this action from a JSON node.
bool isActive() const
Returns whether this action is currently executing.
void callFromCommandLine(LogPtr log)
Executes this action from a command-line invocation.
uint04 retryCount() const
Returns the number of retry attempts.
bool executeOnce(const void *lock_ptr, LogPtr log=nullptr)
Executes this action once (without retries or children).
OnFailureAction failureAction() const
Returns the on-failure behavior.
void setSuccessKeywords(const StringView &keywords)
Sets keywords that indicate success when found in output.
bool launchOnShow() const
Returns whether the action auto-launches when shown.
bool shouldRun(bool ignore_unresolved) const
Evaluates whether this action should run based on its criteria.
ExecuteCriteria startupCriteria() const
Returns the startup criteria type.
void updateEnabledVisual()
Updates the visual enabled/disabled state based on current criteria.
BuildAction action() const
Returns the build action type.
void setIsSuccess(bool is_success, const void *lock_ptr)
Sets the success state of this action.
virtual void addMessage(uint04 id, const LogMessage &message) override
Adds a log message from this action to the log stream.
void setRetryWait(const TimeSpan &span)
Sets the wait duration between retry attempts.
static constexpr StringView TypeName()
Returns the type name used for model registration.
File outputLogFile() const
Returns the output log file path.
TimeSpan retryWait() const
Returns the wait duration between retries.
String expandVar(String var) const
Expands a single variable reference to its value.
bool isFailure() const
Returns whether this action failed.
StringView buildProfile() const
Returns the required build profile.
void setupAsGitPull(const File &location)
Configures this action as a git pull operation.
TimeSpan delay() const
Returns the pre-execution delay.
CommandLineRepresentation()
Default constructor.
String command
The command or executable name.
void toString(String &line) const
Appends the command-line representation to an existing string.
CommandLineRepresentation(const String &command)
Constructs from a full command-line string, parsing command and arguments.
Buffer< String > args
The command-line arguments.
CommandLineRepresentation(const char *command)
Constructs from a C-string command line.
String toString() const
Converts back to a single command-line string.
File file() const
Returns the file path associated with this design object as a File object.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Stores a groups of GenericOptions that can be used to group them.
JavaScript Object Notation or JSON is an open - standard file format that uses human - readable text ...
A class that allows for specific log information to be conveyed to a InfoPipe object including inform...
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
A listener that receives and processes log messages and progress updates from an InfoPipe.
Model()
Default constructor. Creates an uninitialized Model.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Stores a time span, or difference between two times, with an optional start time.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
BuildAction
Enumerates all supported build action types available in the Developer module build workflow system.
ExecuteCriteria
Specifies conditional criteria that determine whether a build action should execute.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
OnFailureAction
Specifies the behavior when a build action fails during workflow execution.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
@ is_active
Whether the effect is currently active.
Describes how a build action should be presented in the application UI, including ribbon and tree pla...
String ribbon_sub_group
The ribbon sub-group name.
bool show_on_ribbon
Whether to show a button on the ribbon.
String ribbon_group
The ribbon group name to place the action in.
bool show_in_tree
Whether to show the action in the scene tree.
bool show_at_bottom_of_tree
Whether to show the action at the bottom of the tree.