diff --git a/packages/devtools_shared/CHANGELOG.md b/packages/devtools_shared/CHANGELOG.md index cdaa12e1c9f..538f740e448 100644 --- a/packages/devtools_shared/CHANGELOG.md +++ b/packages/devtools_shared/CHANGELOG.md @@ -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`. diff --git a/packages/devtools_shared/lib/src/extensions/extension_manager.dart b/packages/devtools_shared/lib/src/extensions/extension_manager.dart index ba3c45eea65..0d097f0ebba 100644 --- a/packages/devtools_shared/lib/src/extensions/extension_manager.dart +++ b/packages/devtools_shared/lib/src/extensions/extension_manager.dart @@ -61,7 +61,7 @@ class ExtensionsManager { try { extensions = await findExtensions( 'devtools', - packageConfig: Uri.parse( + packageConfig: Uri.file( path.join( rootPath, '.dart_tool', diff --git a/packages/devtools_shared/pubspec.yaml b/packages/devtools_shared/pubspec.yaml index 76a3161e9cc..faf53aceb18 100644 --- a/packages/devtools_shared/pubspec.yaml +++ b/packages/devtools_shared/pubspec.yaml @@ -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 diff --git a/packages/devtools_shared/test/extensions/extension_enablement_test.dart b/packages/devtools_shared/test/extensions/extension_enablement_test.dart index adeabda69da..9adb3cc7b7a 100644 --- a/packages/devtools_shared/test/extensions/extension_enablement_test.dart +++ b/packages/devtools_shared/test/extensions/extension_enablement_test.dart @@ -17,7 +17,7 @@ void main() { setUp(() { options = DevToolsOptions(); tmpDir = Directory.current.createTempSync(); - tmpUri = Uri.parse(tmpDir.path); + tmpUri = Uri.file(tmpDir.path); }); tearDown(() { diff --git a/packages/devtools_shared/test/extensions/extension_manager_test.dart b/packages/devtools_shared/test/extensions/extension_manager_test.dart index 64c7438807c..342fee77a1b 100644 --- a/packages/devtools_shared/test/extensions/extension_manager_test.dart +++ b/packages/devtools_shared/test/extensions/extension_manager_test.dart @@ -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, @@ -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));