Unverified Commit 83da35fb authored by Harry Terkelsen's avatar Harry Terkelsen Committed by GitHub

If there are no web plugins, don't generate a plugin registrant (#39910)

parent b4c36717
...@@ -472,11 +472,9 @@ Future<void> _writeWebPluginRegistrant(FlutterProject project, List<Plugin> plug ...@@ -472,11 +472,9 @@ Future<void> _writeWebPluginRegistrant(FlutterProject project, List<Plugin> plug
final String filePath = fs.path.join(registryDirectory, 'generated_plugin_registrant.dart'); final String filePath = fs.path.join(registryDirectory, 'generated_plugin_registrant.dart');
if (webPlugins.isEmpty) { if (webPlugins.isEmpty) {
final File file = fs.file(filePath); final File file = fs.file(filePath);
file.createSync(recursive: true); if (file.existsSync()) {
file.writeAsStringSync(''' file.deleteSync();
// Generated file. Intentionally left empty due to no web plugins registered. }
void registerPlugins(ignored) {}
''');
} else { } else {
_renderTemplateToFile( _renderTemplateToFile(
_dartPluginRegistryTemplate, _dartPluginRegistryTemplate,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment