在 Flame 中,我们有一个带有 Flame 及其桥接包的 monorepo,所有的桥接包都将 Flame 作为路径依赖项(而不是在它们发布时)。似乎不可能同时依赖我们的主分支和主分支上的桥接库,我在pubspec.yaml
文件中有这个:
dependencies:
flutter:
sdk: flutter
flame:
git:
url: git@github.com:flame-engine/flame.git
path: packages/flame
ref: main
flame_fire_atlas:
git:
url: git@github.com:flame-engine/flame.git
path: packages/flame_fire_atlas
ref: main
dependency_overrides:
flame:
git:
url: git@github.com:flame-engine/flame.git
path: packages/flame
ref: main
这样做时,pub get
我得到:
Error on line 15, column 11: Invalid description in the "flame_fire_atlas" pubspec on the "flame" dependency: "../flame" is a relative path, but this isn't a local pubspec.
╷
15 │ path: ../flame
│ ^^^^^^^^
╵
pub get failed (65; ╵)
这表明dependency_override
未使用,是否无法覆盖路径依赖项?