Skip to content

Commit

Permalink
Revert "Implement dartPluginClass support for plugins (#74469)"
Browse files Browse the repository at this point in the history
This reverts commit b7d4806.

Kick.
  • Loading branch information
zanderso committed Mar 23, 2021
1 parent 4208937 commit be4427a
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 1,466 deletions.
10 changes: 0 additions & 10 deletions dev/devicelab/bin/tasks/dart_plugin_registry_test.dart

This file was deleted.

181 changes: 0 additions & 181 deletions dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart

This file was deleted.

6 changes: 6 additions & 0 deletions dev/prod_builders.json
Expand Up @@ -900,6 +900,12 @@
"task_name": "mac_plugin_test",
"flaky": false
},
{
"name": "Mac dart_plugin_registry_test",
"repo": "flutter",
"task_name": "dart_plugin_registry_test",
"flaky": true
},
{
"name": "Mac tool_tests_general",
"repo": "flutter",
Expand Down
7 changes: 7 additions & 0 deletions dev/try_builders.json
Expand Up @@ -532,6 +532,13 @@
"enabled": true,
"run_if": ["dev/**", "packages/flutter_tools/**", "bin/**"]
},
{
"name": "Mac dart_plugin_registry_test",
"repo": "flutter",
"task_name": "dart_plugin_registry_test",
"enabled": false,
"run_if": ["dev/**", "packages/flutter_tools/**", "bin/**"]
},
{
"name": "Mac tool_tests_general",
"repo": "flutter",
Expand Down
10 changes: 0 additions & 10 deletions packages/flutter_tools/lib/src/build_system/build_system.dart
Expand Up @@ -331,7 +331,6 @@ class Environment {
@required Artifacts artifacts,
@required ProcessManager processManager,
@required String engineVersion,
@required bool generateDartPluginRegistry,
Directory buildDir,
Map<String, String> defines = const <String, String>{},
Map<String, String> inputs = const <String, String>{},
Expand Down Expand Up @@ -371,7 +370,6 @@ class Environment {
processManager: processManager,
engineVersion: engineVersion,
inputs: inputs,
generateDartPluginRegistry: generateDartPluginRegistry,
);
}

Expand All @@ -388,7 +386,6 @@ class Environment {
Map<String, String> defines = const <String, String>{},
Map<String, String> inputs = const <String, String>{},
String engineVersion,
bool generateDartPluginRegistry = false,
@required FileSystem fileSystem,
@required Logger logger,
@required Artifacts artifacts,
Expand All @@ -407,7 +404,6 @@ class Environment {
artifacts: artifacts,
processManager: processManager,
engineVersion: engineVersion,
generateDartPluginRegistry: generateDartPluginRegistry,
);
}

Expand All @@ -425,7 +421,6 @@ class Environment {
@required this.artifacts,
@required this.engineVersion,
@required this.inputs,
@required this.generateDartPluginRegistry,
});

/// The [Source] value which is substituted with the path to [projectDir].
Expand Down Expand Up @@ -503,11 +498,6 @@ class Environment {

/// The version of the current engine, or `null` if built with a local engine.
final String engineVersion;

/// Whether to generate the Dart plugin registry.
/// When [true], the main entrypoint is wrapped and the wrapper becomes
/// the new entrypoint.
final bool generateDartPluginRegistry;
}

/// The result information from the build system.
Expand Down
Expand Up @@ -286,8 +286,6 @@ class KernelSnapshot extends Target {
fileSystemScheme: fileSystemScheme,
dartDefines: decodeDartDefines(environment.defines, kDartDefines),
packageConfig: packageConfig,
buildDir: environment.buildDir,
generateDartPluginRegistry: environment.generateDartPluginRegistry,
);
if (output == null || output.errorCount != 0) {
throw Exception();
Expand Down
1 change: 0 additions & 1 deletion packages/flutter_tools/lib/src/bundle.dart
Expand Up @@ -160,7 +160,6 @@ Future<void> buildWithAssemble({
fileSystem: globals.fs,
logger: globals.logger,
processManager: globals.processManager,
generateDartPluginRegistry: true,
);
final Target target = buildMode == BuildMode.debug
? const CopyFlutterBundle()
Expand Down
3 changes: 1 addition & 2 deletions packages/flutter_tools/lib/src/commands/assemble.dart
Expand Up @@ -241,8 +241,7 @@ class AssembleCommand extends FlutterCommand {
processManager: globals.processManager,
engineVersion: globals.artifacts.isLocalEngine
? null
: globals.flutterVersion.engineRevision,
generateDartPluginRegistry: true,
: globals.flutterVersion.engineRevision
);
return result;
}
Expand Down
Expand Up @@ -385,7 +385,6 @@ end
engineVersion: globals.artifacts.isLocalEngine
? null
: globals.flutterVersion.engineRevision,
generateDartPluginRegistry: true,
);
Target target;
// Always build debug for simulator.
Expand Down
2 changes: 0 additions & 2 deletions packages/flutter_tools/lib/src/commands/packages.dart
Expand Up @@ -119,7 +119,6 @@ class PackagesGetCommand extends FlutterCommand {
outputDir: globals.fs.directory(getBuildDirectory()),
processManager: globals.processManager,
projectDir: flutterProject.directory,
generateDartPluginRegistry: true,
);

await generateLocalizationsSyntheticPackage(
Expand Down Expand Up @@ -325,7 +324,6 @@ class PackagesInteractiveGetCommand extends FlutterCommand {
outputDir: globals.fs.directory(getBuildDirectory()),
processManager: globals.processManager,
projectDir: flutterProject.directory,
generateDartPluginRegistry: true,
);

await generateLocalizationsSyntheticPackage(
Expand Down
23 changes: 2 additions & 21 deletions packages/flutter_tools/lib/src/compile.dart
Expand Up @@ -20,8 +20,6 @@ import 'base/logger.dart';
import 'base/platform.dart';
import 'build_info.dart';
import 'convert.dart';
import 'plugins.dart';
import 'project.dart';

/// The target model describes the set of core libraries that are available within
/// the SDK.
Expand Down Expand Up @@ -231,8 +229,6 @@ class KernelCompiler {
String fileSystemScheme,
String initializeFromDill,
String platformDill,
Directory buildDir,
bool generateDartPluginRegistry = false,
@required String packagesPath,
@required BuildMode buildMode,
@required bool trackWidgetCreation,
Expand All @@ -251,30 +247,14 @@ class KernelCompiler {
throwToolExit('Unable to find Dart binary at $engineDartPath');
}
String mainUri;
final File mainFile = _fileSystem.file(mainPath);
final Uri mainFileUri = mainFile.uri;
final Uri mainFileUri = _fileSystem.file(mainPath).uri;
if (packagesPath != null) {
mainUri = packageConfig.toPackageUri(mainFileUri)?.toString();
}
mainUri ??= toMultiRootPath(mainFileUri, _fileSystemScheme, _fileSystemRoots, _fileSystem.path.separator == r'\');
if (outputFilePath != null && !_fileSystem.isFileSync(outputFilePath)) {
_fileSystem.file(outputFilePath).createSync(recursive: true);
}
if (buildDir != null && generateDartPluginRegistry) {
// `generated_main.dart` is under `.dart_tools/flutter_build/`,
// so the resident compiler can find it.
final File newMainDart = buildDir.parent.childFile('generated_main.dart');
if (await generateMainDartWithPluginRegistrant(
FlutterProject.current(),
packageConfig,
mainUri,
newMainDart,
mainFile,
)) {
mainUri = newMainDart.path;
}
}

final List<String> command = <String>[
engineDartPath,
'--disable-dart-dev',
Expand Down Expand Up @@ -621,6 +601,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
if (!_controller.hasListener) {
_controller.stream.listen(_handleCompilationRequest);
}

final Completer<CompilerOutput> completer = Completer<CompilerOutput>();
_controller.add(
_RecompileRequest(completer, mainUri, invalidatedFiles, outputPath, packageConfig, suppressErrors)
Expand Down

0 comments on commit be4427a

Please sign in to comment.