mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
(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:
parent
70af20bda5
commit
33494de2f9
5 changed files with 25 additions and 1 deletions
|
@ -81,6 +81,9 @@ class SourceToSummaryDillStep implements IOModularStep {
|
|||
extraArgs = ['--packages-file', '$rootScheme:/.packages'];
|
||||
}
|
||||
|
||||
Module sdkModule =
|
||||
module.isSdk ? module : module.dependencies.firstWhere((m) => m.isSdk);
|
||||
|
||||
List<String> args = [
|
||||
_kernelWorkerScript,
|
||||
'--summary-only',
|
||||
|
@ -93,8 +96,14 @@ class SourceToSummaryDillStep implements IOModularStep {
|
|||
...extraArgs,
|
||||
'--output',
|
||||
'${toUri(module, dillId)}',
|
||||
if (!module.isSdk) ...[
|
||||
'--dart-sdk-summary',
|
||||
'${toUri(sdkModule, dillId)}',
|
||||
'--exclude-non-sources',
|
||||
],
|
||||
...(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])),
|
||||
...(flags.expand((String flag) => ['--enable-experiment', flag])),
|
||||
];
|
||||
|
|
3
tests/modular/diamond/a.dart
Normal file
3
tests/modular/diamond/a.dart
Normal file
|
@ -0,0 +1,3 @@
|
|||
import 'b.dart';
|
||||
|
||||
var item = b;
|
3
tests/modular/diamond/b.dart
Normal file
3
tests/modular/diamond/b.dart
Normal file
|
@ -0,0 +1,3 @@
|
|||
class B {}
|
||||
|
||||
var b = new B();
|
6
tests/modular/diamond/main.dart
Normal file
6
tests/modular/diamond/main.dart
Normal file
|
@ -0,0 +1,6 @@
|
|||
import 'b.dart';
|
||||
import 'a.dart';
|
||||
|
||||
main() {
|
||||
print([item, b]);
|
||||
}
|
3
tests/modular/diamond/modules.yaml
Normal file
3
tests/modular/diamond/modules.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
dependencies:
|
||||
main: [a, b]
|
||||
a: b
|
Loading…
Reference in a new issue