Use unsafePackageSerialization when running tests (#22407)

This commit is contained in:
jensjoha 2018-10-02 08:36:21 +02:00 committed by GitHub
parent 85a4591aa3
commit 4bd6ad7395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -250,7 +250,7 @@ class ResidentCompiler {
ResidentCompiler(this._sdkRoot, {bool trackWidgetCreation = false,
String packagesPath, List<String> fileSystemRoots, String fileSystemScheme,
CompilerMessageConsumer compilerMessageConsumer = printError,
String initializeFromDill})
String initializeFromDill, bool unsafePackageSerialization})
: assert(_sdkRoot != null),
_trackWidgetCreation = trackWidgetCreation,
_packagesPath = packagesPath,
@ -258,7 +258,8 @@ class ResidentCompiler {
_fileSystemScheme = fileSystemScheme,
_stdoutHandler = _StdoutHandler(consumer: compilerMessageConsumer),
_controller = StreamController<_CompilationRequest>(),
_initializeFromDill = initializeFromDill {
_initializeFromDill = initializeFromDill,
_unsafePackageSerialization = unsafePackageSerialization {
// This is a URI, not a file path, so the forward slash is correct even on Windows.
if (!_sdkRoot.endsWith('/'))
_sdkRoot = '$_sdkRoot/';
@ -272,6 +273,7 @@ class ResidentCompiler {
Process _server;
final _StdoutHandler _stdoutHandler;
String _initializeFromDill;
bool _unsafePackageSerialization;
final StreamController<_CompilationRequest> _controller;
@ -369,6 +371,9 @@ class ResidentCompiler {
if (_initializeFromDill != null) {
command.addAll(<String>['--initialize-from-dill', _initializeFromDill]);
}
if (_unsafePackageSerialization == true) {
command.add('--unsafe-package-serialization');
}
printTrace(command.join(' '));
_server = await processManager.start(command);
_server.stdout

View File

@ -238,7 +238,8 @@ class _Compiler {
packagesPath: PackageMap.globalPackagesPath,
trackWidgetCreation: trackWidgetCreation,
compilerMessageConsumer: reportCompilerMessage,
initializeFromDill: testFilePath
initializeFromDill: testFilePath,
unsafePackageSerialization: true,
);
}