Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharkes committed Dec 3, 2024
1 parent 3fea86b commit 51dd61c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,12 @@ ${e.message}
final depFileContents = await depFile.readAsString();
final dartSources = depFileContents
.trim()
// TODO: Deal with '\ ' being part of paths.
.split(' ')
.skip(1) // '<kernel file>:'
.map(Uri.file)
// On windows, unescape backslashes.
.map((e) => Uri.file(e.replaceAll(r'\\', r'\')))
// .map(Uri.file)
.toList();
return dartSources;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,26 @@ void main() async {
expect(
result.dependencies,
containsAll([
tempUri.resolve('native_add/hook/build.dart'),
tempUri.resolve('native_add/src/native_add.c'),
tempUri.resolve('native_subtract/hook/build.dart'),
tempUri.resolve('native_subtract/src/native_subtract.c'),
if (!Platform.isWindows) ...[
tempUri.resolve('native_add/hook/build.dart'),
tempUri.resolve('native_subtract/hook/build.dart'),
],
]),
);
if (Platform.isWindows) {
expect(
// Deps file on windows sometimes have lowercase drive letters.
// File.exists will work, but Uri equality doesn't.
result.dependencies
.map((e) => Uri.file(e.toFilePath().toLowerCase())),
containsAll([
tempUri.resolve('native_add/hook/build.dart'),
tempUri.resolve('native_subtract/hook/build.dart'),
].map((e) => Uri.file(e.toFilePath().toLowerCase()))),
);
}
}
});
});
Expand Down

0 comments on commit 51dd61c

Please sign in to comment.