Skip to content

isUpToDate based on package_config.json#4160

Merged
sigurdm merged 11 commits into
dart-lang:masterfrom
sigurdm:isUpToDate_based_on_package_config
Mar 5, 2024
Merged

isUpToDate based on package_config.json#4160
sigurdm merged 11 commits into
dart-lang:masterfrom
sigurdm:isUpToDate_based_on_package_config

Conversation

@sigurdm

@sigurdm sigurdm commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

Updates the logic we use in _isUptoDate.

Fixes #4153

Instead of grepping the lockfile for presence of path-dependencies we compare timestamps against the pubspec.yamls of all packages mentioned in .dart_tool/package_config.json. In the "fast" case we avoid reading any other file than package_config.json, and avoid dealing with yaml.

This will make _isUpToDate possible when we introduce workspace support. We don't need to parse pubspec.yamls to find all packages in the workspace, but can rather just look at all the entries in package_config.json.

This PR also adds new entries in package_config.json: pub_cache, flutter_root and flutter_version. If any of these changes, we require a new resolution.

We remove the "checkForSdkUpdate" option. And now always redo resolution when the flutter or dart sdk gets updated.

@jonasfj jonasfj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor nits,

Comment thread lib/src/entrypoint.dart Outdated
Comment thread lib/src/entrypoint.dart Outdated
Comment thread lib/src/entrypoint.dart Outdated
Comment thread lib/src/entrypoint.dart Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Base ensureUptodate on .dart_tool/package_config.json

2 participants