Skip to content

Commit 0ab5a3b

Browse files
Fix minor bugs
1 parent f9da8bc commit 0ab5a3b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/cached_build_runner.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ class CachedBuildRunner {
334334
);
335335

336336
dependencies.addAll(importDependency);
337+
testFiles.add(dependencies);
337338
}
338339
}
339340

lib/core/dependency_visitor.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class DependencyVisitor {
1717
final withRegex = RegExp(r"with\s+([\w\s,]+)");
1818

1919
/// Regex for parsing import statements
20-
final importRegex = RegExp(r'''import\s+(?!'package:)(?:'|")(.*?)('|");?''');
20+
final relativeImportRegex = RegExp(r'''import\s+(?!(\w+:))(?:'|")(.*?)('|");?''');
2121
final packageImportRegex = RegExp(
2222
'import\\s+\'package:${Utils.appPackageName}(.*)\';',
2323
);
@@ -76,13 +76,15 @@ class DependencyVisitor {
7676
final lines = dartSource.split('\n');
7777

7878
for (final line in lines) {
79-
final relativeMatch = importRegex.firstMatch(line);
79+
final relativeMatch = relativeImportRegex.firstMatch(line);
8080
final packageMatch = packageImportRegex.firstMatch(line);
8181

8282
if (relativeMatch != null) {
8383
final importedPath = relativeMatch.group(1);
8484
if (importedPath != null) relativeImports.add(importedPath);
85-
} else if (packageMatch != null) {
85+
}
86+
87+
if (packageMatch != null) {
8688
final importedPath = packageMatch.group(1);
8789
if (importedPath != null) absoluteImports.add(importedPath);
8890
}

0 commit comments

Comments
 (0)