Unverified Commit e3247a36 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Revert "Eliminate build aot --interpreter flag (#17025)" (#17032)

Requires a fix to xcode_backend.sh. Will followup momentarily with that
fix.

This reverts commit 8c4f0c0d.
parent 8c4f0c0d
...@@ -20,6 +20,7 @@ import '../version.dart'; ...@@ -20,6 +20,7 @@ import '../version.dart';
import 'context.dart'; import 'context.dart';
import 'file_system.dart'; import 'file_system.dart';
import 'process.dart'; import 'process.dart';
import 'utils.dart' show toTitleCase;
GenSnapshot get genSnapshot => context[GenSnapshot]; GenSnapshot get genSnapshot => context[GenSnapshot];
...@@ -214,11 +215,17 @@ class Snapshotter { ...@@ -214,11 +215,17 @@ class Snapshotter {
@required String depfilePath, @required String depfilePath,
@required String packagesPath, @required String packagesPath,
@required String outputPath, @required String outputPath,
@required bool interpreter,
@required bool previewDart2, @required bool previewDart2,
@required bool preferSharedLibrary, @required bool preferSharedLibrary,
List<String> extraFrontEndOptions: const <String>[], List<String> extraFrontEndOptions: const <String>[],
List<String> extraGenSnapshotOptions: const <String>[], List<String> extraGenSnapshotOptions: const <String>[],
}) async { }) async {
if (!isAotBuildMode(buildMode) && !interpreter) {
printError('${toTitleCase(getModeName(buildMode))} mode does not support AOT compilation.');
return -1;
}
if (!(platform == TargetPlatform.android_arm || if (!(platform == TargetPlatform.android_arm ||
platform == TargetPlatform.android_arm64 || platform == TargetPlatform.android_arm64 ||
platform == TargetPlatform.ios)) { platform == TargetPlatform.ios)) {
...@@ -250,7 +257,6 @@ class Snapshotter { ...@@ -250,7 +257,6 @@ class Snapshotter {
final String ioEntryPoints = artifacts.getArtifactPath(Artifact.dartIoEntriesTxt, platform, buildMode); final String ioEntryPoints = artifacts.getArtifactPath(Artifact.dartIoEntriesTxt, platform, buildMode);
assert(ioEntryPoints != null); assert(ioEntryPoints != null);
final bool interpreter = platform == TargetPlatform.ios && buildMode == BuildMode.debug;
final List<String> entryPointsJsonFiles = <String>[]; final List<String> entryPointsJsonFiles = <String>[];
if (previewDart2 && !interpreter) { if (previewDart2 && !interpreter) {
entryPointsJsonFiles.addAll(<String>[ entryPointsJsonFiles.addAll(<String>[
......
...@@ -26,6 +26,7 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -26,6 +26,7 @@ class BuildAotCommand extends BuildSubCommand {
defaultsTo: 'android-arm', defaultsTo: 'android-arm',
allowed: <String>['android-arm', 'android-arm64', 'ios'] allowed: <String>['android-arm', 'android-arm64', 'ios']
) )
..addFlag('interpreter')
..addFlag('quiet', defaultsTo: false) ..addFlag('quiet', defaultsTo: false)
..addFlag('preview-dart-2', ..addFlag('preview-dart-2',
defaultsTo: true, defaultsTo: true,
...@@ -70,6 +71,7 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -70,6 +71,7 @@ class BuildAotCommand extends BuildSubCommand {
platform, platform,
getBuildMode(), getBuildMode(),
outputPath: argResults['output-dir'], outputPath: argResults['output-dir'],
interpreter: argResults['interpreter'],
previewDart2: argResults['preview-dart-2'], previewDart2: argResults['preview-dart-2'],
extraFrontEndOptions: argResults[FlutterOptions.kExtraFrontEndOptions], extraFrontEndOptions: argResults[FlutterOptions.kExtraFrontEndOptions],
extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions], extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions],
...@@ -96,6 +98,7 @@ Future<String> buildAotSnapshot( ...@@ -96,6 +98,7 @@ Future<String> buildAotSnapshot(
TargetPlatform platform, TargetPlatform platform,
BuildMode buildMode, { BuildMode buildMode, {
String outputPath, String outputPath,
bool interpreter: false,
bool previewDart2: false, bool previewDart2: false,
List<String> extraFrontEndOptions, List<String> extraFrontEndOptions,
List<String> extraGenSnapshotOptions, List<String> extraGenSnapshotOptions,
...@@ -111,6 +114,7 @@ Future<String> buildAotSnapshot( ...@@ -111,6 +114,7 @@ Future<String> buildAotSnapshot(
depfilePath: 'depFilePathGoesHere', depfilePath: 'depFilePathGoesHere',
packagesPath: PackageMap.globalPackagesPath, packagesPath: PackageMap.globalPackagesPath,
outputPath: outputPath, outputPath: outputPath,
interpreter: interpreter,
previewDart2: previewDart2, previewDart2: previewDart2,
preferSharedLibrary: preferSharedLibrary, preferSharedLibrary: preferSharedLibrary,
extraFrontEndOptions: extraFrontEndOptions, extraFrontEndOptions: extraFrontEndOptions,
......
...@@ -676,6 +676,7 @@ void main() { ...@@ -676,6 +676,7 @@ void main() {
depfilePath: fs.path.join(outputPath, 'snapshot.d'), depfilePath: fs.path.join(outputPath, 'snapshot.d'),
packagesPath: '.packages', packagesPath: '.packages',
outputPath: outputPath, outputPath: outputPath,
interpreter: true,
preferSharedLibrary: false, preferSharedLibrary: false,
previewDart2: true, previewDart2: true,
); );
...@@ -721,6 +722,7 @@ void main() { ...@@ -721,6 +722,7 @@ void main() {
depfilePath: fs.path.join(outputPath, 'snapshot.d'), depfilePath: fs.path.join(outputPath, 'snapshot.d'),
packagesPath: '.packages', packagesPath: '.packages',
outputPath: outputPath, outputPath: outputPath,
interpreter: false,
preferSharedLibrary: false, preferSharedLibrary: false,
previewDart2: true, previewDart2: true,
); );
...@@ -768,6 +770,7 @@ void main() { ...@@ -768,6 +770,7 @@ void main() {
depfilePath: fs.path.join(outputPath, 'snapshot.d'), depfilePath: fs.path.join(outputPath, 'snapshot.d'),
packagesPath: '.packages', packagesPath: '.packages',
outputPath: outputPath, outputPath: outputPath,
interpreter: false,
preferSharedLibrary: false, preferSharedLibrary: false,
previewDart2: true, previewDart2: true,
); );
......
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