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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 5 deletions

View File

@ -93,6 +93,11 @@ BuildApp() {
preview_dart_2_flag="--preview-dart-2"
fi
local strong_flag=""
if [[ -n "$STRONG" ]]; then
strong_flag="--strong"
fi
if [[ "$CURRENT_ARCH" != "x86_64" ]]; then
local aot_flags=""
if [[ "$build_mode" == "debug" ]]; then
@ -107,7 +112,8 @@ BuildApp() {
--target="${target_path}" \
${aot_flags} \
${local_engine_flag} \
${preview_dart_2_flag}
${preview_dart_2_flag} \
${strong_flag} \
if [[ $? -ne 0 ]]; then
EchoError "Failed to build ${project_path}."
@ -140,6 +146,7 @@ BuildApp() {
${precompilation_flag} \
${local_engine_flag} \
${preview_dart_2_flag} \
${strong_flag} \
if [[ $? -ne 0 ]]; then
EchoError "Failed to package ${project_path}."

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;