-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demo of using a root .dart_tool/package_config.json
instead of pubspec.yaml
#51782
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" | ||
} | ||
] | ||
} |
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 | ||
|
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 | ||
|
||
|
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.
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?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.