Am 12.02.2014 14:45, schrieb Stephan Dilly:

On Wed, 12 Feb 2014 13:01:43 GMT, Sönke Ludwig wrote:

  1. Deprecate ~branch style dependencies and at some point finally completely remove support for them
  2. From now on, accept only packages for the registry if they contain at least a single version tag
  3. To still properly support development, allow the developer to override locally that a branch should be used for certain packages instead of the tagged version that would usually be used (either system globally for all projects, or on a per project basis)

Please elaborate more, how would this be formulated in the dub.json? "Local" means it would just work for packages that I fork/download and have locally on my machine or would dub still be able to fetch it?

The current idea is to store a mapping in either
~/.dub/local-packages.json or in .dub/branch-map.json of each package
(exact naming subject to change). Those files would contain something
along the lines of either:

{
   "vibe-d": "~master",
   "ddox": "~2.0"
}

or with the possibility to be more precise like this:

[
   {
     "package": "vibe-d",
     "version": ">=0.7.18",
     "branch": "~master"
   },
   {
     "package": "ddox",
     "version": ">=2.0.0 <3.0.0",
     "branch": "~2.0"
   }
]

That and the CLI that controls this still needs to be worked out.

But the dub.json/package.json of each package wouldn't be affected as
per the current plan. But thinking about it, there would be another
possible way that provides a little less flexibility in what can be
overridden, but avoids duplicate setup work in case of multiple
developers. For that idea, the dependencies in the package description
could be written like this:

{
   "name": "somepack",
   "dependencies": {
     "vibe-d": {
       "version": ">=0.7.18",
       "branch": "~master"
     }
   }
}

If the user then has vibe-d checked out on master, DUB would use that.
Without the "branch" entry, it would always use a tagged version.

Thoughts?