RejectedSoftware Forums

Sign up

Still not getting how to propertly develop and simultaneously use a dub project with semver

Hello,
I am developing a library myLib and simultaneously use this library in another custom dub project "myExe". The easiest thing for me would be to reference myLib in myExe dub.json with:
"myLib" : "~master", but this gives my the warning:
WARNING: A deprecated branch based version specification is used ...

O.K. so that approach does not seem to be right. Next I tried to give myLib a semver of v0.1.0, and reference it with "myLib" : "~>0.1.0" in myExe project. Whenever I edit the source of myLib I want it to be available to myExe, hence I enter "myLib": "~master" in the dub.selections.json of myExe project.

Firstly, is this the right way to work and develop on depending dub projects?

Secondly, I think this might be a bug but am not sure, after some time I get a dub error, project does not build with this message:
Root package myExe reference myLib ~>0.1.0 cannot be satisfied.
My workaround for that was setting "myLib" : "~master" back in myExe dub.json, then triggering a build (successfully) and changing back again to "myLib" : "~>0.1.0". After this building works, but I get a new warning:
Selected package myLib ~master does not match the dependency specification ~>0.1.0 in package myExe. Need to "dub upgrade"?
A dub upgrade results again in error:
Root package myExe reference myLib ~>0.1.0 cannot be satisfied.
Building still works, but with the mentioned warning: Selected package myLib ...
After some time, I don't know what triggers this behavior, the build error message returns.

This process repeated a few times, is my way of developing wrong?

Re: Still not getting how to propertly develop and simultaneously use a dub project with semver

On 2016-06-20 17:01, ParticlePeter wrote:

Hello,
I am developing a library myLib and simultaneously use this library in another custom dub project "myExe". The easiest thing for me would be to reference myLib in myExe dub.json with:
"myLib" : "~master", but this gives my the warning:
WARNING: A deprecated branch based version specification is used ...

The way I do this when both projects change quite a lot is to use a
local path for the library dependency [1]:

"dependencies": {
"lib": { "path": "some/local/path" }
}

They you don't need to commit, push or tag anything. Of course I don't
commit that change.

[1] http://code.dlang.org/package-format?lang=json#version-specs

/Jacob Carlborg

Re: Still not getting how to propertly develop and simultaneously use a dub project with semver

On Mon, 20 Jun 2016 21:27:19 +0200, Jacob Carlborg wrote:

The way I do this when both projects change quite a lot is to use a
local path for the library dependency [1]:

"dependencies": {
"lib": { "path": "some/local/path" }
}

They you don't need to commit, push or tag anything. Of course I don't
commit that change.

[1] http://code.dlang.org/package-format?lang=json#version-specs

/Jacob Carlborg

This works nice, thx.