Thanks, that is a good suggestion. I did a quick try and git submodules can do the trick, if putting the plugin in the root of a repo and then adding to the target repo with:
git submodule add <plugin_repo.git> snap/plugins/
git commit -am "Add plugin as submodule"
Then I can clone everything elsewhere with
git clone --recurse-submodules <my_repo.git>
This can work in my use case, but I feel it is limited too:
- It would not be possible to use local plugins from more that one source
- You need to explicitly clone with the
--recurse-submodules option or init/update the submodules. There is no easy way to warn developers from snapcraft.yaml if they forgot or did not know about that (this is a generic problem with git submodule I think: the
submodule.recurse config option does not apply to git clone)
- I wonder if www.snapcraft.io will use --recurse-submodules by default when building a snap (it probably should if it is not doing it already)
So a solution integrated with snapcraft would still be interesting, I think.