How to make dub recursively build subPackages?
Vijay Nayar
madric at gmail.com
Wed Feb 2 10:14:25 UTC 2022
Greetings folks,
In my project, I have a parent package with several sub-packages,
each of which builds into either a library or an executable.
I first started observing odd problems when I was running `dub
build`, it would complain about different versions of vibe-d
present, and it suggested running `dub upgrade`. After doing
this, I noticed that most subPackages were not actually being
upgraded.
The only thing I have found thus far is to manually run each
subPackage one at a time, e.g. `dub :proto; dub :common; ...`.
Is it possible to get `dub upgrade` to recursively work on all
sub-packages?
My parent package dub.sdl file:
```
name "funnel"
description "An in-memory queryable database for processing
extreme loads of current data."
authors "Vijay Nayar"
copyright "Copyright © 2019, Vijay Nayar"
license "proprietary"
targetType "none"
targetPath "target"
dependency "funnel:proto" version=">=0.0.0"
dependency "funnel:spout" version=">=0.0.0"
dependency "funnel:stem" version=">=0.0.0"
dependency "funnel:mouth" version=">=0.0.0"
dependency "funnel:common" version=">=0.0.0"
subPackage "./common"
subPackage "./proto"
subPackage "./mouth"
subPackage "./stem"
subPackage "./spout"
```
Each subPackage is structured in the same way, for example, the
common subPackage:
```
authors "Vijay Nayar"
copyright "Copyright © 2019, Vijay Nayar"
description "Common logic between the mouth and spout components."
license "proprietary"
name "common"
targetType "library"
targetPath "target"
dependency "funnel:proto" version="*"
dependency "poodinis" version="~>8.0.3"
dependency "vibe-d" version="~>0.9.4"
```
I mostly followed the dub documentation in setting up my project.
https://dub.pm/package-format-sdl.html
More information about the Digitalmars-d-learn
mailing list