ShellScripts class
Annotation to specify configuration for generating Dart classes that interface with shell scripts.
Apply this annotation to a class to indicate that it should be associated with shell script files, and to configure code generation options such as the scripts path, parameter support, and method prefix.
Example usage:
@ShellScripts(
scriptsPath: 'assets/scripts', // Path relative to project root
enableParameters: true,
methodPrefix: 'run',
)
class MyShellScripts {}
The generated class will be named based on the annotated class name with "Scripts" suffix.
For example, if applied to MyShellScripts
, the generated class will be MyShellScriptsScripts
.
- scriptsPath: Path to the folder containing
.sh
files, relative to the project root. - enableParameters: Whether to enable parameter support via
getopts
in the generated methods. Defaults totrue
. - methodPrefix: Prefix for the generated methods that access scripts. Defaults to
'get'
.
- Annotations
-
- @Target({TargetKind.classType})
Constructors
- ShellScripts.new({required String scriptsPath, bool enableParameters = true, String methodPrefix = 'get'})
-
Creates a ShellScripts annotation.
const
Properties
- enableParameters → bool
-
Whether to enable parameter support via getopts
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- methodPrefix → String
-
Prefix for methods accessing scripts
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scriptsPath → String
-
Path to the folder with .sh files, relative to the project root.
This path is treated as an asset path (e.g., 'assets/scripts').
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited