How to make dub recursively build subPackages?

Vijay Nayar madric at gmail.com
Wed Feb 2 18:42:19 UTC 2022


On Wednesday, 2 February 2022 at 14:07:08 UTC, Steven 
Schveighoffer wrote:
> On 2/2/22 5:14 AM, Vijay Nayar wrote:
> If you have them in the same repository, my recommendation is 
> to use path dependencies instead of versions.
>
> So, e.g.:
>
> ```sdl
> dependency "funnel:proto" path="./proto" // in main dub.sdl
> dependency "funnel:proto" path="../proto" // in sibling package
> ```
>
> Because otherwise, dub is going to try and fetch the 
> appropriate version from an online repository and not use your 
> local files.
>
> Honestly, for packages in the same repository, I'm not sure why 
> you would version them separately from the main package. I 
> don't even know if that works.
>
> -Steve

I made this change and it did indeed work correctly, thank you 
for that! Truthfully, it was not entirely clear to me how dub was 
deciding where to go to build. I had assumed that this was being 
done via the `subPackage` lines.

The examples given in the offical documentation were also using 
versions, and I was following that: 
https://dub.pm/package-format-sdl.html#sub-packages




More information about the Digitalmars-d-learn mailing list