You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you using the Chinese community mirror or a corporate firewall? No
Problem
We commonly use a pubspec_overrides.yaml file during development to set a relative path to internal packages (in different repositories) that our app depends on, leaving the pubspec.yaml set to a git URL to not break builds on our CI server. We don't commit pubspec_overrides.yaml.
Occasionally, we use the dependency_overrides section of the pubspec.yaml to force a later version of a third-party dependency, which is needed on our CI server. This override is ignored by dart pub get|upgrade unless it is repeated in the pubspec_overrides.yaml file. This is cumbersome and can be error-prone.
pubspec.yaml
name: exampledescription: Example Apppublish_to: "none"version: 1.0.0environment:
sdk: ">=3.0.0 <4.0.0"dependencies:
...firebase_core: ^2.32.0flutter:
sdk: flutterexample_common:
git:
url: ssh://git@bitbucket.org/example/example-common.gitref: v1.0.0...dependency_overrides:
# This override will be ignored if it's not specified in pubspec_overrides.yamlfirebase_core: ^3.2.0
pubspec_overrides
dependency_overrides:
example_common:
path: ../example_common# The override of firebase_core in pubspec.yaml will be ignored unless also specified herefirebase_core: ^3.2.0
Expected behavior
I expected that the dependency overrides in pubspec_overrides.yaml would complement overrides in pubspec.yaml.
Actual behavior
The dependency overrides in pubspec.yaml are ignored.
The text was updated successfully, but these errors were encountered:
which could also be handled by setting the override accordingly.
Not sure I get how this would be done.
Say foo is overridden in pubspec.yaml. How would you create a pubspec_overrides.yaml that removes the override?
I vaguely remember us discussing this, and deciding this was the most useful and predictable behavior. It seems to me simpler that a field in pubspec_overrides replaces the same field in pubspec.yaml, not merging with it.
I can fully see how there are cases where you desire the merging behavior.
Environment
Problem
We commonly use a
pubspec_overrides.yaml
file during development to set a relative path to internal packages (in different repositories) that our app depends on, leaving thepubspec.yaml
set to a git URL to not break builds on our CI server. We don't commitpubspec_overrides.yaml
.Occasionally, we use the
dependency_overrides
section of thepubspec.yaml
to force a later version of a third-party dependency, which is needed on our CI server. This override is ignored bydart pub get|upgrade
unless it is repeated in thepubspec_overrides.yaml
file. This is cumbersome and can be error-prone.pubspec.yaml
pubspec_overrides
Expected behavior
I expected that the dependency overrides in
pubspec_overrides.yaml
would complement overrides inpubspec.yaml
.Actual behavior
The dependency overrides in
pubspec.yaml
are ignored.The text was updated successfully, but these errors were encountered: