CiRun constructor

CiRun({
  1. required String toolName,
  2. required String repositoryRoot,
  3. required String lockPath,
  4. required Map<String, String> stageDescriptions,
  5. required CiStageRunner runStage,
  6. required StringSink console,
  7. String? logRoot,
  8. String? runDir,
  9. String? flutter,
  10. String? dart,
  11. String? findFlutter() = ciFlutterExecutable,
})

Implementation

CiRun({
  required this.toolName,
  required this.repositoryRoot,
  required this.lockPath,
  required this.stageDescriptions,
  required this.runStage,
  required this.console,
  String? logRoot,
  String? runDir,
  String? flutter,
  String? dart,
  String? Function() findFlutter = ciFlutterExecutable,
}) : runDir =
         runDir ??
         p.join(
           logRoot ?? p.join(repositoryRoot, 'testlog'),
           ciTimestamp(DateTime.now()),
         ),
     dart = dart ?? ciDartExecutable(),
     flutter = flutter ?? findFlutter() {
  runner = CiProcessRunner(
    lock: CiLock(lockPath),
    pathPrefix: this.flutter == null ? null : p.dirname(this.flutter!),
    onLockWait: (waited) => console.write(
      '\n    waiting for $lockPath (${formatCiDuration(waited)}) — another '
      'session runs flutter',
    ),
  );
}