我想将一个颤振项目组织成一个具有以下要求的多包项目:
我现在拥有的存储库的文件设置是:
.
??? app_base
? ??? ...
? ??? pubspec.yaml
??? feature
? ??? ...
? ??? pubspec.yaml
??? README.md
Run Code Online (Sandbox Code Playgroud)
我尝试在以下内容中使用这样的路径依赖项app_base/pubspec.yaml:
name: app_base
dependencies:
feature:
path: ../feature
Run Code Online (Sandbox Code Playgroud)
它适用于本地开发,但如果我尝试app_base在一个完全不同的项目中使用并且不使用路径而是使用 git 依赖项:
name: actual_app
dependencies:
app_base:
git:
url: ssh://address.to/the_repo.git
path: app_base
ref: deadbaca
Run Code Online (Sandbox Code Playgroud)
它无法解决传递feature依赖:
Running "flutter packages get" in actual_app...
Error on line 21, column 11: Invalid description: "../feature" is a relative path, but this isn't a local pubspec.
path: ../feature
^^^^^^^^^^ …Run Code Online (Sandbox Code Playgroud)