[tool][web] Create an early web plugin_registrant for dartpad. (#106921)
This commit is contained in:
@@ -1106,6 +1106,11 @@ Future<void> refreshPluginsList(
|
||||
///
|
||||
/// In the Web platform, `destination` can point to a real filesystem (`flutter build`)
|
||||
/// or an in-memory filesystem (`flutter run`).
|
||||
///
|
||||
/// This method is also used by [WebProject.ensureReadyForPlatformSpecificTooling]
|
||||
/// to inject a copy of the plugin registrant for web into .dart_tool/dartpad so
|
||||
/// dartpad can get the plugin registrant without needing to build the complete
|
||||
/// project. See: https://github.com/dart-lang/dart-services/pull/874
|
||||
Future<void> injectBuildTimePluginFiles(
|
||||
FlutterProject project, {
|
||||
required Directory destination,
|
||||
|
||||
@@ -734,7 +734,20 @@ class WebProject extends FlutterProjectPlatform {
|
||||
.childDirectory('web')
|
||||
.childFile('index.html');
|
||||
|
||||
Future<void> ensureReadyForPlatformSpecificTooling() async {}
|
||||
/// The .dart_tool/dartpad directory
|
||||
Directory get dartpadToolDirectory => parent.directory
|
||||
.childDirectory('.dart_tool')
|
||||
.childDirectory('dartpad');
|
||||
|
||||
Future<void> ensureReadyForPlatformSpecificTooling() async {
|
||||
/// Create .dart_tool/dartpad/web_plugin_registrant.dart.
|
||||
/// See: https://github.com/dart-lang/dart-services/pull/874
|
||||
await injectBuildTimePluginFiles(
|
||||
parent,
|
||||
destination: dartpadToolDirectory,
|
||||
webPlatform: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// The Fuchsia sub project.
|
||||
|
||||
Reference in New Issue
Block a user