Upgrading coverage 0.15 to 1
Breaking0.15.2 → 1.16.0Breaking3Platform8Deprecated2New22Changed14Fixed17Other11
BreakingUpgrade verdict
3 breaking changes and 8 platform requirement changes.
In plain terms
- Remove deprecated package_api_docs rule.
- Removed support for SDK 1.x.x.
- Resolving a file path that is not inside a known package, the SDK, or the current directory now fails.
- You need Dart 3.9 or newer to use this version.
Must act Top 5 of 13 that need code or config changes
Dart SDK requirement changed in 1.16.0: >=2.7.0 <3.0.0 → ^3.9.0.
What you must change
Breaking3
Remove deprecated package_api_docs rule.
Removed support for SDK 1.x.x.
Resolver.resolve now rejects file: URIs outside known package/SDK roots or the current directory instead of resolving them unconditionally.
Resolver.resolvePlatform8
Requires Dart 3.9.
Requires Dart ^3.6.0.
Requires Dart ^3.4.
Require Dart 2.18.
Require Dart 3.8.
Require Dart 3.6.
Require Dart 3.2.
Bump the minimum Dart SDK version to 2.15.0.
Deprecations to plan for
Deprecated2
Deprecates
test_wth_coverage's --package-name flag because it doesn't make sense for workspaces.test_wth_coverage--package-nameDeprecate the packagesPath parameter and add packagePath instead, in HitMap.parseJson, HitMap.parseFiles, createHitmap, and parseCoverage.
HitMap.parseJsonHitMap.parseFilescreateHitmapparseCoverageAPI changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- changed:
ctor PrettyPrintFormatter(this.resolver, this.loader, {this.reportOn}) → ctor PrettyPrintFormatter( this.resolver, this.loader, { this.reportOn, this.reportFuncs = …, }) - changed:
ctor Resolver({String packagesPath, this.sdkRoot}) → ctor Resolver({this.packagesPath, this.sdkRoot}) - changed:
field LcovFormatter.basePath: final String → field LcovFormatter.basePath: final String? - changed:
field LcovFormatter.reportOn: final List<String> → field LcovFormatter.reportOn: final List<String>? - changed:
field PrettyPrintFormatter.reportOn: final List<String> → field PrettyPrintFormatter.reportOn: final List<String>? - changed:
field Resolver.packagesPath: final String → field Resolver.packagesPath: final String? - changed:
field Resolver.sdkRoot: final String → field Resolver.sdkRoot: final String? - changed:
function collect(Uri serviceUri, bool resume, bool waitPaused, bool includeDart, Set<String> scopedOutput, {Set<String> isolateIds, Duration timeout}): Future<Map<String, dynamic>> → function collect( Uri serviceUri, bool resume, bool waitPaused, bool includeDart, Set<String>? scopedOutput, { Set<String>? isolateIds, Duration? timeout, bool functionCoverage = …, bool branchCoverage = …, Map<String, Set<int>>? coverableLineCache, VmService? serviceOverrideForTesting, }): Future<Map<String, dynamic>> - changed:
function createHitmap( List<Map<String, dynamic>> jsonResult, { bool checkIgnoredLines = …, String packagesPath, }): Future<Map<String, Map<int, int>>> → function createHitmap( List<Map<String, dynamic>> jsonResult, { bool checkIgnoredLines = …, @Deprecated('Use packagePath') String? packagesPath, String? packagePath, }): Future<Map<String, Map<int, int>>> - changed:
function mergeHitmaps( Map<String, Map<int, int>> newMap, Map<String, Map<int, int>> result): void → function mergeHitmaps( Map<String, Map<int, int>> newMap, Map<String, Map<int, int>> result, ): void - changed:
function parseChromeCoverage( List<Map<String, dynamic>> preciseCoverage, Future<String> Function(String scriptId) sourceProvider, Future<String> Function(String scriptId) sourceMapProvider, Future<Uri> Function(String sourceUrl, String scriptId) sourceUriProvider, ): Future<Map<String, dynamic>> → function parseChromeCoverage( List<Map<String, dynamic>> preciseCoverage, Future<String?> Function(String scriptId) sourceProvider, Future<String?> Function(String scriptId) sourceMapProvider, Future<Uri?> Function(String sourceUrl, String scriptId) sourceUriProvider, ): Future<Map<String, dynamic>> - changed:
function parseCoverage( Iterable<File> files, int _, { bool checkIgnoredLines = …, }): Future<Map<String, Map<int, int>>> → function parseCoverage( Iterable<File> files, int _, { bool checkIgnoredLines = …, @Deprecated('Use packagePath') String? packagesPath, String? packagePath, }): Future<Map<String, Map<int, int>>> - changed:
function runAndCollect(String scriptPath, {List<String> scriptArgs, bool checked = …, bool includeDart = …, Duration timeout}): Future<Map<String, dynamic>> → function runAndCollect( String scriptPath, { List<String>? scriptArgs, bool checked = …, bool includeDart = …, Duration? timeout, }): Future<Map<String, dynamic>> - changed:
method BazelResolver.resolve(String scriptUri): String → method BazelResolver.resolve(String scriptUri): String? - changed:
method Loader.load(String path): Future<List<String>> → method Loader.load(String path): Future<List<String>?> - changed:
method PrettyPrintFormatter.format(Map<String, dynamic> hitmap): Future<String> → method PrettyPrintFormatter.format(Map<String, Map<int, int>> hitmap): Future<String> - changed:
method Resolver.resolve(String scriptUri): String → method Resolver.resolve(String scriptUri): String? - changed:
method Resolver.resolveSymbolicLinks(String path): String → method Resolver.resolveSymbolicLinks(String path): String? - added:
class HitMap - added:
ctor HitMap([ Map<int, int>? lineHits, this.funcHits, this.funcNames, this.branchHits, ]) - added:
ctor HitMap.empty({bool functionCoverage = …, bool branchCoverage = …}) - added:
extension FileHitMaps on Map<String, HitMap> - added:
extension FileHitMapsFormatter on Map<String, HitMap> - added:
extension ResolverPackageUri on Resolver - added:
field HitMap.branchHits: Map<int, int>? - added:
field HitMap.funcHits: Map<int, int>? - added:
field HitMap.funcNames: Map<int, String>? - added:
field HitMap.lineHits: final Map<int, int> - added:
field PrettyPrintFormatter.reportFuncs: final bool - added:
field Resolver.packagePath: final String? - added:
function toScriptCoverageJson(Uri scriptUri, Map<int, int> hitMap): Map<String, dynamic> - added:
method FileHitMaps.filterIgnored({ required Map<String, List<List<int>>?> ignoredLinesInFilesCache, required Resolver resolver, }): Map<String, HitMap> - added:
method FileHitMaps.merge(Map<String, HitMap> newMap): void - added:
method FileHitMapsFormatter.formatLcov( Resolver resolver, { String? basePath, List<String>? reportOn, Set<Glob>? ignoreGlobs, }): String - added:
method FileHitMapsFormatter.prettyPrint( Resolver resolver, Loader loader, { List<String>? reportOn, Set<Glob>? ignoreGlobs, bool reportFuncs = …, bool reportBranches = …, }): Future<String> - added:
method Loader.loadSync(String path): List<String>? - added:
method ResolverPackageUri.toPackageUri(String scriptUri): String - added:
static method HitMap.parseFiles( Iterable<File> files, { bool checkIgnoredLines = …, @Deprecated('Use packagePath') String? packagesPath, String? packagePath, Set<String> scopeOutput = …, }): Future<Map<String, HitMap>> - added:
static method HitMap.parseJson( List<Map<String, dynamic>> jsonResult, { bool checkIgnoredLines = …, @Deprecated('Use packagePath') String? packagesPath, String? packagePath, Set<String> scopeOutput = …, }): Future<Map<String, HitMap>> - added:
static method HitMap.parseJsonSync( List<Map<String, dynamic>> jsonResult, { required bool checkIgnoredLines, required Map<String, List<List<int>>?> ignoredLinesInFilesCache, required Resolver resolver, Set<String> scopeOutput = …, }): Map<String, HitMap> - added:
static method Resolver.create({ String? packagesPath, String? packagePath, String? sdkRoot, }): Future<Resolver>