On 02.02.18 14:16, Jacob Carlborg wrote:

On Fri, 2 Feb 2018 11:49:08 +0100, Christian Köstlin wrote:

Does this also work for you when you add versions to libraries?
Is $PACKAGE_DIR always set to the package, that is just build?
e.g. an executable has a dependency to a libarary with a version.

Check the three variables at the top of the "Environment variables" section [1]. $<name>_PACKAGE_DIR should work.

[1] http://code.dlang.org/package-format?lang=sdl#environment-variables

Thanks for mentioning this.
I looked into it, and it looks like, dub is setting
ROOTDUBPACKAGEDIR (for the main project you are actually building)
and DUB
PACKAGE_DIR for packages that are dependencies and build in the
process.

i changed my tool to first try to resolve the version from the dub.json
(that is part of every package in ~/.dub/packages), then from dub.sdl
then from git.

thanks again,
christian