Commit 58de642 1 parent 7745ee7 commit 58de642 Copy full SHA for 58de642
File tree 3 files changed +77
-8
lines changed
3 files changed +77
-8
lines changed Original file line number Diff line number Diff line change @@ -513,7 +513,10 @@ Package `$override` at `${overriddenWorkspacePackage.presentationDir}` is overri
513
513
// By adding this to visited we will never go above the workspaceRoot.dir.
514
514
p.canonicalize (root.dir),
515
515
};
516
- for (final package in root.transitiveWorkspace) {
516
+ for (final package in root.transitiveWorkspace
517
+ // We don't want to look at the roots parents. The first package is always
518
+ // the root, so skip that.
519
+ .skip (1 )) {
517
520
// Run through all parent directories until we meet another workspace
518
521
// package.
519
522
for (final dir in parentDirs (package.dir).skip (1 )) {
Original file line number Diff line number Diff line change @@ -5,23 +5,23 @@ packages:
5
5
dependency: transitive
6
6
description:
7
7
name: _fe_analyzer_shared
8
- sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab "
8
+ sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77 "
9
9
url: "https://pub.dev"
10
10
source: hosted
11
- version: "76 .0.0"
11
+ version: "73 .0.0"
12
12
_macros:
13
13
dependency: transitive
14
14
description: dart
15
15
source: sdk
16
- version: "0.3.3 "
16
+ version: "0.3.2 "
17
17
analyzer:
18
18
dependency: "direct main"
19
19
description:
20
20
name: analyzer
21
- sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e "
21
+ sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a "
22
22
url: "https://pub.dev"
23
23
source: hosted
24
- version: "6.11 .0"
24
+ version: "6.8 .0"
25
25
args:
26
26
dependency: "direct main"
27
27
description:
@@ -194,10 +194,10 @@ packages:
194
194
dependency: transitive
195
195
description:
196
196
name: macros
197
- sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656 "
197
+ sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536 "
198
198
url: "https://pub.dev"
199
199
source: hosted
200
- version: "0.1.3 -main.0 "
200
+ version: "0.1.2 -main.4 "
201
201
matcher:
202
202
dependency: transitive
203
203
description:
Original file line number Diff line number Diff line change @@ -1491,6 +1491,72 @@ Consider removing one of the overrides.''',
1491
1491
);
1492
1492
});
1493
1493
1494
+ test (
1495
+ 'rejects workspace with non-workspace between root and workspace package' ,
1496
+ () async {
1497
+ await dir (appPath, [
1498
+ libPubspec (
1499
+ 'myapp' ,
1500
+ '1.2.3' ,
1501
+ extras: {
1502
+ 'workspace' : ['pkgs/a' ],
1503
+ },
1504
+ sdk: '^3.5.0' ,
1505
+ ),
1506
+ dir ('pkgs' , [
1507
+ libPubspec (
1508
+ 'in_the_way' ,
1509
+ '1.0.0' ,
1510
+ ),
1511
+ dir ('a' , [
1512
+ libPubspec (
1513
+ 'a' ,
1514
+ '1.0.0' ,
1515
+ resolutionWorkspace: true ,
1516
+ ),
1517
+ ]),
1518
+ ]),
1519
+ ]).create ();
1520
+ await pubGet (
1521
+ environment: {'_PUB_TEST_SDK_VERSION' : '3.5.0' },
1522
+ error: contains (
1523
+ 'The file `.${s }pkgs${s }pubspec.yaml` is located in a directory '
1524
+ 'between the workspace root at' ,
1525
+ ),
1526
+ );
1527
+ });
1528
+
1529
+ test ('Doesn\t complain about pubspecs above the workspace' , () async {
1530
+ // Regression test for https://github.com/dart-lang/pub/issues/4463
1531
+ await dir (appPath, [
1532
+ libPubspec (
1533
+ 'not_in_the_way' ,
1534
+ '1.0.0' ,
1535
+ ),
1536
+ dir ('pkgs' , [
1537
+ libPubspec (
1538
+ 'myapp' ,
1539
+ '1.2.3' ,
1540
+ extras: {
1541
+ 'workspace' : ['a' ],
1542
+ },
1543
+ sdk: '^3.5.0' ,
1544
+ ),
1545
+ dir ('a' , [
1546
+ libPubspec (
1547
+ 'a' ,
1548
+ '1.0.0' ,
1549
+ resolutionWorkspace: true ,
1550
+ ),
1551
+ ]),
1552
+ ]),
1553
+ ]).create ();
1554
+ await pubGet (
1555
+ environment: {'_PUB_TEST_SDK_VERSION' : '3.5.0' },
1556
+ workingDirectory: p.join (sandbox, appPath, 'pkgs' ),
1557
+ );
1558
+ });
1559
+
1494
1560
test ('overrides are applied' , () async {
1495
1561
final server = await servePackages ();
1496
1562
server.serve ('foo' , '1.0.0' );
You can’t perform that action at this time.
0 commit comments