I just created a dub package. Frankly, the whole thign is backward.

Mike Parker aldacron at gmail.com
Tue Apr 26 00:35:57 UTC 2022


On Monday, 25 April 2022 at 17:07:18 UTC, H. S. Teoh wrote:

> I've worked with integrating software with OS package managers, 
> for example, and they often involve simply adding some files, 
> or maybe a subdirectory or two, to your existing source tree, 
> and the packaging tools pick it up from there.  None of them 
> involve mandatory, dictated-from-above reorganization of the 
> source tree structure to fit its ideals (such a thing would 
> have quickly become too onerous to use -- people would just 
> give up trying to cater to the system, and the repository would 
> just stagnate from a dearth of people who are willing to go far 
> enough to satisfy its whims).
>
> Or take the old workhorse Make, which everybody (including 
> myself) hates. It does not require you to reorganize your 
> source tree to fits its worldview; all it needs is to add a 
> Makefile with the right contents, and it Just Works(tm).  The 
> same can be said for a multitude of other Make-replacement 
> build systems.
>
> But not so for dub. It demands that you conform to its 
> conventions, otherwise it flat out doesn't work (or refuses 
> to).  It doesn't play well with external tools: it's 
> theoretically *possible* to invoke other tools if you ask 
> really nicely, but it's glued on as an afterthought, the core 
> design obviously does not acknowledge such usage.  It does not 
> support customization -- you either do things its way, or the 
> highway.


dub does *not* require you to use a specific structure for your 
source tree. It has a default that it looks for if none is 
specified ("source" or "src" subdirectories), but you have 
options to set it up however you'd like with the directives 
"sourcePaths", "sourceFiles", and "importPaths". You can output 
your binary to "targetPath" and use "workingDirectory" to specify 
where the executable should be run. It's missing a "libPaths" 
directive, but you can set that up for specific linkers via 
"lflags".




More information about the Digitalmars-d mailing list