Pipe strong mode option for iOS simulator. (#14002)

This commit is contained in:
Alexander Aprelev
2018-01-11 14:08:28 -08:00
committed by GitHub
parent 991765780b
commit bedf987fc8
3 changed files with 19 additions and 5 deletions

View File

@@ -120,14 +120,16 @@ Future<String> compile(
/// The wrapper is intended to stay resident in memory as user changes, reloads,
/// restarts the Flutter app.
class ResidentCompiler {
ResidentCompiler(this._sdkRoot)
ResidentCompiler(this._sdkRoot, {bool strongMode: false})
: assert(_sdkRoot != null) {
// This is a URI, not a file path, so the forward slash is correct even on Windows.
if (!_sdkRoot.endsWith('/'))
_sdkRoot = '$_sdkRoot/';
_strongMode = strongMode;
}
String _sdkRoot;
bool _strongMode;
Process _server;
final _StdoutHandler stdoutHandler = new _StdoutHandler();
@@ -157,13 +159,17 @@ class ResidentCompiler {
final String frontendServer = artifacts.getArtifactPath(
Artifact.frontendServerSnapshotForEngineDartSdk
);
_server = await processManager.start(<String>[
final List<String> args = <String>[
_dartExecutable(),
frontendServer,
'--sdk-root',
_sdkRoot,
'--incremental'
]);
];
if (_strongMode) {
args.add('--strong');
}
_server = await processManager.start(args);
_server.stdout
.transform(UTF8.decoder)
.transform(const LineSplitter())

View File

@@ -42,7 +42,8 @@ class FlutterDevice {
{ bool previewDart2 : false, bool strongMode : false }) {
if (previewDart2)
generator = new ResidentCompiler(
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath));
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
strongMode: strongMode);
}
String viewFilter;