This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Demo of using a root .dart_tool/package_config.json
instead of pubspec.yaml
#51782
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,143 @@ | ||
{ | ||
"configVersion": 2, | ||
"packages": [ | ||
{ | ||
"name": "args", | ||
"rootUri": "../../third_party/dart/third_party/pkg/args", | ||
"packageUri": "lib/", | ||
"languageVersion": "2.19" | ||
}, | ||
{ | ||
"name": "async", | ||
"rootUri": "../../third_party/dart/third_party/pkg/async", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.2" | ||
}, | ||
{ | ||
"name": "async_helper", | ||
"rootUri": "../../third_party/dart/pkg/async_helper", | ||
"packageUri": "lib/", | ||
"languageVersion": "2.19" | ||
}, | ||
{ | ||
"name": "collection", | ||
"rootUri": "../../third_party/dart/third_party/pkg/collection", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.1" | ||
}, | ||
{ | ||
"name": "engine_build_configs", | ||
"rootUri": "../tools/pkg/engine_build_configs", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.2" | ||
}, | ||
{ | ||
"name": "engine_repo_tools", | ||
"rootUri": "../tools/pkg/engine_repo_tools", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.2" | ||
}, | ||
{ | ||
"name": "engine_tool", | ||
"rootUri": "../tools/engine_tool", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.2" | ||
}, | ||
{ | ||
"name": "expect", | ||
"rootUri": "../../third_party/dart/pkg/expect", | ||
"packageUri": "lib/", | ||
"languageVersion": "2.19" | ||
}, | ||
{ | ||
"name": "file", | ||
"rootUri": "../../third_party/dart/third_party/pkg/file/packages/file", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.0" | ||
}, | ||
{ | ||
"name": "litetest", | ||
"rootUri": "../testing/litetest", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.2" | ||
}, | ||
{ | ||
"name": "logging", | ||
"rootUri": "../../third_party/dart/third_party/pkg/logging", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.2" | ||
}, | ||
{ | ||
"name": "meta", | ||
"rootUri": "../../third_party/dart/pkg/meta", | ||
"packageUri": "lib/", | ||
"languageVersion": "2.12" | ||
}, | ||
{ | ||
"name": "path", | ||
"rootUri": "../../third_party/dart/third_party/pkg/path", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.0" | ||
}, | ||
{ | ||
"name": "platform", | ||
"rootUri": "../third_party/pkg/platform", | ||
"packageUri": "lib/", | ||
"languageVersion": "2.12" | ||
}, | ||
{ | ||
"name": "process", | ||
"rootUri": "../third_party/pkg/process", | ||
"packageUri": "lib/", | ||
"languageVersion": "2.12" | ||
}, | ||
{ | ||
"name": "process_fakes", | ||
"rootUri": "../tools/pkg/process_fakes", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.2" | ||
}, | ||
{ | ||
"name": "process_runner", | ||
"rootUri": "../third_party/pkg/process_runner", | ||
"packageUri": "lib/", | ||
"languageVersion": "2.12" | ||
}, | ||
{ | ||
"name": "smith", | ||
"rootUri": "../../third_party/dart/pkg/smith", | ||
"packageUri": "lib/", | ||
"languageVersion": "2.12" | ||
}, | ||
{ | ||
"name": "source_span", | ||
"rootUri": "../../third_party/dart/third_party/pkg/source_span", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.1" | ||
}, | ||
{ | ||
"name": "string_scanner", | ||
"rootUri": "../../third_party/dart/third_party/pkg/string_scanner", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.0" | ||
}, | ||
{ | ||
"name": "term_glyph", | ||
"rootUri": "../../third_party/dart/third_party/pkg/term_glyph", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.0" | ||
}, | ||
{ | ||
"name": "yaml", | ||
"rootUri": "../../third_party/dart/third_party/pkg/yaml", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.0" | ||
}, | ||
{ | ||
"name": "_engine", | ||
"rootUri": "../", | ||
"packageUri": "lib/", | ||
"languageVersion": "3.3" | ||
} | ||
] | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# commonly generated files | ||
# Commonly generated files | ||
*.pyc | ||
*~ | ||
.*.sw? | ||
|
@@ -8,7 +8,6 @@ | |
.classpath | ||
.clangd/ | ||
.cproject | ||
.dart_tool | ||
.gdb_history | ||
.checkstyle | ||
.gdbinit | ||
|
@@ -28,6 +27,14 @@ pubspec.lock | |
docs/doxygen/ | ||
xcuserdata | ||
|
||
# Typical projects would hide all of .dart_tool, but we're treating it as a | ||
# mono repository to resolve packages across the entire repository, so hide | ||
# .dart_tool but allow the .dart_tool/package_config.json file. | ||
.dart_tool/** | ||
!.dart_tool/package_config.json | ||
# But ignore the .dart_tool directory in any subdirectories. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/But/and |
||
*/**/.dart_tool/ | ||
|
||
# Miscellaneous | ||
*.class | ||
*.lock | ||
|
@@ -56,7 +63,6 @@ xcuserdata | |
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -16,6 +16,17 @@ analyzer: | |
deprecated_member_use: ignore | ||
deprecated_member_use_from_same_package: ignore | ||
exclude: # DIFFERENT FROM FLUTTER/FLUTTER | ||
# Directories that might have Dart code, but aren't part of the engine, i.e. | ||
# vended directories or code that is copied by tooling. | ||
- prebuilts/ | ||
- third_party/ | ||
# Directories that have Dart code, but the Dart code isn't resolvable by the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we already think we're analyzing some or all of this Dart code: https://github.com/flutter/engine/blob/main/ci/analyze.sh#L58 and below. Why are we not already hitting problems with this? |
||
# analyzer, i.e. it uses custom embedding or other tooling that the analyzer | ||
# can't be aware of. | ||
- examples/ | ||
- impeller/ | ||
- runtime/ | ||
- shell/ | ||
# Fixture depends on dart:ui and raises false positives. | ||
- flutter_frontend_server/test/fixtures/lib/main.dart | ||
|
||
|
This file contains hidden or 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we'd probably want some documentation to explain how to add/remove dependencies. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there are a tool or package other than
pub
that knows how to generate apackage_config.json
file with the right schema?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
package_config
package has atoJson
method onPackageConfig
. I am not sure what the API for creating PackageConfig objects is like, but you could use that. Ultimately it would just be more complicated I think than maintaining this file.The Dart SDK has a bespoke tool for it also which does more sort of auto-creation based on looking in specific directories for packages, which might be an option here.