2

I know how to specify version requirements for imported packages in D/DUB project using the list of dependencies in the dub.json file.

But: how do I define the version of a package in it's on dub.json file in the first place?

Ber
  • 40,356
  • 16
  • 72
  • 88

2 Answers2

2

Git tags are the way used for package versioning.

To add version v1.0, for example, create a git tag using the following command: git tag v1.0. Dub understands tags as versions for local and online repositories.

I know of no other way to specify versions.

yaz
  • 1,340
  • 1
  • 10
  • 14
1

It's managed automatically. If you publish your Github repo to DUB registry, it will fetch all of your version tags from it. See: http://code.dlang.org/publish

unbornchikken
  • 344
  • 2
  • 13
  • That fine as far as published packages are concerned. But I would like to see a solution for non-published packages in a local repository (or without a git repo at all). – Ber Oct 28 '14 at 11:56
  • 1
    Dub versioning is tied to Git tagging. If you have tags in your local package's Git repository then it will be understood. I can see that yaz already mentioned it in his answer. – unbornchikken Oct 28 '14 at 15:38