Skip to content

Commit d6274c9

Browse files
jakemac53Commit Queue
authored andcommitted
Add a stub of the node_preamble package
This can be used to compile the test package, without depending on the real node_preamble package, which isn't actually used at runtime. Change-Id: Ib1064923ad29b691f4b7ff4a020df172393681dc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399221 Reviewed-by: Sigurd Meldgaard <sigurdm@google.com> Reviewed-by: Nate Bosch <nbosch@google.com> Commit-Queue: Jake Macdonald <jakemac@google.com>
1 parent c57f879 commit d6274c9

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

pkg/node_preamble/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This is a stub of the node_preamble package from pub. It exists only to allow
2+
the test package to statically compile, and throws at runtime if used.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
String getPreamble({bool minified = false}) =>
6+
throw UnsupportedError(
7+
'Stub only, this package is not supported in the Dart SDK',
8+
);

pkg/node_preamble/pubspec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This is just a stub, not the real node_preamble package
2+
name: node_preamble
3+
environment:
4+
sdk: ^3.5.0
5+
publish_to: none

tools/generate_package_config.dart

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,15 @@ void main(List<String> args) {
3232
platform('tools/package_deps'),
3333
];
3434

35-
var cfePackageDirs = [
36-
platform('pkg/front_end/testcases'),
37-
];
35+
var cfePackageDirs = [platform('pkg/front_end/testcases')];
3836

3937
var feAnalyzerSharedPackageDirs = [
4038
platform('pkg/_fe_analyzer_shared/test/exhaustiveness/data'),
4139
platform('pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables'),
4240
platform('pkg/_fe_analyzer_shared/test/flow_analysis/definite_assignment'),
4341
platform(
44-
'pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment'),
42+
'pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment',
43+
),
4544
platform('pkg/_fe_analyzer_shared/test/flow_analysis/nullability'),
4645
platform('pkg/_fe_analyzer_shared/test/flow_analysis/reachability'),
4746
platform('pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion'),
@@ -53,9 +52,7 @@ void main(List<String> args) {
5352
platform('pkg/frontend_server/test/fixtures'),
5453
];
5554

56-
var pkgVmPackageDirs = [
57-
platform('pkg/vm/testcases'),
58-
];
55+
var pkgVmPackageDirs = [platform('pkg/vm/testcases')];
5956

6057
var sampleDirs = listSubdirectories(platform('samples')).toList();
6158

@@ -179,7 +176,9 @@ Iterable<Package> makePackageConfigs(List<String> packageDirs) sync* {
179176

180177
/// Generates package configurations for the special pseudo-packages.
181178
Iterable<Package> makeSpecialPackageConfigs(
182-
String packageNamePrefix, List<String> packageDirs) sync* {
179+
String packageNamePrefix,
180+
List<String> packageDirs,
181+
) sync* {
183182
// TODO: Remove the use of '.nonexisting/'.
184183
for (var packageDir in packageDirs) {
185184
yield Package(
@@ -198,8 +197,8 @@ Iterable<Package> makeCfePackageConfigs(List<String> packageDirs) =>
198197
/// Generates package configurations for the special pseudo-packages used by the
199198
/// _fe_analyzer_shared id tests.
200199
Iterable<Package> makeFeAnalyzerSharedPackageConfigs(
201-
List<String> packageDirs) =>
202-
makeSpecialPackageConfigs('_fe_analyzer_shared', packageDirs);
200+
List<String> packageDirs,
201+
) => makeSpecialPackageConfigs('_fe_analyzer_shared', packageDirs);
203202

204203
/// Generates package configurations for the special pseudo-packages used by the
205204
/// frontend_server tests.

0 commit comments

Comments
 (0)