Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some minor Windows issues #6783

Merged
merged 3 commits into from
Nov 21, 2023
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
3 changes: 3 additions & 0 deletions packages/devtools_shared/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 6.0.2
* Fix an issue parsing file paths on Windows that could prevent extensions from being detected.

# 6.0.1
* Bump minimum Dart SDK version to `3.3.0-91.0.dev` and minimum Flutter SDK version to `3.17.0-0.0.pre`.
* Add field `isPublic` to `DevToolsExtensionConfig`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ExtensionsManager {
try {
extensions = await findExtensions(
'devtools',
packageConfig: Uri.parse(
packageConfig: Uri.file(
path.join(
rootPath,
'.dart_tool',
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_shared/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: devtools_shared
description: Package of shared Dart structures between devtools_app, dds, and other tools.

version: 6.0.1
version: 6.0.2-wip

repository: https://github.com/flutter/devtools/tree/master/packages/devtools_shared

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
setUp(() {
options = DevToolsOptions();
tmpDir = Directory.current.createTempSync();
tmpUri = Uri.parse(tmpDir.path);
tmpUri = Uri.file(tmpDir.path);
});

tearDown(() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ void main() {

Directory _createFromDir() {
final from = Directory('tmp')..createSync();
File.fromUri(Uri.parse(p.join(from.path, 'foo.txt')))..createSync();
File(p.join(from.path, 'foo.txt'))..createSync();
final dir = Directory(p.join(from.path, 'bar'))..createSync();
File.fromUri(Uri.parse(p.join(dir.path, 'baz.txt')))..createSync();
File(p.join(dir.path, 'baz.txt'))..createSync();
final contents = _contentAsOrderedString(from);
expect(
contents,
Expand All @@ -65,5 +65,17 @@ Directory _createToDir() {
String _contentAsOrderedString(Directory dir) {
final contents = dir.listSync(recursive: true)
..sort((a, b) => a.path.compareTo(b.path));
return contents.toString();
return contents
// Always use posix paths so that expectations can be consistent between
// Mac/Windows.
.map(
(e) =>
"${e is Directory ? 'Directory' : 'File'}: '${posixPath(e.path)}'",
)
.toList()
.toString();
}

/// Returns a relative path [input] with posix/forward slashes regardless of
/// the current platform.
String posixPath(String input) => p.posix.joinAll(p.split(input));