Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistWorkflow.php
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | abstract class ArcanistWorkflow extends Phobject { | ||||
| private $arcanistConfiguration; | private $arcanistConfiguration; | ||||
| private $parentWorkflow; | private $parentWorkflow; | ||||
| private $workingDirectory; | private $workingDirectory; | ||||
| private $repositoryVersion; | private $repositoryVersion; | ||||
| private $changeCache = array(); | private $changeCache = array(); | ||||
| private $conduitEngine; | private $conduitEngine; | ||||
| private $toolset; | |||||
| private $runtime; | |||||
| private $configurationEngine; | |||||
| private $configurationSourceList; | |||||
| public function __construct() {} | final public function setToolset(ArcanistToolset $toolset) { | ||||
| $this->toolset = $toolset; | |||||
| return $this; | |||||
| } | |||||
| final public function getToolset() { | |||||
| return $this->toolset; | |||||
| } | |||||
| final public function setRuntime(ArcanistRuntime $runtime) { | |||||
| $this->runtime = $runtime; | |||||
| return $this; | |||||
| } | |||||
| final public function getRuntime() { | |||||
| return $this->runtime; | |||||
| } | |||||
| abstract public function run(); | final public function setConfigurationEngine( | ||||
| ArcanistConfigurationEngine $engine) { | |||||
| $this->configurationEngine = $engine; | |||||
| return $this; | |||||
| } | |||||
| final public function getConfigurationEngine() { | |||||
| return $this->configurationEngine; | |||||
| } | |||||
| final public function setConfigurationSourceList( | |||||
| ArcanistConfigurationSourceList $list) { | |||||
| $this->configurationSourceList = $list; | |||||
| return $this; | |||||
| } | |||||
| final public function getConfigurationSourceList() { | |||||
| return $this->configurationSourceList; | |||||
| } | |||||
| public function __construct() {} | |||||
| public function run() { | |||||
| throw new PhutilMethodNotImplementedException(); | |||||
| } | |||||
| /** | /** | ||||
| * Finalizes any cleanup operations that need to occur regardless of | * Finalizes any cleanup operations that need to occur regardless of | ||||
| * whether the command succeeded or failed. | * whether the command succeeded or failed. | ||||
| */ | */ | ||||
| public function finalize() { | public function finalize() { | ||||
| $this->finalizeWorkingCopy(); | $this->finalizeWorkingCopy(); | ||||
| } | } | ||||
| /** | /** | ||||
| * Return the command used to invoke this workflow from the command like, | * Return the command used to invoke this workflow from the command like, | ||||
| * e.g. "help" for @{class:ArcanistHelpWorkflow}. | * e.g. "help" for @{class:ArcanistHelpWorkflow}. | ||||
| * | * | ||||
| * @return string The command a user types to invoke this workflow. | * @return string The command a user types to invoke this workflow. | ||||
| */ | */ | ||||
| abstract public function getWorkflowName(); | abstract public function getWorkflowName(); | ||||
| /** | /** | ||||
| * Return console formatted string with all command synopses. | * Return console formatted string with all command synopses. | ||||
| * | * | ||||
| * @return string 6-space indented list of available command synopses. | * @return string 6-space indented list of available command synopses. | ||||
| */ | */ | ||||
| abstract public function getCommandSynopses(); | public function getCommandSynopses() { | ||||
| return array(); | |||||
| } | |||||
| /** | /** | ||||
| * Return console formatted string with command help printed in `arc help`. | * Return console formatted string with command help printed in `arc help`. | ||||
| * | * | ||||
| * @return string 10-space indented help to use the command. | * @return string 10-space indented help to use the command. | ||||
| */ | */ | ||||
| abstract public function getCommandHelp(); | public function getCommandHelp() { | ||||
| return null; | |||||
| } | |||||
| final public function supportsToolset($toolset) { | public function supportsToolset(ArcanistToolset $toolset) { | ||||
| return ($toolset === 'arc'); | return false; | ||||
| } | } | ||||
| /* -( Conduit )------------------------------------------------------------ */ | /* -( Conduit )------------------------------------------------------------ */ | ||||
| /** | /** | ||||
| * Set the URI which the workflow will open a conduit connection to when | * Set the URI which the workflow will open a conduit connection to when | ||||
| ▲ Show 20 Lines • Show All 2,022 Lines • Show Last 20 Lines | |||||