www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dub and hierarchies of packages

reply Jean-Louis Leroy <jl leroy.nyc> writes:
Hi,

I am quite happy with dub, the little package manager that could 
:)

Now two questions or suggestions.

I have a package hierarchy (here 
https://github.com/jll63/openmethods.d/blob/master/dub.sdl) and I 
would like to 'dub run' or 'dub test' everything. Is there a 
recursive mode that I've missed?

Secondly, I have buildTypes that I would like to use in all the 
packages (like here 
https://github.com/jll63/openmethods.d/blob/master/tests/misc/dub.sdl#L9). I
would like to avoid repeating it in every dub.sdl. I tried putting the
buildTypes in the root dub.sdl and defining my subpackages there (in spite of
the warning against doing that) in the hope that the buildTypes would be
globally available, but no. Is there a way of making the subpackages inherit
stuff from their parent? Or some sort of sdl #include or 'import'?
Jul 26 2017
parent Guillaume Piolat <contact spam.com> writes:
On Wednesday, 26 July 2017 at 14:05:09 UTC, Jean-Louis Leroy 
wrote:
 I have a package hierarchy (here 
 https://github.com/jll63/openmethods.d/blob/master/dub.sdl) and 
 I would like to 'dub run' or 'dub test' everything. Is there a 
 recursive mode that I've missed?
I don't think there is one. But would be useful!
 Secondly, I have buildTypes that I would like to use in all the 
 packages (like here 
 https://github.com/jll63/openmethods.d/blob/master/tests/misc/dub.sdl#L9). I
would like to avoid repeating it in every dub.sdl. I tried putting the
buildTypes in the root dub.sdl and defining my subpackages there (in spite of
the warning against doing that) in the hope that the buildTypes would be
globally available, but no. Is there a way of making the subpackages inherit
stuff from their parent? Or some sort of sdl #include or 'import'?
I think in DUB packages inherit flags from their dependencies when --combined is used. You could maybe use a fake dependency to insert the right "dflags" or "versions" for your particular build type. Something that also changed in the past is adding the new build type to DUB in the case it's a generic enough need.
Jul 26 2017