@@ -22,6 +22,7 @@ import '../src/fakes.dart';
22
22
void main () {
23
23
late ResidentCompiler generator;
24
24
late ResidentCompiler generatorWithScheme;
25
+ late ResidentCompiler generatorWithPlatformDillAndLibrariesSpec;
25
26
late MemoryIOSink frontendServerStdIn;
26
27
late BufferLogger testLogger;
27
28
late StdoutHandler generatorStdoutHandler;
@@ -76,6 +77,18 @@ void main() {
76
77
fileSystem: MemoryFileSystem .test (),
77
78
stdoutHandler: generatorWithSchemeStdoutHandler,
78
79
);
80
+ generatorWithPlatformDillAndLibrariesSpec = DefaultResidentCompiler (
81
+ 'sdkroot' ,
82
+ buildMode: BuildMode .debug,
83
+ logger: testLogger,
84
+ processManager: fakeProcessManager,
85
+ artifacts: Artifacts .test (),
86
+ platform: FakePlatform (),
87
+ fileSystem: MemoryFileSystem .test (),
88
+ stdoutHandler: generatorStdoutHandler,
89
+ platformDill: '/foo/platform.dill' ,
90
+ librariesSpec: '/bar/libraries.json' ,
91
+ );
79
92
});
80
93
81
94
testWithoutContext ('incremental compile single dart compile' , () async {
@@ -431,6 +444,32 @@ void main() {
431
444
expect (output? .outputFilename, equals ('/path/to/main.dart.dill' ));
432
445
expect (fakeProcessManager, hasNoRemainingExpectations);
433
446
});
447
+
448
+ testWithoutContext ('compile does not pass libraries-spec when using a platform dill' , () async {
449
+ fakeProcessManager.addCommand (FakeCommand (
450
+ command: const < String > [
451
+ ...frontendServerCommand,
452
+ '--platform' ,
453
+ '/foo/platform.dill' ,
454
+ '--verbosity=error'
455
+ ],
456
+ stdout: 'result abc\n line1\n line2\n abc\n abc /path/to/main.dart.dill 0' ,
457
+ stdin: frontendServerStdIn,
458
+ ));
459
+
460
+ final CompilerOutput ? output = await generatorWithPlatformDillAndLibrariesSpec.recompile (
461
+ Uri .parse ('/path/to/main.dart' ),
462
+ null /* invalidatedFiles */ ,
463
+ outputPath: '/build/' ,
464
+ packageConfig: PackageConfig .empty,
465
+ fs: MemoryFileSystem (),
466
+ projectRootPath: '' ,
467
+ );
468
+ expect (frontendServerStdIn.getAndClear (), 'compile /path/to/main.dart\n ' );
469
+ expect (testLogger.errorText, equals ('line1\n line2\n ' ));
470
+ expect (output? .outputFilename, equals ('/path/to/main.dart.dill' ));
471
+ expect (fakeProcessManager, hasNoRemainingExpectations);
472
+ });
434
473
}
435
474
436
475
Future <void > _recompile (
0 commit comments