Unverified Commit 041ff621 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Eliminate --preview-dart-2 flag (#21304)

This patch eliminates the --preview-dart-2/--no-preview-dart-2 flag,
hardcoding all uses to true. It also defaults all previewDart2 method
parameters to true, where they hadn't yet been.

A series of subsequent patches will eliminate all previewDart2
parameters and the associated code from within the codebase.
parent db7aa6a0
...@@ -112,13 +112,6 @@ BuildApp() { ...@@ -112,13 +112,6 @@ BuildApp() {
local_engine_flag="--local-engine=$LOCAL_ENGINE" local_engine_flag="--local-engine=$LOCAL_ENGINE"
fi fi
local preview_dart_2_flag=""
if [[ -n "$PREVIEW_DART_2" ]]; then
preview_dart_2_flag="--preview-dart-2"
else
preview_dart_2_flag="--no-preview-dart-2"
fi
local track_widget_creation_flag="" local track_widget_creation_flag=""
if [[ -n "$TRACK_WIDGET_CREATION" ]]; then if [[ -n "$TRACK_WIDGET_CREATION" ]]; then
track_widget_creation_flag="--track-widget-creation" track_widget_creation_flag="--track-widget-creation"
...@@ -137,7 +130,6 @@ BuildApp() { ...@@ -137,7 +130,6 @@ BuildApp() {
--${build_mode} \ --${build_mode} \
--ios-arch="${archs}" \ --ios-arch="${archs}" \
${local_engine_flag} \ ${local_engine_flag} \
${preview_dart_2_flag} \
${track_widget_creation_flag} ${track_widget_creation_flag}
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
...@@ -190,7 +182,6 @@ BuildApp() { ...@@ -190,7 +182,6 @@ BuildApp() {
--asset-dir="${derived_dir}/flutter_assets" \ --asset-dir="${derived_dir}/flutter_assets" \
${precompilation_flag} \ ${precompilation_flag} \
${local_engine_flag} \ ${local_engine_flag} \
${preview_dart_2_flag} \
${track_widget_creation_flag} ${track_widget_creation_flag}
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
......
...@@ -284,10 +284,6 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -284,10 +284,6 @@ class FlutterPlugin implements Plugin<Project> {
if (project.hasProperty('verbose')) { if (project.hasProperty('verbose')) {
verboseValue = project.property('verbose').toBoolean() verboseValue = project.property('verbose').toBoolean()
} }
Boolean previewDart2Value = true
if (project.hasProperty('preview-dart-2')) {
previewDart2Value = project.property('preview-dart-2').toBoolean()
}
String[] fileSystemRootsValue = null String[] fileSystemRootsValue = null
if (project.hasProperty('filesystem-roots')) { if (project.hasProperty('filesystem-roots')) {
fileSystemRootsValue = project.property('filesystem-roots').split('\\|') fileSystemRootsValue = project.property('filesystem-roots').split('\\|')
...@@ -342,7 +338,6 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -342,7 +338,6 @@ class FlutterPlugin implements Plugin<Project> {
localEngineSrcPath this.localEngineSrcPath localEngineSrcPath this.localEngineSrcPath
targetPath target targetPath target
verbose verboseValue verbose verboseValue
previewDart2 previewDart2Value
fileSystemRoots fileSystemRootsValue fileSystemRoots fileSystemRootsValue
fileSystemScheme fileSystemSchemeValue fileSystemScheme fileSystemSchemeValue
trackWidgetCreation trackWidgetCreationValue trackWidgetCreation trackWidgetCreationValue
...@@ -388,8 +383,6 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -388,8 +383,6 @@ abstract class BaseFlutterTask extends DefaultTask {
@Optional @Input @Optional @Input
Boolean verbose Boolean verbose
@Optional @Input @Optional @Input
Boolean previewDart2
@Optional @Input
String[] fileSystemRoots String[] fileSystemRoots
@Optional @Input @Optional @Input
String fileSystemScheme String fileSystemScheme
...@@ -411,12 +404,11 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -411,12 +404,11 @@ abstract class BaseFlutterTask extends DefaultTask {
@OutputFiles @OutputFiles
FileCollection getDependenciesFiles() { FileCollection getDependenciesFiles() {
FileCollection depfiles = project.files() FileCollection depfiles = project.files()
if (previewDart2) {
// For Dart 2, also include the kernel compiler depfile, since // Include the kernel compiler depfile, since kernel compile is the
// kernel compile is the first stage of AOT build in this mode, // first stage of AOT build in this mode, and it includes all the Dart
// and it includes all the Dart sources. // sources.
depfiles += project.files("${intermediateDir}/kernel_compile.d") depfiles += project.files("${intermediateDir}/kernel_compile.d")
}
// Include Core JIT kernel compiler depfile, since kernel compile is // Include Core JIT kernel compiler depfile, since kernel compile is
// the first stage of JIT builds in this mode, and it includes all the // the first stage of JIT builds in this mode, and it includes all the
...@@ -446,11 +438,6 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -446,11 +438,6 @@ abstract class BaseFlutterTask extends DefaultTask {
args "--target", targetPath args "--target", targetPath
args "--target-platform", "android-arm" args "--target-platform", "android-arm"
args "--output-dir", "${intermediateDir}" args "--output-dir", "${intermediateDir}"
if (previewDart2) {
args "--preview-dart-2"
} else {
args "--no-preview-dart-2"
}
if (trackWidgetCreation) { if (trackWidgetCreation) {
args "--track-widget-creation" args "--track-widget-creation"
} }
...@@ -483,11 +470,6 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -483,11 +470,6 @@ abstract class BaseFlutterTask extends DefaultTask {
if (verbose) { if (verbose) {
args "--verbose" args "--verbose"
} }
if (previewDart2) {
args "--preview-dart-2"
} else {
args "--no-preview-dart-2"
}
if (fileSystemRoots != null) { if (fileSystemRoots != null) {
for (root in fileSystemRoots) { for (root in fileSystemRoots) {
args "--filesystem-root", root args "--filesystem-root", root
...@@ -515,9 +497,6 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -515,9 +497,6 @@ abstract class BaseFlutterTask extends DefaultTask {
args "--precompiled" args "--precompiled"
} else { } else {
args "--depfile", "${intermediateDir}/snapshot_blob.bin.d" args "--depfile", "${intermediateDir}/snapshot_blob.bin.d"
if (!previewDart2) {
args "--snapshot", "${intermediateDir}/snapshot_blob.bin"
}
} }
args "--asset-dir", "${intermediateDir}/flutter_assets" args "--asset-dir", "${intermediateDir}/flutter_assets"
if (buildMode == "debug") { if (buildMode == "debug") {
...@@ -585,9 +564,7 @@ class FlutterTask extends BaseFlutterTask { ...@@ -585,9 +564,7 @@ class FlutterTask extends BaseFlutterTask {
// We have a dependencies file. Add a dependency on gen_snapshot as well, since the // We have a dependencies file. Add a dependency on gen_snapshot as well, since the
// snapshots have to be rebuilt if it changes. // snapshots have to be rebuilt if it changes.
sources += readDependencies(project.file("${intermediateDir}/gen_snapshot.d")) sources += readDependencies(project.file("${intermediateDir}/gen_snapshot.d"))
if (previewDart2) { sources += readDependencies(project.file("${intermediateDir}/frontend_server.d"))
sources += readDependencies(project.file("${intermediateDir}/frontend_server.d"))
}
if (localEngineSrcPath != null) { if (localEngineSrcPath != null) {
sources += project.files("$localEngineSrcPath/$localEngine") sources += project.files("$localEngineSrcPath/$localEngine")
} }
......
...@@ -353,23 +353,18 @@ Future<Null> _buildGradleProjectV2( ...@@ -353,23 +353,18 @@ Future<Null> _buildGradleProjectV2(
if (target != null) { if (target != null) {
command.add('-Ptarget=$target'); command.add('-Ptarget=$target');
} }
if (buildInfo.previewDart2) { if (buildInfo.trackWidgetCreation)
command.add('-Ppreview-dart-2=true'); command.add('-Ptrack-widget-creation=true');
if (buildInfo.trackWidgetCreation) if (buildInfo.compilationTraceFilePath != null)
command.add('-Ptrack-widget-creation=true'); command.add('-Pprecompile=${buildInfo.compilationTraceFilePath}');
if (buildInfo.compilationTraceFilePath != null) if (buildInfo.extraFrontEndOptions != null)
command.add('-Pprecompile=${buildInfo.compilationTraceFilePath}'); command.add('-Pextra-front-end-options=${buildInfo.extraFrontEndOptions}');
if (buildInfo.extraFrontEndOptions != null) if (buildInfo.extraGenSnapshotOptions != null)
command.add('-Pextra-front-end-options=${buildInfo.extraFrontEndOptions}'); command.add('-Pextra-gen-snapshot-options=${buildInfo.extraGenSnapshotOptions}');
if (buildInfo.extraGenSnapshotOptions != null) if (buildInfo.fileSystemRoots != null && buildInfo.fileSystemRoots.isNotEmpty)
command.add('-Pextra-gen-snapshot-options=${buildInfo.extraGenSnapshotOptions}'); command.add('-Pfilesystem-roots=${buildInfo.fileSystemRoots.join('|')}');
if (buildInfo.fileSystemRoots != null && buildInfo.fileSystemRoots.isNotEmpty) if (buildInfo.fileSystemScheme != null)
command.add('-Pfilesystem-roots=${buildInfo.fileSystemRoots.join('|')}'); command.add('-Pfilesystem-scheme=${buildInfo.fileSystemScheme}');
if (buildInfo.fileSystemScheme != null)
command.add('-Pfilesystem-scheme=${buildInfo.fileSystemScheme}');
} else {
command.add('-Ppreview-dart-2=false');
}
if (buildInfo.buildSharedLibrary && androidSdk.ndk != null) { if (buildInfo.buildSharedLibrary && androidSdk.ndk != null) {
command.add('-Pbuild-shared-library=true'); command.add('-Pbuild-shared-library=true');
} }
......
...@@ -11,7 +11,7 @@ import 'globals.dart'; ...@@ -11,7 +11,7 @@ import 'globals.dart';
/// Information about a build to be performed or used. /// Information about a build to be performed or used.
class BuildInfo { class BuildInfo {
const BuildInfo(this.mode, this.flavor, { const BuildInfo(this.mode, this.flavor, {
this.previewDart2 = false, this.previewDart2 = true,
this.trackWidgetCreation = false, this.trackWidgetCreation = false,
this.compilationTraceFilePath, this.compilationTraceFilePath,
this.extraFrontEndOptions, this.extraFrontEndOptions,
......
...@@ -43,7 +43,7 @@ Future<void> build({ ...@@ -43,7 +43,7 @@ Future<void> build({
String privateKeyPath = defaultPrivateKeyPath, String privateKeyPath = defaultPrivateKeyPath,
String assetDirPath, String assetDirPath,
String packagesPath, String packagesPath,
bool previewDart2 = false, bool previewDart2 = true,
bool precompiledSnapshot = false, bool precompiledSnapshot = false,
bool reportLicensedPackages = false, bool reportLicensedPackages = false,
bool trackWidgetCreation = false, bool trackWidgetCreation = false,
......
...@@ -47,11 +47,6 @@ class AttachCommand extends FlutterCommand { ...@@ -47,11 +47,6 @@ class AttachCommand extends FlutterCommand {
'project-root', 'project-root',
hide: !verboseHelp, hide: !verboseHelp,
help: 'Normally used only in run target', help: 'Normally used only in run target',
)..addFlag(
'preview-dart-2',
defaultsTo: true,
hide: !verboseHelp,
help: 'Preview Dart 2.0 functionality.',
)..addFlag('machine', )..addFlag('machine',
hide: !verboseHelp, hide: !verboseHelp,
negatable: false, negatable: false,
...@@ -124,7 +119,7 @@ class AttachCommand extends FlutterCommand { ...@@ -124,7 +119,7 @@ class AttachCommand extends FlutterCommand {
final FlutterDevice flutterDevice = new FlutterDevice( final FlutterDevice flutterDevice = new FlutterDevice(
device, device,
trackWidgetCreation: false, trackWidgetCreation: false,
previewDart2: argResults['preview-dart-2'], previewDart2: true,
dillOutputPath: argResults['output-dill'], dillOutputPath: argResults['output-dill'],
fileSystemRoots: argResults['filesystem-root'], fileSystemRoots: argResults['filesystem-root'],
fileSystemScheme: argResults['filesystem-scheme'], fileSystemScheme: argResults['filesystem-scheme'],
......
...@@ -19,8 +19,8 @@ import 'build_ios.dart'; ...@@ -19,8 +19,8 @@ import 'build_ios.dart';
class BuildCommand extends FlutterCommand { class BuildCommand extends FlutterCommand {
BuildCommand({bool verboseHelp = false}) { BuildCommand({bool verboseHelp = false}) {
addSubcommand(new BuildApkCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildApkCommand(verboseHelp: verboseHelp));
addSubcommand(new BuildAotCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildAotCommand());
addSubcommand(new BuildIOSCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildIOSCommand());
addSubcommand(new BuildFlxCommand()); addSubcommand(new BuildFlxCommand());
addSubcommand(new BuildBundleCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildBundleCommand(verboseHelp: verboseHelp));
} }
......
...@@ -17,7 +17,7 @@ import '../runner/flutter_command.dart'; ...@@ -17,7 +17,7 @@ import '../runner/flutter_command.dart';
import 'build.dart'; import 'build.dart';
class BuildAotCommand extends BuildSubCommand { class BuildAotCommand extends BuildSubCommand {
BuildAotCommand({bool verboseHelp = false}) { BuildAotCommand() {
usesTargetOption(); usesTargetOption();
addBuildModeFlags(); addBuildModeFlags();
usesPubOption(); usesPubOption();
...@@ -28,11 +28,6 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -28,11 +28,6 @@ class BuildAotCommand extends BuildSubCommand {
allowed: <String>['android-arm', 'android-arm64', 'ios'] allowed: <String>['android-arm', 'android-arm64', 'ios']
) )
..addFlag('quiet', defaultsTo: false) ..addFlag('quiet', defaultsTo: false)
..addFlag('preview-dart-2',
defaultsTo: true,
hide: !verboseHelp,
help: 'Preview Dart 2.0 functionality.',
)
..addFlag('build-shared-library', ..addFlag('build-shared-library',
negatable: false, negatable: false,
defaultsTo: false, defaultsTo: false,
...@@ -81,23 +76,20 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -81,23 +76,20 @@ class BuildAotCommand extends BuildSubCommand {
} }
final String outputPath = argResults['output-dir'] ?? getAotBuildDirectory(); final String outputPath = argResults['output-dir'] ?? getAotBuildDirectory();
try { try {
final bool previewDart2 = argResults['preview-dart-2'];
String mainPath = findMainDartFile(targetFile); String mainPath = findMainDartFile(targetFile);
final AOTSnapshotter snapshotter = new AOTSnapshotter(); final AOTSnapshotter snapshotter = new AOTSnapshotter();
// Compile to kernel, if Dart 2. // Compile to kernel.
if (previewDart2) { mainPath = await snapshotter.compileKernel(
mainPath = await snapshotter.compileKernel( platform: platform,
platform: platform, buildMode: buildMode,
buildMode: buildMode, mainPath: mainPath,
mainPath: mainPath, outputPath: outputPath,
outputPath: outputPath, extraFrontEndOptions: argResults[FlutterOptions.kExtraFrontEndOptions],
extraFrontEndOptions: argResults[FlutterOptions.kExtraFrontEndOptions], );
); if (mainPath == null) {
if (mainPath == null) { throwToolExit('Compiler terminated unexpectedly.');
throwToolExit('Compiler terminated unexpectedly.'); return;
return;
}
} }
// Build AOT snapshot. // Build AOT snapshot.
...@@ -118,7 +110,7 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -118,7 +110,7 @@ class BuildAotCommand extends BuildSubCommand {
mainPath: mainPath, mainPath: mainPath,
packagesPath: PackageMap.globalPackagesPath, packagesPath: PackageMap.globalPackagesPath,
outputPath: outputPath, outputPath: outputPath,
previewDart2: previewDart2, previewDart2: true,
buildSharedLibrary: false, buildSharedLibrary: false,
extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions], extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions],
).then((int buildExitCode) { ).then((int buildExitCode) {
...@@ -149,7 +141,7 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -149,7 +141,7 @@ class BuildAotCommand extends BuildSubCommand {
mainPath: mainPath, mainPath: mainPath,
packagesPath: PackageMap.globalPackagesPath, packagesPath: PackageMap.globalPackagesPath,
outputPath: outputPath, outputPath: outputPath,
previewDart2: previewDart2, previewDart2: true,
buildSharedLibrary: argResults['build-shared-library'], buildSharedLibrary: argResults['build-shared-library'],
extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions], extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions],
); );
......
...@@ -18,11 +18,6 @@ class BuildApkCommand extends BuildSubCommand { ...@@ -18,11 +18,6 @@ class BuildApkCommand extends BuildSubCommand {
usesBuildNameOption(); usesBuildNameOption();
argParser argParser
..addFlag('preview-dart-2',
defaultsTo: true,
hide: !verboseHelp,
help: 'Preview Dart 2.0 functionality.',
)
..addFlag('track-widget-creation', negatable: false, hide: !verboseHelp) ..addFlag('track-widget-creation', negatable: false, hide: !verboseHelp)
..addFlag('build-shared-library', ..addFlag('build-shared-library',
negatable: false, negatable: false,
......
...@@ -25,11 +25,6 @@ class BuildBundleCommand extends BuildSubCommand { ...@@ -25,11 +25,6 @@ class BuildBundleCommand extends BuildSubCommand {
..addOption('snapshot', defaultsTo: defaultSnapshotPath) ..addOption('snapshot', defaultsTo: defaultSnapshotPath)
..addOption('depfile', defaultsTo: defaultDepfilePath) ..addOption('depfile', defaultsTo: defaultDepfilePath)
..addOption('kernel-file', defaultsTo: defaultApplicationKernelPath) ..addOption('kernel-file', defaultsTo: defaultApplicationKernelPath)
..addFlag('preview-dart-2',
defaultsTo: true,
hide: !verboseHelp,
help: 'Preview Dart 2.0 functionality.',
)
..addOption('target-platform', ..addOption('target-platform',
defaultsTo: 'android-arm', defaultsTo: 'android-arm',
allowed: <String>['android-arm', 'android-arm64', 'ios'] allowed: <String>['android-arm', 'android-arm64', 'ios']
...@@ -95,7 +90,7 @@ class BuildBundleCommand extends BuildSubCommand { ...@@ -95,7 +90,7 @@ class BuildBundleCommand extends BuildSubCommand {
depfilePath: argResults['depfile'], depfilePath: argResults['depfile'],
privateKeyPath: argResults['private-key'], privateKeyPath: argResults['private-key'],
assetDirPath: argResults['asset-dir'], assetDirPath: argResults['asset-dir'],
previewDart2: argResults['preview-dart-2'], previewDart2: true,
precompiledSnapshot: argResults['precompiled'], precompiledSnapshot: argResults['precompiled'],
reportLicensedPackages: argResults['report-licensed-packages'], reportLicensedPackages: argResults['report-licensed-packages'],
trackWidgetCreation: argResults['track-widget-creation'], trackWidgetCreation: argResults['track-widget-creation'],
......
...@@ -13,7 +13,7 @@ import '../ios/mac.dart'; ...@@ -13,7 +13,7 @@ import '../ios/mac.dart';
import 'build.dart'; import 'build.dart';
class BuildIOSCommand extends BuildSubCommand { class BuildIOSCommand extends BuildSubCommand {
BuildIOSCommand({bool verboseHelp = false}) { BuildIOSCommand() {
usesTargetOption(); usesTargetOption();
usesFlavorOption(); usesFlavorOption();
usesPubOption(); usesPubOption();
...@@ -38,11 +38,7 @@ class BuildIOSCommand extends BuildSubCommand { ...@@ -38,11 +38,7 @@ class BuildIOSCommand extends BuildSubCommand {
..addFlag('codesign', ..addFlag('codesign',
defaultsTo: true, defaultsTo: true,
help: 'Codesign the application bundle (only available on device builds).', help: 'Codesign the application bundle (only available on device builds).',
) );
..addFlag('preview-dart-2',
defaultsTo: true,
hide: !verboseHelp,
help: 'Preview Dart 2.0 functionality.');
} }
@override @override
......
...@@ -62,10 +62,7 @@ class DriveCommand extends RunCommandBase { ...@@ -62,10 +62,7 @@ class DriveCommand extends RunCommandBase {
'just before the extension, so e.g. if the target is "lib/main.dart", the\n' 'just before the extension, so e.g. if the target is "lib/main.dart", the\n'
'driver will be "test_driver/main_test.dart".', 'driver will be "test_driver/main_test.dart".',
valueHelp: 'path', valueHelp: 'path',
) );
..addFlag('preview-dart-2',
defaultsTo: true,
help: 'Preview Dart 2.0 functionality.');
} }
@override @override
...@@ -123,7 +120,7 @@ class DriveCommand extends RunCommandBase { ...@@ -123,7 +120,7 @@ class DriveCommand extends RunCommandBase {
Cache.releaseLockEarly(); Cache.releaseLockEarly();
try { try {
await testRunner(<String>[testFile], observatoryUri, argResults['preview-dart-2']); await testRunner(<String>[testFile], observatoryUri);
} catch (error, stackTrace) { } catch (error, stackTrace) {
if (error is ToolExit) if (error is ToolExit)
rethrow; rethrow;
...@@ -275,24 +272,20 @@ Future<LaunchResult> _startApp(DriveCommand command) async { ...@@ -275,24 +272,20 @@ Future<LaunchResult> _startApp(DriveCommand command) async {
} }
/// Runs driver tests. /// Runs driver tests.
typedef Future<Null> TestRunner(List<String> testArgs, String observatoryUri, bool previewDart2); typedef Future<Null> TestRunner(List<String> testArgs, String observatoryUri);
TestRunner testRunner = _runTests; TestRunner testRunner = _runTests;
void restoreTestRunner() { void restoreTestRunner() {
testRunner = _runTests; testRunner = _runTests;
} }
Future<Null> _runTests(List<String> testArgs, String observatoryUri, bool previewDart2) async { Future<Null> _runTests(List<String> testArgs, String observatoryUri) async {
printTrace('Running driver tests.'); printTrace('Running driver tests.');
PackageMap.globalPackagesPath = fs.path.normalize(fs.path.absolute(PackageMap.globalPackagesPath)); PackageMap.globalPackagesPath = fs.path.normalize(fs.path.absolute(PackageMap.globalPackagesPath));
final List<String> args = testArgs.toList() final List<String> args = testArgs.toList()
..add('--packages=${PackageMap.globalPackagesPath}') ..add('--packages=${PackageMap.globalPackagesPath}')
..add('-rexpanded'); ..add('-rexpanded')
if (previewDart2) { ..add('--preview-dart-2');
args.add('--preview-dart-2');
} else {
args.add('--no-preview-dart-2');
}
final String dartVmPath = fs.path.join(dartSdkPath, 'bin', 'dart'); final String dartVmPath = fs.path.join(dartSdkPath, 'bin', 'dart');
final int result = await runCommandAndStreamOutput( final int result = await runCommandAndStreamOutput(
......
...@@ -53,10 +53,6 @@ class FuchsiaReloadCommand extends FlutterCommand { ...@@ -53,10 +53,6 @@ class FuchsiaReloadCommand extends FlutterCommand {
argParser.addOption('name-override', argParser.addOption('name-override',
abbr: 'n', abbr: 'n',
help: 'On-device name of the application binary.'); help: 'On-device name of the application binary.');
argParser.addFlag('preview-dart-2',
abbr: '2',
defaultsTo: false,
help: 'Preview Dart 2.0 functionality.');
argParser.addOption('target', argParser.addOption('target',
abbr: 't', abbr: 't',
defaultsTo: bundle.defaultMainPath, defaultsTo: bundle.defaultMainPath,
...@@ -137,7 +133,7 @@ class FuchsiaReloadCommand extends FlutterCommand { ...@@ -137,7 +133,7 @@ class FuchsiaReloadCommand extends FlutterCommand {
final FlutterDevice flutterDevice = new FlutterDevice( final FlutterDevice flutterDevice = new FlutterDevice(
device, device,
trackWidgetCreation: false, trackWidgetCreation: false,
previewDart2: false, previewDart2: true,
); );
flutterDevice.observatoryUris = observatoryUris; flutterDevice.observatoryUris = observatoryUris;
final HotRunner hotRunner = new HotRunner( final HotRunner hotRunner = new HotRunner(
......
...@@ -120,11 +120,6 @@ class RunCommand extends RunCommandBase { ...@@ -120,11 +120,6 @@ class RunCommand extends RunCommandBase {
hide: !verboseHelp, hide: !verboseHelp,
help: 'Specify a pre-built application binary to use when running.', help: 'Specify a pre-built application binary to use when running.',
) )
..addFlag('preview-dart-2',
defaultsTo: true,
hide: !verboseHelp,
help: 'Preview Dart 2.0 functionality.',
)
..addOption('precompile', ..addOption('precompile',
hide: !verboseHelp, hide: !verboseHelp,
help: 'Precompile functions specified in input file. This flag is only\n' help: 'Precompile functions specified in input file. This flag is only\n'
...@@ -344,7 +339,7 @@ class RunCommand extends RunCommandBase { ...@@ -344,7 +339,7 @@ class RunCommand extends RunCommandBase {
final List<FlutterDevice> flutterDevices = devices.map((Device device) { final List<FlutterDevice> flutterDevices = devices.map((Device device) {
return new FlutterDevice( return new FlutterDevice(
device, device,
previewDart2: argResults['preview-dart-2'], previewDart2: true,
trackWidgetCreation: argResults['track-widget-creation'], trackWidgetCreation: argResults['track-widget-creation'],
dillOutputPath: argResults['output-dill'], dillOutputPath: argResults['output-dill'],
fileSystemRoots: argResults['filesystem-root'], fileSystemRoots: argResults['filesystem-root'],
......
...@@ -64,11 +64,6 @@ class TestCommand extends FlutterCommand { ...@@ -64,11 +64,6 @@ class TestCommand extends FlutterCommand {
help: 'Handle machine structured JSON command input\n' help: 'Handle machine structured JSON command input\n'
'and provide output and progress in machine friendly format.', 'and provide output and progress in machine friendly format.',
) )
..addFlag('preview-dart-2',
defaultsTo: true,
hide: !verboseHelp,
help: 'Preview Dart 2.0 functionality.',
)
..addFlag('track-widget-creation', ..addFlag('track-widget-creation',
negatable: false, negatable: false,
hide: !verboseHelp, hide: !verboseHelp,
...@@ -172,7 +167,7 @@ class TestCommand extends FlutterCommand { ...@@ -172,7 +167,7 @@ class TestCommand extends FlutterCommand {
startPaused: startPaused, startPaused: startPaused,
ipv6: argResults['ipv6'], ipv6: argResults['ipv6'],
machine: machine, machine: machine,
previewDart2: argResults['preview-dart-2'], previewDart2: true,
trackWidgetCreation: argResults['track-widget-creation'], trackWidgetCreation: argResults['track-widget-creation'],
updateGoldens: argResults['update-goldens'], updateGoldens: argResults['update-goldens'],
concurrency: jobs, concurrency: jobs,
......
...@@ -470,10 +470,9 @@ class DevFS { ...@@ -470,10 +470,9 @@ class DevFS {
String archivePath; String archivePath;
if (deviceUri.path.startsWith(assetBuildDirPrefix)) if (deviceUri.path.startsWith(assetBuildDirPrefix))
archivePath = deviceUri.path.substring(assetBuildDirPrefix.length); archivePath = deviceUri.path.substring(assetBuildDirPrefix.length);
// When doing full restart in preview-dart-2 mode, copy content so // When doing full restart, copy content so that isModified does not
// that isModified does not reset last check timestamp because we // reset last check timestamp because we want to report all modified
// want to report all modified files to incremental compiler next time // files to incremental compiler next time user does hot reload.
// user does hot reload.
if (content.isModified || ((bundleDirty || bundleFirstUpload) && archivePath != null)) { if (content.isModified || ((bundleDirty || bundleFirstUpload) && archivePath != null)) {
dirtyEntries[deviceUri] = content; dirtyEntries[deviceUri] = content;
numBytes += content.size; numBytes += content.size;
......
...@@ -416,7 +416,7 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -416,7 +416,7 @@ Future<XcodeBuildResult> buildXcodeProject({
outputDir = expectedOutputDirectory.replaceFirst('/$configuration-', '/'); outputDir = expectedOutputDirectory.replaceFirst('/$configuration-', '/');
if (fs.isDirectorySync(outputDir)) { if (fs.isDirectorySync(outputDir)) {
// Previous output directory might have incompatible artifacts // Previous output directory might have incompatible artifacts
// (for example, kernel binary files produced from previous `--preview-dart-2` run). // (for example, kernel binary files produced from previous run).
fs.directory(outputDir).deleteSync(recursive: true); fs.directory(outputDir).deleteSync(recursive: true);
} }
copyDirectorySync(fs.directory(expectedOutputDirectory), fs.directory(outputDir)); copyDirectorySync(fs.directory(expectedOutputDirectory), fs.directory(outputDir));
......
...@@ -215,10 +215,6 @@ abstract class FlutterCommand extends Command<Null> { ...@@ -215,10 +215,6 @@ abstract class FlutterCommand extends Command<Null> {
} }
BuildInfo getBuildInfo() { BuildInfo getBuildInfo() {
final bool previewDart2 = argParser.options.containsKey('preview-dart-2')
? argResults['preview-dart-2']
: true;
TargetPlatform targetPlatform; TargetPlatform targetPlatform;
if (argParser.options.containsKey('target-platform') && if (argParser.options.containsKey('target-platform') &&
argResults['target-platform'] != 'default') { argResults['target-platform'] != 'default') {
...@@ -228,10 +224,6 @@ abstract class FlutterCommand extends Command<Null> { ...@@ -228,10 +224,6 @@ abstract class FlutterCommand extends Command<Null> {
final bool trackWidgetCreation = argParser.options.containsKey('track-widget-creation') final bool trackWidgetCreation = argParser.options.containsKey('track-widget-creation')
? argResults['track-widget-creation'] ? argResults['track-widget-creation']
: false; : false;
if (trackWidgetCreation == true && previewDart2 == false) {
throw new UsageException(
'--track-widget-creation is valid only when --preview-dart-2 is specified.', null);
}
int buildNumber; int buildNumber;
try { try {
...@@ -247,7 +239,7 @@ abstract class FlutterCommand extends Command<Null> { ...@@ -247,7 +239,7 @@ abstract class FlutterCommand extends Command<Null> {
argParser.options.containsKey('flavor') argParser.options.containsKey('flavor')
? argResults['flavor'] ? argResults['flavor']
: null, : null,
previewDart2: previewDart2, previewDart2: true,
trackWidgetCreation: trackWidgetCreation, trackWidgetCreation: trackWidgetCreation,
compilationTraceFilePath: argParser.options.containsKey('precompile') compilationTraceFilePath: argParser.options.containsKey('precompile')
? argResults['precompile'] ? argResults['precompile']
......
...@@ -68,7 +68,7 @@ void installHook({ ...@@ -68,7 +68,7 @@ void installHook({
bool enableObservatory = false, bool enableObservatory = false,
bool machine = false, bool machine = false,
bool startPaused = false, bool startPaused = false,
bool previewDart2 = false, bool previewDart2 = true,
int port = 0, int port = 0,
String precompiledDillPath, String precompiledDillPath,
bool trackWidgetCreation = false, bool trackWidgetCreation = false,
...@@ -445,7 +445,7 @@ class _FlutterPlatform extends PlatformPlugin { ...@@ -445,7 +445,7 @@ class _FlutterPlatform extends PlatformPlugin {
cancelOnError: true, cancelOnError: true,
); );
printTrace('test $ourTestCount: starting shell process${previewDart2? " in preview-dart-2 mode":""}'); printTrace('test $ourTestCount: starting shell process');
// [precompiledDillPath] can be set only if [previewDart2] is [true]. // [precompiledDillPath] can be set only if [previewDart2] is [true].
assert(precompiledDillPath == null || previewDart2); assert(precompiledDillPath == null || previewDart2);
...@@ -979,4 +979,4 @@ class _AsyncError { ...@@ -979,4 +979,4 @@ class _AsyncError {
const _AsyncError(this.error, this.stack); const _AsyncError(this.error, this.stack);
final dynamic error; final dynamic error;
final StackTrace stack; final StackTrace stack;
} }
\ No newline at end of file
...@@ -29,7 +29,7 @@ Future<int> runTests( ...@@ -29,7 +29,7 @@ Future<int> runTests(
bool startPaused = false, bool startPaused = false,
bool ipv6 = false, bool ipv6 = false,
bool machine = false, bool machine = false,
bool previewDart2 = false, bool previewDart2 = true,
String precompiledDillPath, String precompiledDillPath,
bool trackWidgetCreation = false, bool trackWidgetCreation = false,
bool updateGoldens = false, bool updateGoldens = false,
...@@ -38,7 +38,7 @@ Future<int> runTests( ...@@ -38,7 +38,7 @@ Future<int> runTests(
}) async { }) async {
if (trackWidgetCreation && !previewDart2) { if (trackWidgetCreation && !previewDart2) {
throw new UsageException( throw new UsageException(
'--track-widget-creation is valid only when --preview-dart-2 is specified.', '--track-widget-creation is valid only when previewDart2 is specified.',
null, null,
); );
} }
......
...@@ -53,7 +53,7 @@ void main() { ...@@ -53,7 +53,7 @@ void main() {
appStarter = (DriveCommand command) { appStarter = (DriveCommand command) {
throw 'Unexpected call to appStarter'; throw 'Unexpected call to appStarter';
}; };
testRunner = (List<String> testArgs, String observatoryUri, bool previewDart2) { testRunner = (List<String> testArgs, String observatoryUri) {
throw 'Unexpected call to testRunner'; throw 'Unexpected call to testRunner';
}; };
appStopper = (DriveCommand command) { appStopper = (DriveCommand command) {
...@@ -169,7 +169,7 @@ void main() { ...@@ -169,7 +169,7 @@ void main() {
appStarter = expectAsync1((DriveCommand command) async { appStarter = expectAsync1((DriveCommand command) async {
return new LaunchResult.succeeded(); return new LaunchResult.succeeded();
}); });
testRunner = expectAsync3((List<String> testArgs, String observatoryUri, bool previewDart2) async { testRunner = expectAsync2((List<String> testArgs, String observatoryUri) async {
expect(testArgs, <String>[testFile]); expect(testArgs, <String>[testFile]);
return null; return null;
}); });
...@@ -200,7 +200,7 @@ void main() { ...@@ -200,7 +200,7 @@ void main() {
appStarter = expectAsync1((DriveCommand command) async { appStarter = expectAsync1((DriveCommand command) async {
return new LaunchResult.succeeded(); return new LaunchResult.succeeded();
}); });
testRunner = (List<String> testArgs, String observatoryUri, bool previewDart2) async { testRunner = (List<String> testArgs, String observatoryUri) async {
throwToolExit(null, exitCode: 123); throwToolExit(null, exitCode: 123);
}; };
appStopper = expectAsync1((DriveCommand command) async { appStopper = expectAsync1((DriveCommand command) async {
......
...@@ -407,7 +407,7 @@ Information about project "Runner": ...@@ -407,7 +407,7 @@ Information about project "Runner":
await updateGeneratedXcodeProperties( await updateGeneratedXcodeProperties(
project: await FlutterProject.fromPath('path/to/project'), project: await FlutterProject.fromPath('path/to/project'),
buildInfo: buildInfo, buildInfo: buildInfo,
previewDart2: false, previewDart2: true,
); );
final File localPropertiesFile = fs.file('path/to/project/ios/Flutter/Generated.xcconfig'); final File localPropertiesFile = fs.file('path/to/project/ios/Flutter/Generated.xcconfig');
......
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