Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/coverage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.14.1-wip

- Remove dependency on `package:pubspec_parse`.

## 1.14.0

- Require Dart ^3.6.0
Expand Down
18 changes: 11 additions & 7 deletions pkgs/coverage/lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'dart:convert';
import 'dart:io';

import 'package:path/path.dart' as path;
import 'package:pubspec_parse/pubspec_parse.dart';
import 'package:vm_service/vm_service.dart';
import 'package:yaml/yaml.dart';

// TODO(cbracken) make generic
/// Retries the specified function with the specified interval and returns
Expand Down Expand Up @@ -174,12 +174,16 @@ List<String> getAllWorkspaceNames(String packageRoot) =>
_getAllWorkspaceNames(packageRoot, <String>[]);

List<String> _getAllWorkspaceNames(String packageRoot, List<String> results) {
final pubspecPath = getPubspecPath(packageRoot);
final yaml = File(pubspecPath).readAsStringSync();
final pubspec = Pubspec.parse(yaml, sourceUrl: Uri.file(pubspecPath));
results.add(pubspec.name);
for (final workspace in pubspec.workspace ?? <String>[]) {
_getAllWorkspaceNames(path.join(packageRoot, workspace), results);
final pubspec = _loadPubspec(packageRoot);
results.add(pubspec['name'] as String);
for (final workspace in pubspec['workspace'] as YamlList? ?? []) {
_getAllWorkspaceNames(path.join(packageRoot, workspace as String), results);
}
return results;
}

YamlMap _loadPubspec(String packageRoot) {
final pubspecPath = getPubspecPath(packageRoot);
final yaml = File(pubspecPath).readAsStringSync();
return loadYaml(yaml, sourceUrl: Uri.file(pubspecPath)) as YamlMap;
}
4 changes: 2 additions & 2 deletions pkgs/coverage/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: coverage
version: 1.14.0
version: 1.14.1-wip
description: Coverage data manipulation and formatting
repository: https://github.com/dart-lang/tools/tree/main/pkgs/coverage
issue_tracker: https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Acoverage
Expand All @@ -15,10 +15,10 @@ dependencies:
meta: ^1.0.2
package_config: ^2.0.0
path: ^1.8.0
pubspec_parse: ^1.5.0
source_maps: ^0.10.10
stack_trace: ^1.10.0
vm_service: '>=12.0.0 <16.0.0'
yaml: ^3.1.3

dev_dependencies:
benchmark_harness: ^2.2.0
Expand Down