Revert "[flutter_tools] Removes the need of a no-op plugin implementations (#48614)" (#49005)

This reverts commit 5eb394e084.
This commit is contained in:
Jenn Magder
2020-01-16 16:19:54 -08:00
committed by GitHub
parent 01f19ee6d4
commit b225cb8d53
5 changed files with 92 additions and 356 deletions

View File

@@ -3,7 +3,6 @@
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter_devicelab/framework/framework.dart';
@@ -75,6 +74,10 @@ Future<void> main() async {
);
});
// https://github.com/flutter/flutter/issues/46898
// https://github.com/flutter/flutter/issues/39657
File(path.join(pluginCDirectory.path, 'android', 'build.gradle')).deleteSync();
final File pluginCpubspec = File(path.join(pluginCDirectory.path, 'pubspec.yaml'));
await pluginCpubspec.writeAsString('''
name: plugin_c
@@ -174,32 +177,30 @@ public class DummyPluginAClass {
}
final String flutterPluginsDependenciesFileContent = flutterPluginsDependenciesFile.readAsStringSync();
final Map<String, dynamic> jsonContent = json.decode(flutterPluginsDependenciesFileContent) as Map<String, dynamic>;
// Verify the dependencyGraph object is valid. The rest of the contents of this file are not relevant to the
// dependency graph and are tested by unit tests.
final List<dynamic> dependencyGraph = jsonContent['dependencyGraph'] as List<dynamic>;
const String kExpectedPluginsDependenciesContent =
'['
'{'
'\"name\":\"plugin_a\",'
'\"dependencies\":[\"plugin_b\",\"plugin_c\"]'
'},'
'{'
'\"name\":\"plugin_b\",'
'\"dependencies\":[]'
'},'
'{'
'\"name\":\"plugin_c\",'
'\"dependencies\":[]'
'}'
']';
final String graphString = json.encode(dependencyGraph);
if (graphString != kExpectedPluginsDependenciesContent) {
'{'
'\"_info\":\"// This is a generated file; do not edit or check into version control.\",'
'\"dependencyGraph\":['
'{'
'\"name\":\"plugin_a\",'
'\"dependencies\":[\"plugin_b\",\"plugin_c\"]'
'},'
'{'
'\"name\":\"plugin_b\",'
'\"dependencies\":[]'
'},'
'{'
'\"name\":\"plugin_c\",'
'\"dependencies\":[]'
'}'
']'
'}';
if (flutterPluginsDependenciesFileContent != kExpectedPluginsDependenciesContent) {
return TaskResult.failure(
'Unexpected file content in ${flutterPluginsDependenciesFile.path}: '
'Found "$graphString" instead of "$kExpectedPluginsDependenciesContent"'
'Found "$flutterPluginsDependenciesFileContent" instead of '
'"$kExpectedPluginsDependenciesContent"'
);
}