-
Notifications
You must be signed in to change notification settings - Fork 68
[native_assets_cli] Add base path for user-defines #2209
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
Conversation
PR HealthBreaking changes ✔️
Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
7fe82ee
to
b6e81fa
Compare
b6e81fa
to
7d2d0ae
Compare
We are kind of indirectly exposing the workspace/pubspec path through this: Developers can take a look at the URI returned by |
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.
LGTM modulo some nits and the top-level comment
## 0.16.0-wip | ||
|
||
- Pass in path to pubspec to read user-defines (and read user-defines) in this | ||
package rather than in the SDKs using this package. |
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.
Do you mean to repeat "and read user-defines" in the parentheses? Seems odd...
final pubspec => [pubspec], | ||
}, | ||
); | ||
|
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.
Just wondering if its worthwhile to factor this logic out since it seems to be 1:1 repeated from above?
Thanks @goderbauer ! 🙏
Yes. They can also (1) look at the I see this more as kind of a best effort. We need to document clearly how caching works: It is whatever is in the |
Bug: #39
Closes: #2187
Closes: #2201
Relative paths in user-defines accessible as absolute paths in hooks
This PR enables resolving relative paths in user-defines as absolute paths. The
input.json
now is structured as follows:We don't want to expose the workspace/pubspec path (except for resolving user-defines), so this can be done in the Dart API as follows:
This PR does not yet add support for command-line user-defines. But the JSON has been set up so that it's extensible.
Move reading user-defines from flutter_tools/dartdev to
NativeAssetsBuildRunner
This PR changes the responsibility to read the user-defines from the pubspec to the
NativeAssetsBuildRunner
.This PR adds the pubspec.yaml in the
HookOutput.dependencies
to ensure the build runner is reinvoked if the pubspec changes.The API for the
NativeAssetsBuildRunner
changes to take thepubspec.yaml
uri rather than user-defines. Consequently, this PR will need a manual roll into dartdev and flutter_tools.