Low hanging fruit: dub git integration
Brad Anderson via Digitalmars-d
digitalmars-d at puremagic.com
Tue May 16 12:41:32 PDT 2017
On Tuesday, 16 May 2017 at 18:10:52 UTC, Andre Pany wrote:
> Hi,
>
> While integrating the git protocol into dub is complex, there
> is a much much easier solution.
>
> Github and bitbucket provides access to the source code,
> including releases, branches and commits as archive files using
> the http protocol.
>
> Without counting the actual unzip/untar coding I assume more or
> less 100 lines of additional coding is needed in dub.
>
> In dub.json in addition to the existing path attribute of the
> dependeny object a new attribute "url" has to be added. You can
> specify here an url to a zip/tar.gz. This file has to be
> downloaded and extracted. The extract path is then filled into
> the existing path attribute of the dependency object.
>
> The only issue is the untar/unzip logic...
>
> This little tweak would make dub a lot more flexible like npm.
>
> Kind regards
> André
This is actually exactly how dub fetches source code but the
registry does it rather than dub itself (I'm not sure why)[1]. A
bare URL dependency may be controversial though because it makes
versioning more difficult to ensure.
1.
https://github.com/dlang/dub-registry/blob/d825840770bb29356495f265480035ed7e3321b8/source/dubregistry/repositories/github.d#L89
More information about the Digitalmars-d
mailing list