resolve method

Implementation

@override
Future<ResolvedPrebuilt?> resolve(PrebuiltResolutionContext context) async {
  final pathUri = context.input.userDefines.path(key);
  if (pathUri == null) return null;

  final file = File(pathUri.toFilePath());
  if (!file.existsSync()) {
    return ResolvedPrebuiltNotFound(
      reason: 'user_defines $key points to non-existent file: $pathUri',
      attempts: [
        ResolutionAttempt(
          source: PrebuiltSource.userDefine,
          success: false,
          path: pathUri.toFilePath(),
          error: 'File not found',
        ),
      ],
    );
  }

  final hash = await ArchiveReader.sha256Hash(file);
  return ResolvedPrebuiltFound(
    file: ResolvedFile(path: file.path, hash: hash),
    source: PrebuiltSource.userDefine,
  );
}