Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 3f840f5

Browse files
committed
Make separate private constructor for Resolver
1 parent 41ba2c0 commit 3f840f5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

bin/format_coverage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Future<void> main(List<String> arguments) async {
7979
String output;
8080
final resolver = env.bazel
8181
? BazelResolver(workspacePath: env.bazelWorkspace)
82-
: Resolver(
82+
: await Resolver.create(
8383
packagesPath: env.packagesPath,
8484
packagePath: env.packagePath,
8585
sdkRoot: env.sdkRoot,

lib/src/resolver.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import 'package:path/path.dart' as p;
99

1010
/// [Resolver] resolves imports with respect to a given environment.
1111
class Resolver {
12-
Resolver(
12+
@Deprecated('Use Resolver.create')
13+
Resolver({this.packagesPath, this.sdkRoot})
14+
: _packages = packagesPath != null ? _parsePackages(packagesPath) : null,
15+
packagePath = null;
16+
17+
Resolver._(
1318
{this.packagesPath,
1419
this.packagePath,
1520
this.sdkRoot,
@@ -21,7 +26,7 @@ class Resolver {
2126
String? packagePath,
2227
String? sdkRoot,
2328
}) async {
24-
return Resolver(
29+
return Resolver._(
2530
packagesPath: packagesPath,
2631
packagePath: packagePath,
2732
sdkRoot: sdkRoot,

0 commit comments

Comments
 (0)