-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for resolving package config and pubspec.lock in workspaces (#…
…3684) Instead of expecting pubspec.lock and .dart_tool/package_config.json to reside in the same folder as pubspec.yaml, we visit each parent of the current directory until we find a .dart_tool/package_config.json, and expect pubspec.lock to exist next to that. Also invoke the generated scripts with an explicit packageConfig. This is to support running build_runner build in a workspace package, as implemented in dart-lang/pub#4127 --------- Co-authored-by: Jake Macdonald <[email protected]>
- Loading branch information
Showing
11 changed files
with
118 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
build_runner_core/test/fixtures/workspace/.dart_tool/package_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"configVersion": 2, | ||
"packages": [ | ||
{ | ||
"name": "workspace", | ||
"rootUri": "../", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.5" | ||
}, | ||
{ | ||
"name": "a", | ||
"rootUri": "../pkgs/a", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.5" | ||
}, | ||
{ | ||
"name": "b", | ||
"rootUri": "../pkgs/b", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.5" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Take special care to include the .dart_tool/package_config.json | ||
# | ||
!.dart_tool | ||
.dart_tool/* | ||
!.dart_tool/package_config.json |
6 changes: 6 additions & 0 deletions
6
build_runner_core/test/fixtures/workspace/pkgs/a/pubspec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: a | ||
environment: | ||
sdk: ^3.5.0-0 | ||
resolution: workspace | ||
dependencies: | ||
b: |
4 changes: 4 additions & 0 deletions
4
build_runner_core/test/fixtures/workspace/pkgs/b/pubspec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: b | ||
environment: | ||
sdk: ^3.5.0-0 | ||
resolution: workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Generated by pub | ||
# See https://dart.dev/tools/pub/glossary#lockfile | ||
packages: {} | ||
sdks: | ||
dart: ">=3.5.0-0 <4.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: workspace | ||
environment: | ||
sdk: ^3.5.0-0 | ||
workspace: | ||
- pkgs/a | ||
- pkgs/b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters