Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个在项目中使用的库,我想根据项目的分支来使用库的一个分支。
例如,如果项目分支是开发,我希望通过 pubspec 获取库的分支也是开发。
笔记:
项目和图书馆都有开发分支。
还将有测试、阶段和生产分支。
flutter_payments_helper: git: url: 'git@github.com:my_project/library.git' ref: 'development' // <---
不,YAML 不支持条件逻辑,pubspec 解析器也不支持。我能提供的最好的方法是向您的 CI 流程添加一个在运行期间修改 pubspec 的工具。您还可以在开发期间在本地机器上使用该工具,并添加一些执行它的 git 钩子。