Local library with dub

Jordan Wilson wilsonjord at gmail.com
Wed Apr 21 19:15:19 UTC 2021


On Wednesday, 21 April 2021 at 15:07:25 UTC, JG wrote:
> On Wednesday, 21 April 2021 at 00:39:41 UTC, Mike Parker wrote:
>> On Tuesday, 20 April 2021 at 18:43:28 UTC, JG wrote:
>>
>>>
>>> This still leaves open the question of how to include a 
>>> version of such a library in another project via dub.
>>
>> Execute `dub add-local` followed by the path to the project's 
>> root directory (the directory containing the `dub.json/sdl`) 
>> and a version number in semver format.
>>
>> ```
>> dub add-local path 0.1.0
>> ```
>>
>> Then you can use the package just as you would any other dub 
>> dependency.
>
> Thanks. I suppose this means that if you want to able to use 
> multiple versions you have to keep each version in a separate 
> directory and add them individually, and there is no way of 
> being able to get the appropriate version from say a git 
> repository?

You can specify git repos as dependencies, if this helps.
https://dlang.org/changelog/2.094.0.html#git-paths

Jordan



More information about the Digitalmars-d-learn mailing list