On Mon, 11 May 2015 12:43:21 -0400, Nick Sabalausky wrote:
I'm working on a PR
(https://github.com/Abscissa/dub/commits/more-details), and I noticed
that if the main project has dependency on a staticLibrary, the
path/name for the actual built static library is nowhere to be found in
BuildSettings, not even in BuildSettings.libs (which only lists non-dub
libs).
Does that sound correct? If so, is there a correct place to obtain
these, or it is just to be manually pieced together by navigating the
dependencies and looking for static libraries and grabbing their target
names and target paths?
If it matters, I'm constructing the BuildSettings using addBuildSettings
in the same manner used by "dub test", which seems to work right for all
other data AFAICT.
Perhaps addBuildSettings should be adjusted to populate
BuildSettings.libs with dub-based static libs? Or would that be a wrong
approach?
This part is left to the specific ProjectGenerator
implementation. See the "build" generator for an example:
https://github.com/D-Programming-Language/dub/blob/acec413687aefcfb76362b22cf439612b9a1743a/source/dub/generators/build.d#L64
In this case it constructs the final target binary path. Other generators, such as the VisualD one may leave this choice up to the IDE/build tool and just forward the linkDependencies
accordingly.
I couldn't see how you implemented the --data switch from a quick look, so that the following may not apply. But just to make sure - for any kind of build related information you should write a ProjectGenerator
derived class, so that the logic to assemble the build settings is the same as for all other generators. Inside of the overridden generateTargets
method it's then possible to extract all necessary information.
In fact, I had recently started to improve dub describe
and partially implemented such a special purpose generator class: https://github.com/D-Programming-Language/dub/commits/refactor1
I got distracted by other things, but it probably makes sense to finish that and then base your additions on top of that (at least as far as I understand).