I have a couple of small dart demo projects together in one git repository. Thus each project is in a subfolder of the repository and the yaml files of each of these projects is in the corresponding folder, not under the root of the repo. Is there a way to specify a git dependency to such a subfolder within a git repo? I know that I can clone the repository manually and use a file path in the dependency specification. But what I'm looking for is a way to have a direct git url for that package in a subdir. Is this possible?
Several years on, support for this has been added:
https://github.com/dart-lang/pub/pull/1650
You can now split the git
dependency into a url
and path
:
dependencies:
protobuf:
git:
url: git://github.com/dart-lang/protobuf.git
path: protobuf
Further reading: https://dart.dev/tools/pub/dependencies#git-packages
This is the answer I got from the dev team:
"This isn't something we're planning to support. Repos should have one-to-one correspondences with packages, and the packages should be located at the top level of the repos."
This makes it difficult to use dependencies to packages in a git repository as Eclipse always uses the project root as subfolder in the repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With