3

I created a library which I used on a project, I want to use a branch of the library depending of what branch the project is.

For example, if the project branch is development, I want the library's branch to be get by pubspec is to be development as well.

Note:

  • Both project and library have development branch.

  • There would be test, stage and production branch as well.

     flutter_payments_helper:
     git:
       url: 'git@github.com:my_project/library.git'
       ref: 'development' // <---
    
Kokuou
  • 129
  • 2
  • 9

1 Answers1

2

No, YAML does not supports conditional logic nor does the pubspec parser. The best I can offer to add a tool to your CI process that modifies the pubspec during its run. You could also use that tool on your local machine during development and be fancy and add some git hooks that execute it.

Nico Spencer
  • 940
  • 6
  • 11