[gsoc] DUB - Ideas
Joseph Rushton Wakeling
joseph.wakeling at webdrake.net
Sun Mar 3 15:59:44 UTC 2019
On Sunday, 3 March 2019 at 13:43:15 UTC, Seb wrote:
> On Sunday, 3 March 2019 at 13:24:21 UTC, Joseph Rushton
> Wakeling wrote:
>> One can already just add a git submodule and point the dub
>> dependency declaration at the resulting directory.
>
> Dub doesn't support git submodules (because it downloads the
> Zip archive from GitHub/GitLab).
I think we may be talking at cross-purposes. Here's what I was
suggesting w.r.t. using git repos as a source for dub
dependencies:
(1) add a submodule to your current project (let's use mir-glas
as an example):
git submodule add --name mir-glas
https://github.com/libmir/mir-glas.git mir-glas
(2) add a dependency to dub.json pointing at the submodule
directory:
"dependencies": {
"mir-glas": { "path": "./mir-glas" }
}
This is only really needed though if one wants to create
dependencies on projects that are not public DUB packages. I
think this ought to also support nested submodules, though I have
not tried it.
Now OTOH if I understand your concerns right:
> So `dub fetch my-package` won't fetch any submodules. This is
> already a huge annoyance, but the mentioned point was about
> supporting git checkouts in dub, s.t. you can have Dub
> dependencies from any git source like in almost any other major
> package manager without them needing to be registered on the
> dub registry or to be manually checked out.
... you're concerned about the case where a DUB package relies on
submodules for its complete source code? I wonder if you could
be more specific about the exact use case you have in mind, and
why one would want to use submodules in that way?
What strikes me is that all the use cases one could think of
probably come down to different examples of this: "How does one
make DUB aware of and able to handle a codebase that does not
include its own DUB package config?"
I'd suggest that considering that problem independent of any
particular VCS might be more illuminating than asking how to make
DUB git-repo-aware.
More information about the Digitalmars-d
mailing list