dub: Use Alternate Dependency

drug drug2004 at bk.ru
Tue Nov 21 07:36:25 UTC 2017


21.11.2017 07:42, bauss пишет:
> On Tuesday, 21 November 2017 at 02:51:13 UTC, jmh530 wrote:
>> I'm working on two related dub projects on code.dlang.org. One has a 
>> dependency on the other. However, I've made changes to both and to run 
>> the tests properly requires me to use both versions in my working 
>> directory, rather than the versions (specifically for the dependency) 
>> that is registered on dub.
>>
>> How do I ensure that dub picks up the right version?
> 
> Well dub will always use the versions you have specified in your 
> dub.json/dub.sdl file, so if you have a specific version in you 
> dub.json/dub.sdl then dub will use that version only and won't fetch a 
> new version, so don't use something like "~>version", but just "version".
> 
> Example
> ---
> 
> Instead of (something like this.):
> dependency "package" version="~>1.2.3"
> 
> Do:
> dependency "package" version="1.2.3"
> 
> 
Probably author needs the following:
dependency "package" version="*" 
path="../relative/path/to/other/custom/package"
instead of
dependency "package" version="~>1.2.3"

this allows using custom package not registered on dub and after 
debugging register them and use them as usual.


More information about the Digitalmars-d-learn mailing list