Commit 83e0ca24 authored by asiva's avatar asiva Committed by Siva

Fuse --strong into --preview-dart-2 option.

parent 4814303b
...@@ -261,11 +261,6 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -261,11 +261,6 @@ class FlutterPlugin implements Plugin<Project> {
previewDart2Value = project.property('preview-dart-2') previewDart2Value = project.property('preview-dart-2')
} }
Boolean strongModeValue = false
if (project.hasProperty('strong')) {
strongModeValue = project.property('strong')
}
String extraFrontEndOptionsValue = null String extraFrontEndOptionsValue = null
if (project.hasProperty('extra-front-end-options')) { if (project.hasProperty('extra-front-end-options')) {
extraFrontEndOptionsValue = project.property('extra-front-end-options') extraFrontEndOptionsValue = project.property('extra-front-end-options')
...@@ -304,7 +299,6 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -304,7 +299,6 @@ class FlutterPlugin implements Plugin<Project> {
localEngineSrcPath this.localEngineSrcPath localEngineSrcPath this.localEngineSrcPath
targetPath target targetPath target
previewDart2 previewDart2Value previewDart2 previewDart2Value
strongMode strongModeValue
preferSharedLibrary preferSharedLibraryValue preferSharedLibrary preferSharedLibraryValue
targetPlatform targetPlatformValue targetPlatform targetPlatformValue
sourceDir project.file(project.flutter.source) sourceDir project.file(project.flutter.source)
...@@ -320,7 +314,6 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -320,7 +314,6 @@ class FlutterPlugin implements Plugin<Project> {
localEngineSrcPath this.localEngineSrcPath localEngineSrcPath this.localEngineSrcPath
targetPath target targetPath target
previewDart2 previewDart2Value previewDart2 previewDart2Value
strongMode strongModeValue
preferSharedLibrary preferSharedLibraryValue preferSharedLibrary preferSharedLibraryValue
targetPlatform targetPlatformValue targetPlatform targetPlatformValue
sourceDir project.file(project.flutter.source) sourceDir project.file(project.flutter.source)
...@@ -357,8 +350,6 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -357,8 +350,6 @@ abstract class BaseFlutterTask extends DefaultTask {
@Optional @Input @Optional @Input
Boolean previewDart2 Boolean previewDart2
@Optional @Input @Optional @Input
Boolean strongMode
@Optional @Input
Boolean preferSharedLibrary Boolean preferSharedLibrary
@Optional @Input @Optional @Input
String targetPlatform String targetPlatform
...@@ -401,9 +392,6 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -401,9 +392,6 @@ abstract class BaseFlutterTask extends DefaultTask {
if (previewDart2) { if (previewDart2) {
args "--preview-dart-2" args "--preview-dart-2"
} }
if (strongMode) {
args "--strong"
}
if (extraFrontEndOptions != null) { if (extraFrontEndOptions != null) {
args "--extra-front-end-options", "${extraFrontEndOptions}" args "--extra-front-end-options", "${extraFrontEndOptions}"
} }
...@@ -433,9 +421,6 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -433,9 +421,6 @@ abstract class BaseFlutterTask extends DefaultTask {
if (previewDart2) { if (previewDart2) {
args "--preview-dart-2" args "--preview-dart-2"
} }
if (strongMode) {
args "--strong"
}
args "--output-file", "${intermediateDir}/app.flx" args "--output-file", "${intermediateDir}/app.flx"
if (buildMode != "debug") { if (buildMode != "debug") {
......
...@@ -291,12 +291,11 @@ Future<Null> _buildGradleProjectV2(String gradle, BuildInfo buildInfo, String ta ...@@ -291,12 +291,11 @@ Future<Null> _buildGradleProjectV2(String gradle, BuildInfo buildInfo, String ta
} }
if (buildInfo.previewDart2) { if (buildInfo.previewDart2) {
command.add('-Ppreview-dart-2=true'); command.add('-Ppreview-dart-2=true');
if (buildInfo.strongMode)
command.add('-Pstrong=true'); command.add('-Pstrong=true');
if (buildInfo.extraFrontEndOptions != null) if (buildInfo.extraFrontEndOptions != null)
command.add('-Pextra-front-end-options=${buildInfo.extraFrontEndOptions}'); command.add('-Pextra-front-end-options=${buildInfo.extraFrontEndOptions}');
if (buildInfo.extraGenSnapshotOptions != null) if (buildInfo.extraGenSnapshotOptions != null)
command.add('-Pextra-gen-snapshot-options=${buildInfo.extraGenSnapshotOptions}'); command.add('-Pextra-gen-snapshot-options=${buildInfo.extraGenSnapshotOptions}');
} }
if (buildInfo.preferSharedLibrary && androidSdk.ndkCompiler != null) { if (buildInfo.preferSharedLibrary && androidSdk.ndkCompiler != null) {
command.add('-Pprefer-shared-library=true'); command.add('-Pprefer-shared-library=true');
......
...@@ -21,7 +21,6 @@ enum Artifact { ...@@ -21,7 +21,6 @@ enum Artifact {
vmSnapshotData, vmSnapshotData,
isolateSnapshotData, isolateSnapshotData,
platformKernelDill, platformKernelDill,
platformKernelStrongDill,
platformLibrariesJson, platformLibrariesJson,
flutterPatchedSdkPath, flutterPatchedSdkPath,
frontendServerSnapshotForEngineDartSdk, frontendServerSnapshotForEngineDartSdk,
...@@ -47,8 +46,6 @@ String _artifactToFileName(Artifact artifact) { ...@@ -47,8 +46,6 @@ String _artifactToFileName(Artifact artifact) {
case Artifact.isolateSnapshotData: case Artifact.isolateSnapshotData:
return 'isolate_snapshot.bin'; return 'isolate_snapshot.bin';
case Artifact.platformKernelDill: case Artifact.platformKernelDill:
return 'platform.dill';
case Artifact.platformKernelStrongDill:
return 'platform_strong.dill'; return 'platform_strong.dill';
case Artifact.platformLibrariesJson: case Artifact.platformLibrariesJson:
return 'libraries.json'; return 'libraries.json';
...@@ -172,7 +169,6 @@ class CachedArtifacts extends Artifacts { ...@@ -172,7 +169,6 @@ class CachedArtifacts extends Artifacts {
final String platformDirName = getNameForTargetPlatform(platform); final String platformDirName = getNameForTargetPlatform(platform);
return fs.path.join(engineArtifactsPath, platformDirName, _artifactToFileName(artifact)); return fs.path.join(engineArtifactsPath, platformDirName, _artifactToFileName(artifact));
case Artifact.platformKernelDill: case Artifact.platformKernelDill:
case Artifact.platformKernelStrongDill:
return fs.path.join(_getFlutterPatchedSdkPath(), _artifactToFileName(artifact)); return fs.path.join(_getFlutterPatchedSdkPath(), _artifactToFileName(artifact));
case Artifact.platformLibrariesJson: case Artifact.platformLibrariesJson:
return fs.path.join(_getFlutterPatchedSdkPath(), 'lib', _artifactToFileName(artifact)); return fs.path.join(_getFlutterPatchedSdkPath(), 'lib', _artifactToFileName(artifact));
...@@ -243,7 +239,6 @@ class LocalEngineArtifacts extends Artifacts { ...@@ -243,7 +239,6 @@ class LocalEngineArtifacts extends Artifacts {
case Artifact.vmSnapshotData: case Artifact.vmSnapshotData:
return fs.path.join(engineOutPath, 'gen', 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact)); return fs.path.join(engineOutPath, 'gen', 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact));
case Artifact.platformKernelDill: case Artifact.platformKernelDill:
case Artifact.platformKernelStrongDill:
return fs.path.join(_getFlutterPatchedSdkPath(), _artifactToFileName(artifact)); return fs.path.join(_getFlutterPatchedSdkPath(), _artifactToFileName(artifact));
case Artifact.platformLibrariesJson: case Artifact.platformLibrariesJson:
return fs.path.join(_getFlutterPatchedSdkPath(), 'lib', _artifactToFileName(artifact)); return fs.path.join(_getFlutterPatchedSdkPath(), 'lib', _artifactToFileName(artifact));
......
...@@ -12,7 +12,6 @@ import 'globals.dart'; ...@@ -12,7 +12,6 @@ import 'globals.dart';
class BuildInfo { class BuildInfo {
const BuildInfo(this.mode, this.flavor, const BuildInfo(this.mode, this.flavor,
{this.previewDart2, {this.previewDart2,
this.strongMode,
this.extraFrontEndOptions, this.extraFrontEndOptions,
this.extraGenSnapshotOptions, this.extraGenSnapshotOptions,
this.preferSharedLibrary, this.preferSharedLibrary,
...@@ -30,9 +29,6 @@ class BuildInfo { ...@@ -30,9 +29,6 @@ class BuildInfo {
// Whether build should be done using Dart2 Frontend parser. // Whether build should be done using Dart2 Frontend parser.
final bool previewDart2; final bool previewDart2;
// Whether build should use strong mode semantics.
final bool strongMode;
/// Extra command-line options for front-end. /// Extra command-line options for front-end.
final String extraFrontEndOptions; final String extraFrontEndOptions;
...@@ -72,7 +68,6 @@ class BuildInfo { ...@@ -72,7 +68,6 @@ class BuildInfo {
BuildInfo withTargetPlatform(TargetPlatform targetPlatform) => BuildInfo withTargetPlatform(TargetPlatform targetPlatform) =>
new BuildInfo(mode, flavor, new BuildInfo(mode, flavor,
previewDart2: previewDart2, previewDart2: previewDart2,
strongMode: strongMode,
extraFrontEndOptions: extraFrontEndOptions, extraFrontEndOptions: extraFrontEndOptions,
extraGenSnapshotOptions: extraGenSnapshotOptions, extraGenSnapshotOptions: extraGenSnapshotOptions,
preferSharedLibrary: preferSharedLibrary, preferSharedLibrary: preferSharedLibrary,
......
...@@ -40,7 +40,6 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -40,7 +40,6 @@ class BuildAotCommand extends BuildSubCommand {
..addFlag('interpreter') ..addFlag('interpreter')
..addFlag('quiet', defaultsTo: false) ..addFlag('quiet', defaultsTo: false)
..addFlag('preview-dart-2', negatable: false, hide: !verboseHelp) ..addFlag('preview-dart-2', negatable: false, hide: !verboseHelp)
..addFlag('strong', negatable: false, hide: !verboseHelp)
..addOption(FlutterOptions.kExtraFrontEndOptions, ..addOption(FlutterOptions.kExtraFrontEndOptions,
allowMultiple: true, allowMultiple: true,
splitCommas: true, splitCommas: true,
...@@ -82,7 +81,6 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -82,7 +81,6 @@ class BuildAotCommand extends BuildSubCommand {
outputPath: argResults['output-dir'], outputPath: argResults['output-dir'],
interpreter: argResults['interpreter'], interpreter: argResults['interpreter'],
previewDart2: argResults['preview-dart-2'], previewDart2: argResults['preview-dart-2'],
strongMode: argResults['strong'],
extraFrontEndOptions: argResults[FlutterOptions.kExtraFrontEndOptions], extraFrontEndOptions: argResults[FlutterOptions.kExtraFrontEndOptions],
extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions], extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions],
preferSharedLibrary: argResults['prefer-shared-library'], preferSharedLibrary: argResults['prefer-shared-library'],
...@@ -114,7 +112,6 @@ Future<String> buildAotSnapshot( ...@@ -114,7 +112,6 @@ Future<String> buildAotSnapshot(
String outputPath, String outputPath,
bool interpreter: false, bool interpreter: false,
bool previewDart2: false, bool previewDart2: false,
bool strongMode: false,
List<String> extraFrontEndOptions, List<String> extraFrontEndOptions,
List<String> extraGenSnapshotOptions, List<String> extraGenSnapshotOptions,
bool preferSharedLibrary: false, bool preferSharedLibrary: false,
...@@ -128,7 +125,6 @@ Future<String> buildAotSnapshot( ...@@ -128,7 +125,6 @@ Future<String> buildAotSnapshot(
outputPath: outputPath, outputPath: outputPath,
interpreter: interpreter, interpreter: interpreter,
previewDart2: previewDart2, previewDart2: previewDart2,
strongMode: strongMode,
extraFrontEndOptions: extraFrontEndOptions, extraFrontEndOptions: extraFrontEndOptions,
extraGenSnapshotOptions: extraGenSnapshotOptions, extraGenSnapshotOptions: extraGenSnapshotOptions,
preferSharedLibrary: preferSharedLibrary, preferSharedLibrary: preferSharedLibrary,
...@@ -148,7 +144,6 @@ Future<String> _buildAotSnapshot( ...@@ -148,7 +144,6 @@ Future<String> _buildAotSnapshot(
String outputPath, String outputPath,
bool interpreter: false, bool interpreter: false,
bool previewDart2: false, bool previewDart2: false,
bool strongMode: false,
List<String> extraFrontEndOptions, List<String> extraFrontEndOptions,
List<String> extraGenSnapshotOptions, List<String> extraGenSnapshotOptions,
bool preferSharedLibrary: false, bool preferSharedLibrary: false,
...@@ -346,19 +341,16 @@ Future<String> _buildAotSnapshot( ...@@ -346,19 +341,16 @@ Future<String> _buildAotSnapshot(
extraFrontEndOptions: extraFrontEndOptions, extraFrontEndOptions: extraFrontEndOptions,
linkPlatformKernelIn : true, linkPlatformKernelIn : true,
aot : true, aot : true,
strongMode: strongMode,
); );
if (mainPath == null) { if (mainPath == null) {
printError('Compiler terminated unexpectedly.'); printError('Compiler terminated unexpectedly.');
return null; return null;
} }
if (strongMode) { genSnapshotCmd.addAll(<String>[
genSnapshotCmd.addAll(<String>[ '--reify-generic-functions',
'--reify-generic-functions', '--strong',
'--strong', ]);
]);
}
} }
genSnapshotCmd.add(mainPath); genSnapshotCmd.add(mainPath);
......
...@@ -15,8 +15,7 @@ class BuildApkCommand extends BuildSubCommand { ...@@ -15,8 +15,7 @@ class BuildApkCommand extends BuildSubCommand {
usesPubOption(); usesPubOption();
argParser argParser
..addFlag('preview-dart-2', negatable: false, hide: !verboseHelp) ..addFlag('preview-dart-2', negatable: false, hide: !verboseHelp)
..addFlag('strong', negatable: false, hide: !verboseHelp)
..addFlag('prefer-shared-library', negatable: false, ..addFlag('prefer-shared-library', negatable: false,
help: 'Whether to prefer compiling to a *.so file (android only).') help: 'Whether to prefer compiling to a *.so file (android only).')
..addOption('target-platform', ..addOption('target-platform',
......
...@@ -21,7 +21,6 @@ class BuildFlxCommand extends BuildSubCommand { ...@@ -21,7 +21,6 @@ class BuildFlxCommand extends BuildSubCommand {
argParser.addOption('snapshot', defaultsTo: defaultSnapshotPath); argParser.addOption('snapshot', defaultsTo: defaultSnapshotPath);
argParser.addOption('depfile', defaultsTo: defaultDepfilePath); argParser.addOption('depfile', defaultsTo: defaultDepfilePath);
argParser.addFlag('preview-dart-2', negatable: false, hide: !verboseHelp); argParser.addFlag('preview-dart-2', negatable: false, hide: !verboseHelp);
argParser.addFlag('strong', negatable: false, hide: !verboseHelp);
argParser.addOption('working-dir', defaultsTo: getAssetBuildDirectory()); argParser.addOption('working-dir', defaultsTo: getAssetBuildDirectory());
argParser.addFlag('report-licensed-packages', help: 'Whether to report the names of all the packages that are included in the application\'s LICENSE file.', defaultsTo: false); argParser.addFlag('report-licensed-packages', help: 'Whether to report the names of all the packages that are included in the application\'s LICENSE file.', defaultsTo: false);
usesPubOption(); usesPubOption();
...@@ -51,7 +50,6 @@ class BuildFlxCommand extends BuildSubCommand { ...@@ -51,7 +50,6 @@ class BuildFlxCommand extends BuildSubCommand {
privateKeyPath: argResults['private-key'], privateKeyPath: argResults['private-key'],
workingDirPath: argResults['working-dir'], workingDirPath: argResults['working-dir'],
previewDart2: argResults['preview-dart-2'], previewDart2: argResults['preview-dart-2'],
strongMode: argResults['strong'],
precompiledSnapshot: argResults['precompiled'], precompiledSnapshot: argResults['precompiled'],
reportLicensedPackages: argResults['report-licensed-packages'] reportLicensedPackages: argResults['report-licensed-packages']
); );
......
...@@ -31,8 +31,6 @@ class BuildIOSCommand extends BuildSubCommand { ...@@ -31,8 +31,6 @@ class BuildIOSCommand extends BuildSubCommand {
help: 'Codesign the application bundle (only available on device builds).'); help: 'Codesign the application bundle (only available on device builds).');
argParser.addFlag('preview-dart-2', negatable: false, argParser.addFlag('preview-dart-2', negatable: false,
hide: !verboseHelp); hide: !verboseHelp);
argParser.addFlag('strong', negatable: false,
hide: !verboseHelp);
} }
@override @override
......
...@@ -238,7 +238,6 @@ class CreateCommand extends FlutterCommand { ...@@ -238,7 +238,6 @@ class CreateCommand extends FlutterCommand {
target: flx.defaultMainPath, target: flx.defaultMainPath,
hasPlugins: generatePlugin, hasPlugins: generatePlugin,
previewDart2: false, previewDart2: false,
strongMode: false,
); );
if (argResults['pub']) { if (argResults['pub']) {
......
...@@ -374,7 +374,6 @@ class AppDomain extends Domain { ...@@ -374,7 +374,6 @@ class AppDomain extends Domain {
usesTerminalUI: false, usesTerminalUI: false,
applicationBinary: applicationBinary, applicationBinary: applicationBinary,
previewDart2: previewDart2, previewDart2: previewDart2,
strongMode: strongMode,
projectRootPath: projectRootPath, projectRootPath: projectRootPath,
packagesFilePath: packagesFilePath, packagesFilePath: packagesFilePath,
projectAssets: projectAssets, projectAssets: projectAssets,
...@@ -389,7 +388,6 @@ class AppDomain extends Domain { ...@@ -389,7 +388,6 @@ class AppDomain extends Domain {
usesTerminalUI: false, usesTerminalUI: false,
applicationBinary: applicationBinary, applicationBinary: applicationBinary,
previewDart2: previewDart2, previewDart2: previewDart2,
strongMode: strongMode,
ipv6: ipv6, ipv6: ipv6,
); );
} }
......
...@@ -254,7 +254,6 @@ class RunCommand extends RunCommandBase { ...@@ -254,7 +254,6 @@ class RunCommand extends RunCommandBase {
_createDebuggingOptions(), hotMode, _createDebuggingOptions(), hotMode,
applicationBinary: argResults['use-application-binary'], applicationBinary: argResults['use-application-binary'],
previewDart2: argResults['preview-dart-2'], previewDart2: argResults['preview-dart-2'],
strongMode: argResults['strong'],
projectRootPath: argResults['project-root'], projectRootPath: argResults['project-root'],
packagesFilePath: globalResults['packages'], packagesFilePath: globalResults['packages'],
projectAssets: argResults['project-assets'], projectAssets: argResults['project-assets'],
...@@ -293,9 +292,7 @@ class RunCommand extends RunCommandBase { ...@@ -293,9 +292,7 @@ class RunCommand extends RunCommandBase {
} }
final List<FlutterDevice> flutterDevices = devices.map((Device device) { final List<FlutterDevice> flutterDevices = devices.map((Device device) {
return new FlutterDevice(device, return new FlutterDevice(device, previewDart2: argResults['preview-dart-2']);
previewDart2: argResults['preview-dart-2'],
strongMode : argResults['strong']);
}).toList(); }).toList();
ResidentRunner runner; ResidentRunner runner;
...@@ -307,7 +304,6 @@ class RunCommand extends RunCommandBase { ...@@ -307,7 +304,6 @@ class RunCommand extends RunCommandBase {
benchmarkMode: argResults['benchmark'], benchmarkMode: argResults['benchmark'],
applicationBinary: argResults['use-application-binary'], applicationBinary: argResults['use-application-binary'],
previewDart2: argResults['preview-dart-2'], previewDart2: argResults['preview-dart-2'],
strongMode: argResults['strong'],
projectRootPath: argResults['project-root'], projectRootPath: argResults['project-root'],
packagesFilePath: globalResults['packages'], packagesFilePath: globalResults['packages'],
projectAssets: argResults['project-assets'], projectAssets: argResults['project-assets'],
...@@ -322,7 +318,6 @@ class RunCommand extends RunCommandBase { ...@@ -322,7 +318,6 @@ class RunCommand extends RunCommandBase {
traceStartup: traceStartup, traceStartup: traceStartup,
applicationBinary: argResults['use-application-binary'], applicationBinary: argResults['use-application-binary'],
previewDart2: argResults['preview-dart-2'], previewDart2: argResults['preview-dart-2'],
strongMode: argResults['strong'],
stayResident: stayResident, stayResident: stayResident,
ipv6: ipv6, ipv6: ipv6,
); );
......
...@@ -60,7 +60,6 @@ Future<String> compile( ...@@ -60,7 +60,6 @@ Future<String> compile(
String mainPath, String mainPath,
bool linkPlatformKernelIn: false, bool linkPlatformKernelIn: false,
bool aot: false, bool aot: false,
bool strongMode: false,
List<String> extraFrontEndOptions, List<String> extraFrontEndOptions,
String incrementalCompilerByteStorePath, String incrementalCompilerByteStorePath,
String packagesPath}) async { String packagesPath}) async {
...@@ -76,15 +75,13 @@ Future<String> compile( ...@@ -76,15 +75,13 @@ Future<String> compile(
frontendServer, frontendServer,
'--sdk-root', '--sdk-root',
sdkRoot, sdkRoot,
'--strong',
]; ];
if (!linkPlatformKernelIn) if (!linkPlatformKernelIn)
command.add('--no-link-platform'); command.add('--no-link-platform');
if (aot) { if (aot) {
command.add('--aot'); command.add('--aot');
} }
if (strongMode) {
command.add('--strong');
}
if (incrementalCompilerByteStorePath != null) { if (incrementalCompilerByteStorePath != null) {
command.add('--incremental'); command.add('--incremental');
} }
...@@ -121,16 +118,13 @@ Future<String> compile( ...@@ -121,16 +118,13 @@ Future<String> compile(
/// The wrapper is intended to stay resident in memory as user changes, reloads, /// The wrapper is intended to stay resident in memory as user changes, reloads,
/// restarts the Flutter app. /// restarts the Flutter app.
class ResidentCompiler { class ResidentCompiler {
ResidentCompiler(this._sdkRoot, {bool strongMode: false}) ResidentCompiler(this._sdkRoot) : assert(_sdkRoot != null) {
: assert(_sdkRoot != null) {
// This is a URI, not a file path, so the forward slash is correct even on Windows. // This is a URI, not a file path, so the forward slash is correct even on Windows.
if (!_sdkRoot.endsWith('/')) if (!_sdkRoot.endsWith('/'))
_sdkRoot = '$_sdkRoot/'; _sdkRoot = '$_sdkRoot/';
_strongMode = strongMode;
} }
String _sdkRoot; String _sdkRoot;
bool _strongMode;
Process _server; Process _server;
final _StdoutHandler stdoutHandler = new _StdoutHandler(); final _StdoutHandler stdoutHandler = new _StdoutHandler();
...@@ -165,11 +159,9 @@ class ResidentCompiler { ...@@ -165,11 +159,9 @@ class ResidentCompiler {
frontendServer, frontendServer,
'--sdk-root', '--sdk-root',
_sdkRoot, _sdkRoot,
'--incremental' '--incremental',
'--strong'
]; ];
if (_strongMode) {
args.add('--strong');
}
_server = await processManager.start(args); _server = await processManager.start(args);
_server.stdout _server.stdout
.transform(UTF8.decoder) .transform(UTF8.decoder)
......
...@@ -39,7 +39,6 @@ Future<Null> build({ ...@@ -39,7 +39,6 @@ Future<Null> build({
String workingDirPath, String workingDirPath,
String packagesPath, String packagesPath,
bool previewDart2 : false, bool previewDart2 : false,
bool strongMode : false,
bool precompiledSnapshot: false, bool precompiledSnapshot: false,
bool reportLicensedPackages: false bool reportLicensedPackages: false
}) async { }) async {
...@@ -74,7 +73,6 @@ Future<Null> build({ ...@@ -74,7 +73,6 @@ Future<Null> build({
sdkRoot: artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath), sdkRoot: artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
incrementalCompilerByteStorePath: fs.path.absolute(getIncrementalCompilerByteStoreDirectory()), incrementalCompilerByteStorePath: fs.path.absolute(getIncrementalCompilerByteStoreDirectory()),
mainPath: fs.file(mainPath).absolute.path, mainPath: fs.file(mainPath).absolute.path,
strongMode: strongMode
); );
if (kernelBinaryFilename == null) { if (kernelBinaryFilename == null) {
throwToolExit('Compiler terminated unexpectedly on $mainPath'); throwToolExit('Compiler terminated unexpectedly on $mainPath');
...@@ -90,7 +88,6 @@ Future<Null> build({ ...@@ -90,7 +88,6 @@ Future<Null> build({
privateKeyPath: privateKeyPath, privateKeyPath: privateKeyPath,
workingDirPath: workingDirPath, workingDirPath: workingDirPath,
packagesPath: packagesPath, packagesPath: packagesPath,
strongMode: strongMode,
reportLicensedPackages: reportLicensedPackages reportLicensedPackages: reportLicensedPackages
).then((_) => null); ).then((_) => null);
} }
...@@ -104,7 +101,6 @@ Future<List<String>> assemble({ ...@@ -104,7 +101,6 @@ Future<List<String>> assemble({
String privateKeyPath: defaultPrivateKeyPath, String privateKeyPath: defaultPrivateKeyPath,
String workingDirPath, String workingDirPath,
String packagesPath, String packagesPath,
bool strongMode : false,
bool includeDefaultFonts: true, bool includeDefaultFonts: true,
bool reportLicensedPackages: false bool reportLicensedPackages: false
}) async { }) async {
...@@ -135,9 +131,7 @@ Future<List<String>> assemble({ ...@@ -135,9 +131,7 @@ Future<List<String>> assemble({
.toList(); .toList();
if (kernelContent != null) { if (kernelContent != null) {
final String platformKernelDill = strongMode ? final String platformKernelDill = artifacts.getArtifactPath(Artifact.platformKernelDill);
artifacts.getArtifactPath(Artifact.platformKernelStrongDill) :
artifacts.getArtifactPath(Artifact.platformKernelDill);
zipBuilder.entries[_kKernelKey] = kernelContent; zipBuilder.entries[_kKernelKey] = kernelContent;
zipBuilder.entries[_kPlatformKernelKey] = new DevFSFileContent(fs.file(platformKernelDill)); zipBuilder.entries[_kPlatformKernelKey] = new DevFSFileContent(fs.file(platformKernelDill));
} }
......
...@@ -264,7 +264,6 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -264,7 +264,6 @@ Future<XcodeBuildResult> buildXcodeProject({
target: target, target: target,
hasPlugins: hasFlutterPlugins, hasPlugins: hasFlutterPlugins,
previewDart2: buildInfo.previewDart2, previewDart2: buildInfo.previewDart2,
strongMode: buildInfo.strongMode,
); );
if (hasFlutterPlugins) { if (hasFlutterPlugins) {
......
...@@ -392,7 +392,6 @@ class IOSSimulator extends Device { ...@@ -392,7 +392,6 @@ class IOSSimulator extends Device {
final BuildInfo debugBuildInfo = new BuildInfo(BuildMode.debug, buildInfo.flavor, final BuildInfo debugBuildInfo = new BuildInfo(BuildMode.debug, buildInfo.flavor,
previewDart2: buildInfo.previewDart2, previewDart2: buildInfo.previewDart2,
strongMode: buildInfo.strongMode,
extraFrontEndOptions: buildInfo.extraFrontEndOptions, extraFrontEndOptions: buildInfo.extraFrontEndOptions,
extraGenSnapshotOptions: buildInfo.extraGenSnapshotOptions, extraGenSnapshotOptions: buildInfo.extraGenSnapshotOptions,
preferSharedLibrary: buildInfo.preferSharedLibrary); preferSharedLibrary: buildInfo.preferSharedLibrary);
...@@ -416,8 +415,7 @@ class IOSSimulator extends Device { ...@@ -416,8 +415,7 @@ class IOSSimulator extends Device {
// When running in previewDart2 mode, we still need to run compiler to // When running in previewDart2 mode, we still need to run compiler to
// produce kernel file for the application. // produce kernel file for the application.
flx.build(precompiledSnapshot: !buildInfo.previewDart2, flx.build(precompiledSnapshot: !buildInfo.previewDart2,
previewDart2: buildInfo.previewDart2, previewDart2: buildInfo.previewDart2);
strongMode: buildInfo.strongMode);
@override @override
Future<bool> stopApp(ApplicationPackage app) async { Future<bool> stopApp(ApplicationPackage app) async {
......
...@@ -25,7 +25,6 @@ void updateXcodeGeneratedProperties({ ...@@ -25,7 +25,6 @@ void updateXcodeGeneratedProperties({
@required String target, @required String target,
@required bool hasPlugins, @required bool hasPlugins,
@required bool previewDart2, @required bool previewDart2,
@required bool strongMode,
}) { }) {
final StringBuffer localsBuffer = new StringBuffer(); final StringBuffer localsBuffer = new StringBuffer();
...@@ -57,8 +56,6 @@ void updateXcodeGeneratedProperties({ ...@@ -57,8 +56,6 @@ void updateXcodeGeneratedProperties({
if (previewDart2) { if (previewDart2) {
localsBuffer.writeln('PREVIEW_DART_2=true'); localsBuffer.writeln('PREVIEW_DART_2=true');
}
if (strongMode) {
localsBuffer.writeln('STRONG=true'); localsBuffer.writeln('STRONG=true');
} }
......
...@@ -38,12 +38,9 @@ class FlutterDevice { ...@@ -38,12 +38,9 @@ class FlutterDevice {
StreamSubscription<String> _loggingSubscription; StreamSubscription<String> _loggingSubscription;
FlutterDevice(this.device, FlutterDevice(this.device, { bool previewDart2 : false }) {
{ bool previewDart2 : false, bool strongMode : false }) {
if (previewDart2) if (previewDart2)
generator = new ResidentCompiler( generator = new ResidentCompiler(artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath));
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
strongMode: strongMode);
} }
String viewFilter; String viewFilter;
...@@ -270,8 +267,8 @@ class FlutterDevice { ...@@ -270,8 +267,8 @@ class FlutterDevice {
} }
final Map<String, dynamic> platformArgs = <String, dynamic>{}; final Map<String, dynamic> platformArgs = <String, dynamic>{};
if (hotRunner.strongMode != null) if (hotRunner.previewDart2 != null)
platformArgs['strong'] = hotRunner.strongMode; platformArgs['strong'] = hotRunner.previewDart2;
startEchoingDeviceLog(); startEchoingDeviceLog();
...@@ -333,8 +330,8 @@ class FlutterDevice { ...@@ -333,8 +330,8 @@ class FlutterDevice {
final Map<String, dynamic> platformArgs = <String, dynamic>{}; final Map<String, dynamic> platformArgs = <String, dynamic>{};
if (coldRunner.traceStartup != null) if (coldRunner.traceStartup != null)
platformArgs['trace-startup'] = coldRunner.traceStartup; platformArgs['trace-startup'] = coldRunner.traceStartup;
if (coldRunner.strongMode != null) if (coldRunner.previewDart2 != null)
platformArgs['strong'] = coldRunner.strongMode; platformArgs['strong'] = coldRunner.previewDart2;
startEchoingDeviceLog(); startEchoingDeviceLog();
......
...@@ -21,7 +21,6 @@ class ColdRunner extends ResidentRunner { ...@@ -21,7 +21,6 @@ class ColdRunner extends ResidentRunner {
this.traceStartup: false, this.traceStartup: false,
this.applicationBinary, this.applicationBinary,
this.previewDart2 : false, this.previewDart2 : false,
this.strongMode : false,
bool stayResident: true, bool stayResident: true,
bool ipv6: false, bool ipv6: false,
}) : super(devices, }) : super(devices,
...@@ -34,7 +33,6 @@ class ColdRunner extends ResidentRunner { ...@@ -34,7 +33,6 @@ class ColdRunner extends ResidentRunner {
final bool traceStartup; final bool traceStartup;
final String applicationBinary; final String applicationBinary;
final bool previewDart2; final bool previewDart2;
final bool strongMode;
@override @override
Future<int> run({ Future<int> run({
......
...@@ -40,7 +40,6 @@ class HotRunner extends ResidentRunner { ...@@ -40,7 +40,6 @@ class HotRunner extends ResidentRunner {
this.benchmarkMode: false, this.benchmarkMode: false,
this.applicationBinary, this.applicationBinary,
this.previewDart2: false, this.previewDart2: false,
this.strongMode: false,
this.hostIsIde: false, this.hostIsIde: false,
String projectRootPath, String projectRootPath,
String packagesFilePath, String packagesFilePath,
...@@ -67,7 +66,6 @@ class HotRunner extends ResidentRunner { ...@@ -67,7 +66,6 @@ class HotRunner extends ResidentRunner {
bool _runningFromSnapshot = true; bool _runningFromSnapshot = true;
bool previewDart2 = false; bool previewDart2 = false;
DateTime firstBuildTime; DateTime firstBuildTime;
bool strongMode = false;
void _addBenchmarkData(String name, int value) { void _addBenchmarkData(String name, int value) {
benchmarkData[name] ??= <int>[]; benchmarkData[name] ??= <int>[];
......
...@@ -163,20 +163,12 @@ abstract class FlutterCommand extends Command<Null> { ...@@ -163,20 +163,12 @@ abstract class FlutterCommand extends Command<Null> {
final bool previewDart2 = argParser.options.containsKey('preview-dart-2') final bool previewDart2 = argParser.options.containsKey('preview-dart-2')
? argResults['preview-dart-2'] ? argResults['preview-dart-2']
: false; : false;
final bool strongMode = argParser.options.containsKey('strong')
? argResults['strong']
: false;
if (strongMode == true && previewDart2 == false) {
throw new UsageException(
'--strong is valid only when --preview-dart-2 is specified.', null);
}
return new BuildInfo(getBuildMode(), return new BuildInfo(getBuildMode(),
argParser.options.containsKey('flavor') argParser.options.containsKey('flavor')
? argResults['flavor'] ? argResults['flavor']
: null, : null,
previewDart2: previewDart2, previewDart2: previewDart2,
strongMode: strongMode,
extraFrontEndOptions: argParser.options.containsKey(FlutterOptions.kExtraFrontEndOptions) extraFrontEndOptions: argParser.options.containsKey(FlutterOptions.kExtraFrontEndOptions)
? argResults[FlutterOptions.kExtraFrontEndOptions] ? argResults[FlutterOptions.kExtraFrontEndOptions]
: null, : null,
...@@ -400,16 +392,6 @@ abstract class FlutterCommand extends Command<Null> { ...@@ -400,16 +392,6 @@ abstract class FlutterCommand extends Command<Null> {
if (!fs.isFileSync(targetPath)) if (!fs.isFileSync(targetPath))
throw new ToolExit('Target file "$targetPath" not found.'); throw new ToolExit('Target file "$targetPath" not found.');
} }
final bool previewDart2 = argParser.options.containsKey('preview-dart-2')
? argResults['preview-dart-2']
: false;
final bool strongMode = argParser.options.containsKey('strong')
? argResults['strong']
: false;
if (strongMode == true && previewDart2 == false) {
throw new ToolExit('--strong is valid only with --preview-dart-2 option.');
}
} }
ApplicationPackageStore applicationPackages; ApplicationPackageStore applicationPackages;
......
...@@ -209,7 +209,6 @@ class _FlutterPlatform extends PlatformPlugin { ...@@ -209,7 +209,6 @@ class _FlutterPlatform extends PlatformPlugin {
incrementalCompilerByteStorePath: '' /* not null is enough */, incrementalCompilerByteStorePath: '' /* not null is enough */,
mainPath: listenerFile.path, mainPath: listenerFile.path,
packagesPath: PackageMap.globalPackagesPath, packagesPath: PackageMap.globalPackagesPath,
strongMode: true,
); );
// bundlePath needs to point to a folder with `platform.dill` file. // bundlePath needs to point to a folder with `platform.dill` file.
...@@ -222,7 +221,7 @@ class _FlutterPlatform extends PlatformPlugin { ...@@ -222,7 +221,7 @@ class _FlutterPlatform extends PlatformPlugin {
// copy 'vm_platform_strong.dill' into 'platform.dill' // copy 'vm_platform_strong.dill' into 'platform.dill'
final File vmPlatformStrongDill = fs.file( final File vmPlatformStrongDill = fs.file(
artifacts.getArtifactPath(Artifact.platformKernelStrongDill), artifacts.getArtifactPath(Artifact.platformKernelDill),
); );
final File platformDill = vmPlatformStrongDill.copySync( final File platformDill = vmPlatformStrongDill.copySync(
tempBundleDirectory.childFile('platform.dill').path, tempBundleDirectory.childFile('platform.dill').path,
...@@ -547,11 +546,12 @@ void main() { ...@@ -547,11 +546,12 @@ void main() {
} }
if (strongMode) { if (strongMode) {
command.add('--strong'); command.add('--strong');
} else {
command.add('--enable-checked-mode');
} }
command.addAll(<String>[ command.addAll(<String>[
'--enable-dart-profiling', '--enable-dart-profiling',
'--non-interactive', '--non-interactive',
'--enable-checked-mode',
'--use-test-fonts', '--use-test-fonts',
// '--enable-txt', // enable this to test libtxt rendering // '--enable-txt', // enable this to test libtxt rendering
'--packages=$packages', '--packages=$packages',
......
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