Runner
This service is the one that knows how to run a target, so it's in charge of generating the shell commands for it.
Constructor Summary
Public Constructor | ||
public |
constructor(pathUtils: PathUtils, projextPlugin: ProjextPlugin, runnerFile: RunnerFile, targets: Targets) Class constructor. |
Member Summary
Public Members | ||
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A local reference for the |
Method Summary
Public Methods | ||
public |
getCommands(targetName: string, production: boolean, inspect: boolean, runAsPluginCommand: string): string Get the shell execution commands for running a target. |
|
public |
getCommandsForProduction(target: Target): Array Get the list of commands to run a target without projext present. |
|
public |
getCommandsForProjext(targetName: string, production: boolean, inspect: boolean, runAsPluginCommand: string): Array Get the list of comands to run a target with projext. |
|
public |
getEnvironmentVariables(runnerFileContents: RunnerFileContents): string Get a set of environment variables that will be sent to the executables. |
|
public |
getPluginCommandsForProduction(targetName: string): string Get the commands to run a target production build. |
Public Constructors
public constructor(pathUtils: PathUtils, projextPlugin: ProjextPlugin, runnerFile: RunnerFile, targets: Targets) source
Class constructor.
Params:
Name | Type | Attribute | Description |
pathUtils | PathUtils | To create the path for the targets executables. |
|
projextPlugin | ProjextPlugin | To check if projext is present or not and to generated the targets build commands. |
|
runnerFile | RunnerFile | To read the required information to run targets. |
|
targets | Targets | To get the targets information. |
Public Members
Public Methods
public getCommands(targetName: string, production: boolean, inspect: boolean, runAsPluginCommand: string): string source
Get the shell execution commands for running a target.
Params:
Name | Type | Attribute | Description |
targetName | string |
|
The name of the target to run. |
production | boolean | In case projext is present, this flag forces the runner to build the target for production and run that build. |
|
inspect | boolean | Whether or not to enable the Node inspector. |
|
runAsPluginCommand | string | In case |
public getCommandsForProduction(target: Target): Array source
Get the list of commands to run a target without projext present.
Params:
Name | Type | Attribute | Description |
target | Target | The target information. |
public getCommandsForProjext(targetName: string, production: boolean, inspect: boolean, runAsPluginCommand: string): Array source
Get the list of comands to run a target with projext.
Params:
Name | Type | Attribute | Description |
targetName | string |
|
The name of the target to run. |
production | boolean | Forces projext to use the production build. |
|
inspect | boolean | Whether or not to enable the Node inspector. |
|
runAsPluginCommand | string | In case |
public getEnvironmentVariables(runnerFileContents: RunnerFileContents): string source
Get a set of environment variables that will be sent to the executables. For now is just the version of the project.
Params:
Name | Type | Attribute | Description |
runnerFileContents | RunnerFileContents | The contents of the runner file. |
TODO:
- Refactor this. The variables should be configurable.