loadFrom static method

RunSession loadFrom(
  1. String path, {
  2. RunManifestRepository repository = const FileRunManifestRepository(),
})

Loads through an injected repository. load remains the file-backed compatibility entry point.

Implementation

static RunSession loadFrom(
  String path, {
  RunManifestRepository repository = const FileRunManifestRepository(),
}) {
  try {
    return RunSession.fromJson(repository.read(path));
  } on FileSystemException {
    throw RunSessionException(
      'No session manifest at $path. Rebuild with the manifest-emitting '
      'oka pipeline: `oka build apk --debug`.',
    );
  } on FormatException catch (e) {
    throw RunSessionException(
      'Corrupt session manifest at $path ($e). Re-run '
      '`oka build apk --debug` to regenerate it.',
    );
  }
}