A factory class responsible for creating commands for use by the LF code generators.
More...
|
| LFCommand | createCommand (String cmd, List< String > args) |
| | Create a LFCommand instance from a given command and an argument list.
|
| LFCommand | createCommand (String cmd, List< String > args, boolean failOnError) |
| | Create a LFCommand instance from a given command, an argument list and a directory.
|
| LFCommand | createCommand (String cmd, List< String > args, Path dir) |
| | Create a LFCommand instance from a given command, an argument list and a directory.
|
| LFCommand | createCommand (String cmd, List< String > args, Path dir, boolean failOnError) |
| | Create a LFCommand instance from a given command, an argument list and a directory.
|
| | GeneratorCommandFactory (MessageReporter messageReporter, FileConfig fileConfig) |
| void | setQuiet () |
| | enable quiet mode (command output is not printed)
|
| void | setVerbose () |
| | enable verbose mode (command output is printed)
|
A factory class responsible for creating commands for use by the LF code generators.
In addition to the basic functionality of LFCommand, this class additionally ensures that error messages (or optionally warnings) are shown when a command is not found and that certain environment variables are set (see createCommand).
| LFCommand org.lflang.generator.GeneratorCommandFactory.createCommand |
( |
String | cmd, |
|
|
List< String > | args, |
|
|
Path | dir, |
|
|
boolean | failOnError ) |
Create a LFCommand instance from a given command, an argument list and a directory.
This will check first if the command can actually be found and executed. If the command is not found, null is returned. In addition, an error message will be shown if failOnError is true. Otherwise, a warning will be displayed.
- Parameters
-
| cmd | the command to look up |
| args | a list of arguments |
| dir | the directory to execute the command in. If null, this will default to the CWD |
| failOnError | If true, an error is shown if the command cannot be found. Otherwise, only a warning is displayed. |
- Returns
- an LFCommand object or null if the command could not be found
- See also
- LFCommand.get