[flutter_tools] Update the mapping for the Dart SDK internal URI (#151170)

This changes the mapping for the Dart SDK inside Flutter from `org-dartlang-sdk:///third_party/dart/sdk` to org-dartlang-sdk:///flutter/third_party/dart/sdk`. This URI changed in https://github.com/flutter/engine/pull/51917 but was not caught by tests because they only tested a specific set of mappings and there were no integration tests checking what URIs were actually produced by a running app.

So, this change also adds an integration tests that ensures that a real running app produces URIs that are then correctly mapped.

Fixes https://github.com/Dart-Code/Dart-Code/issues/5164.
This commit is contained in:
Danny Tuppeny
2024-07-02 23:56:17 +01:00
committed by GitHub
parent d0852df663
commit ce0e5c4330
4 changed files with 75 additions and 5 deletions

View File

@@ -100,9 +100,9 @@ abstract class FlutterBaseDebugAdapter extends DartDebugAdapter<FlutterLaunchReq
final String flutterRoot = fileSystem.path.join(flutterSdkRoot, 'bin', 'cache', 'pkg', 'sky_engine', 'lib', 'ui');
orgDartlangSdkMappings[flutterRoot] = Uri.parse('org-dartlang-sdk:///flutter/lib/ui');
// The rest of the Dart SDK maps to /third_party/dart/sdk
// The rest of the Dart SDK maps to /flutter/third_party/dart/sdk
final String dartRoot = fileSystem.path.join(flutterSdkRoot, 'bin', 'cache', 'pkg', 'sky_engine');
orgDartlangSdkMappings[dartRoot] = Uri.parse('org-dartlang-sdk:///third_party/dart/sdk');
orgDartlangSdkMappings[dartRoot] = Uri.parse('org-dartlang-sdk:///flutter/third_party/dart/sdk');
}
@override