DartSpawner class
- Inheritance
-
- Object
- DartProject
- DartSpawner
Constructors
- DartSpawner({Directory? directory, DartProjectLogger? logger, bool logToConsole = false, Duration? startupTimeout})
- Constructs a new DartSpawner.
Properties
-
exitCode
→ Completer<
int> -
The exit code of the spawned Dart script/file.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
final
- isFinished → bool
-
Returns
trueif the spawned Dart script/file have finished.no setter - isolateCheckPingTimeout → Duration
-
The timeout of an Isolate check.
final
- isSpawned → bool
-
Returns
trueif this instance already have spawned a script.no setter -
projectDirectory
→ FutureOr<
Directory> -
The resolved project Directory.
no setterinherited
-
projectLibraryName
→ FutureOr<
String?> -
The resolved project library name.
no setterinherited
-
projectPackageConfigUri
→ FutureOr<
Uri> -
The resolved project
.dart_tool/package_config.jsonUri.no setterinherited -
projectPackageName
→ FutureOr<
String?> -
The resolved project package name.
no setterinherited
-
projectPubspec
→ FutureOr<
Map< String, dynamic> > -
The resolved project
pubspec.yamlMap.no setterinherited -
projectPubspecFile
→ FutureOr<
File> -
The resolved project
pubspec.yamlFile.no setterinherited -
projectPubspecLock
→ FutureOr<
Map< String, dynamic> > -
The resolved project
pubspec.lockfile asYamlMap.no setterinherited -
projectPubspecLockFile
→ FutureOr<
File> -
The resolved project
pubspec.lockFile.no setterinherited -
projectResolutionDirectory
→ FutureOr<
Directory> -
The directory where
dart pub getwrites the resolution of the project (pubspec.lockand.dart_tool/package_config.json).no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spawnedEntry ↔ Object?
-
The spawned Dart entry.
getter/setter pair
- spawnedType ↔ String?
-
The spawned type.
getter/setter pair
- spawnError → Object?
-
The error that prevented the spawned isolate from starting
(for example an IsolateSpawnException or a TimeoutException),
or
null.no setter - startupTimeout → Duration
-
The timeout to identify the Isolate startup.
final
- uncaughtError → RemoteError?
-
The uncaught error that terminated the spawned isolate, or
null.no setter
Methods
-
cleanDartPubGetGeneratedFiles(
{required String confirmProjectName, bool verbose = false}) → Future< bool> -
Deletes files generated by
dart pub get:inherited -
ensureProjectDependenciesResolved(
) → Future< bool> -
Ensures that projectDirectory has the dependencies resolved.
If not resolved runs
dart pub get, calling runDartPubGet.inherited -
executablePath(
String executableName, {bool refresh = false}) → Future< String?> -
Returns an executable binary path for
executableName.inherited -
existsProjectPackageConfigUri(
) → FutureOr< bool> -
Returns
trueif projectPackageConfigUri exists.inherited -
getProjectDependencyVersion(
String package) → FutureOr< String?> -
Returns the version string of
packageat the target project dependencies.inherited -
isDartFilePath(
dynamic dartEntryPoint) → bool -
Returns
trueifdartEntryPointis a String and a File path with a '.dart' extension. -
launchObservatory(
String url) → Future< ProcessResult> -
Launches the observatory
url. -
log(
String type, dynamic message) → void -
Logs a message.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
projectSubDirectory(
String filePath) → FutureOr< Directory> -
Returns a sub-Directory inside projectDirectory.
inherited
-
projectSubFile(
String filePath) → FutureOr< File> -
Returns a sub-File inside projectDirectory.
inherited
-
projectSubUri(
String filePath) → FutureOr< Uri> -
Returns a sub-Uri inside projectDirectory.
inherited
-
runDartPubGet(
) → Future< bool> -
Runs
dart pub getin the projectDirectory.inherited -
runDartVM(
String entrypoint, List< String> args, {bool enableVMService = false, String? vmServiceAddress, int? vmServicePort, bool pauseIsolatesOnStart = false, bool pauseIsolatesOnExit = false, bool pauseIsolatesOnUnhandledExceptions = false, String? workingDirectory, bool handleSignals = false, bool redirectOutput = false, bool catchOutput = false, bool drainOutput = false, String stdoutFilter(String o)?, String stderrFilter(String o)?, void onSignal(ProcessSignal signal)?}) → Future<ProcessInfo> -
Runs a new Dart VM.
inherited
-
runProcess(
String commandName, List< String> args, {bool resolveCommandPath = true, String? workingDirectory, bool handleSignals = false, bool redirectOutput = false, bool catchOutput = false, bool drainOutput = false, String stdoutFilter(String o)?, String stderrFilter(String o)?, void onSignal(ProcessSignal signal)?}) → Future<ProcessInfo> -
Runs a Process command and returns it.
inherited
-
spawnDart(
dynamic dartEntryPoint, List< String> args, {String? debugName, bool enableObservatory = false, bool runObservatory = false, bool usesSpawnedMain = false}) → Future<SpawnedIsolate> - Spawn a Dart entry point (script, File or Uri).
-
spawnDartFile(
File dartFile, List< String> args, {String? debugName, bool enableObservatory = false, bool runObservatory = false, bool usesSpawnedMain = false}) → Future<SpawnedIsolate> - Spawn a Dart File.
-
spawnDartScript(
String dartScript, List< String> args, {String? debugName, bool enableObservatory = false, bool runObservatory = false, bool usesSpawnedMain = false}) → Future<SpawnedIsolate> - Spawn a Dart script.
-
spawnDartURI(
Uri dartUri, List< String> args, {String? debugName, bool enableObservatory = false, bool runObservatory = false, bool usesSpawnedMain = false}) → Future<SpawnedIsolate> - Spawn a Dart Uri.
-
supportsLaunchObservatory(
) → Future< bool> -
Returns
trueif this environment supports observatory launch. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- debugMode → bool
-
If
truesets the debug mode, to avoid Isolate issues while debugging.final - defaultIsolateCheckPingTimeout → Duration
-
The default Isolate check timeout (see isolateCheckPingTimeout).
final
- defaultStartupTimeout → Duration
-
The default startup timeout.
final
- filePathReservedChars → RegExp
-
final
Static Methods
-
logDebug(
Object? m) → void -
resolveRelativeFileUri(
Uri uri) → Uri -
Resolves a relative file
uri(a relative path without a scheme, asUri.file('bin/main.dart')andUri.parse('bin/main.dart')return) against the current working directory (Directory.current).
Constants
- managedStopTimeout → const Duration
-
How long SpawnedIsolate.stop waits for a managed script
(see
usesSpawnedMain) to run itsstopcallback before killing its isolate. - uncaughtErrorExitCode → const int
-
The exitCode reported when the spawned isolate terminates with an
uncaught error, or fails to start (same exit code the
dartcommand uses for an uncaught exception).