How do we make dub more useful?

Mike Parker via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 16 05:20:45 PST 2017


On Saturday, 14 January 2017 at 18:14:42 UTC, aberba wrote:
> On Saturday, 14 January 2017 at 11:02:51 UTC, Joakim wrote:
>> There were two recent posts by a new Rust user about how he's 
>> finding that language, that got a lot of attention on their 
>> reddit.  In the latter post, he mentions D as a competitor:
>>
>> [...]
>
> linking to local modules too. Is it supported yet?

Assuming by 'module' you mean 'package managed by DUB':

cd some_d_package_directory
dub add-local . 0.0.1-beta.1

Note the '.' after add-local. The add-local command takes a path 
as its first argument, so you need not cd into the directory 
first, but if you do you must pass '.'. The version is required, 
but it can be any semver format version you want to make it. Then 
you can add a dependency to any other dub-managed project on your 
system using that version number.

Alternatively, you can use 'path' in place of 'version' for any 
package on your system. Then you need not use add-local:

// dub.sdl
dependency "some-lib" path="../mylibs/somelib"

This is particularly useful when somelib is a library you are 
developing and you want to put it through its paces.


More information about the Digitalmars-d mailing list