Code organization, dub, etc.

Mike Parker aldacron at gmail.com
Mon Mar 13 13:32:04 UTC 2023


On Monday, 13 March 2023 at 13:20:21 UTC, Joe wrote:

> Yeah, it seems like it's *only* for libraries (and a few 
> single-exe utilities).  Looking at code.dlang.org, under 
> "Stand-alone applications/Server software", the top rated item 
> is "handy-httpd" which according to its dub.json builds a 
> library! And the second place "voxelman" is builds three 
> libraries and one executable, which appears to be a "launcher" 
> to access the libraries as plugins.

The package registry is full of libraries, yes. That's what it's 
primarily for. There aren't a lot of executables uploaded there 
because they're usually better distributed in other ways. But 
plenty of people are using dub to build them.

One way to handle multiple executables is to write a simple 
script that makes multiple calls to dub with the configurations 
you need.

And I haven't looked into it yet, but it may be possible to use 
`preBuildCommands` to do the same thing. E.g., add a default with 
a `preBuildCommands` entry calling dub on multiple configurations.


More information about the Digitalmars-d-learn mailing list