Is there a way to host the DUB registry myself?

I create multiple projects for a client, and they tend to share the same code that I have used in separate projects. I'm trying to use DUB to organize all of this, but so far I can't figure out how to add these shared projects as dependencies without publishing them to github and registering them in the public DUB registry. Posting these things will either violate my contract or put uninteresting spam in the DUB registry (or both). Is there any way I can manage my own DUB registry on a private server and display all normal public projects plus a few private ones in accessible git repositories?

This saves me from having to do a lot of git submodules. :)

Thank.

+3


source to share


1 answer


You can host the dub registry yourself by using your own parameter --hostname

on dub-registry and providing your own parameter --registry

on dub .

Alternatively, you can just use your packages locally (or remotely if the packages are hosted on a network drive). Dub wiki page "Cookbook" explains how to work with packages that are not in the registry: https://github.com/dlang/dub/wiki/Cookbook#working-with-submodules-or-packages-that-are-not -in-the-registry



Working with submodules or packages that are not in the registry

It is common practice to either project or submodule gitmaster-project or use an unregistered project as a dependency for development. In this setup, the project setting depends on the project at the given path, and not looking for a repository might come in handy. Here's an example of such a package:

{ "name": "dlang-org", "dependencies": { "libddoc": { "path": "./libddoc" }, "libdparse": { "path": "./libdparse" } } }

Another possibility is to add a local package. This is especially useful during development when you want to test a package with some libraries that use that package.

dub add-local myrepo dub list

+1


source







All Articles