(ddk modular test) exclude sources from dill files.

This fixes the issue we had with shared/diamond depedencies.  This also matches
more closely how DDK is invoked internally and externally.

While the change to use `--dart-sdk-summary` is not necessary, this brings the
API closer to how it is used elsewhere. It should be cleaned up in the future to
reuse the `--input-summary` flag instead.

Change-Id: Iec3695b5541ffaf7f5762a3d77f071a596237da1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119723
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
Sigmund Cherem 2019-10-02 22:22:11 +00:00 committed by commit-bot@chromium.org
parent 70af20bda5
commit 33494de2f9
5 changed files with 25 additions and 1 deletions

View file

@ -81,6 +81,9 @@ class SourceToSummaryDillStep implements IOModularStep {
extraArgs = ['--packages-file', '$rootScheme:/.packages']; extraArgs = ['--packages-file', '$rootScheme:/.packages'];
} }
Module sdkModule =
module.isSdk ? module : module.dependencies.firstWhere((m) => m.isSdk);
List<String> args = [ List<String> args = [
_kernelWorkerScript, _kernelWorkerScript,
'--summary-only', '--summary-only',
@ -93,8 +96,14 @@ class SourceToSummaryDillStep implements IOModularStep {
...extraArgs, ...extraArgs,
'--output', '--output',
'${toUri(module, dillId)}', '${toUri(module, dillId)}',
if (!module.isSdk) ...[
'--dart-sdk-summary',
'${toUri(sdkModule, dillId)}',
'--exclude-non-sources',
],
...(transitiveDependencies ...(transitiveDependencies
.expand((m) => ['--input-linked', '${toUri(m, dillId)}'])), .where((m) => !m.isSdk)
.expand((m) => ['--input-summary', '${toUri(m, dillId)}'])),
...(sources.expand((String uri) => ['--source', uri])), ...(sources.expand((String uri) => ['--source', uri])),
...(flags.expand((String flag) => ['--enable-experiment', flag])), ...(flags.expand((String flag) => ['--enable-experiment', flag])),
]; ];

View file

@ -0,0 +1,3 @@
import 'b.dart';
var item = b;

View file

@ -0,0 +1,3 @@
class B {}
var b = new B();

View file

@ -0,0 +1,6 @@
import 'b.dart';
import 'a.dart';
main() {
print([item, b]);
}

View file

@ -0,0 +1,3 @@
dependencies:
main: [a, b]
a: b