Newer
Older
dub_jkp / README.md
  1. dub package manager
  2. ===================
  3.  
  4. Package and build manager for [D](http://dlang.org/) applications and libraries.
  5.  
  6. There is a central [package registry](https://github.com/rejectedsoftware/dub-registry/) located at <http://code.dlang.org>.
  7.  
  8. [![Build Status](https://travis-ci.org/rejectedsoftware/dub.png)](https://travis-ci.org/rejectedsoftware/dub)
  9.  
  10. Introduction
  11. ------------
  12.  
  13. DUB emerged as a more general replacement for [vibe.d's](http://vibed.org/) package manager. It does not imply a dependecy to vibe.d for packages and was extended to not only directly build projects, but also to generate project files (currently [VisualD](https://github.com/rainers/visuald) and [Mono-D](http://mono-d.alexanderbothe.com/)).
  14.  
  15. The project's philosophy is to keep things as simple as possible. All that is needed to make a project a dub package is to write a short [dub.json](http://code.dlang.org/publish) file and put the source code into a `source` subfolder. It *can* then be registered on the public [package registry](http://code.dlang.org) to be made available for everyone. Any dependencies specified in `dub.json` are automatically downloaded and made available to the project during the build process.
  16.  
  17.  
  18. Key features
  19. ------------
  20.  
  21. - Simple package and build description not getting in your way
  22.  
  23. - Integrated with Git, avoiding maintainance tasks such as incrementing version numbers or uploading new project releases
  24.  
  25. - Generates VisualD project/solution files, integrated into MonoD
  26.  
  27. - Support for DMD, GDC and LDC (common DMD flags are translated automatically)
  28.  
  29. - Supports development workflows by optionally using local directories as a package source
  30.  
  31.  
  32. Future direction
  33. ----------------
  34.  
  35. To make things as flexible as they need to be for certain projects, it is planned to gradually add more options to the [package file format](http://code.dlang.org/package-format) and eventually to add the possibility to specify an external build tool along with the path of it's output files. The idea is that DUB provides a convenient build management that suffices for 99% of projects, but is also usable as a bare package manager that doesn't get in your way if needed.
  36.  
  37.  
  38. Installation
  39. ------------
  40.  
  41. DUB comes [precompiled](http://code.dlang.org/download) for Windows, Mac OS, Linux and FreeBSD. It needs to have libcurl with SSL support installed (except on Windows).
  42.  
  43. The `dub` executable then just needs to be accessible from `PATH` and can be invoked from the root folder of any DUB enabled project to build and run it.
  44.  
  45. If you want to build for yourself, just install [DMD](http://dlang.org/download.html) and libcurl development headers and run `./build.sh`. On Windows you can simply run `build.cmd` without installing anything besides DMD.
  46.  
  47. ### Arch Linux
  48.  
  49. Moritz Maxeiner has created a PKGBUILD file for Arch:
  50.  
  51. - Latest release: <https://aur.archlinux.org/packages/dub/>
  52. - GIT master: <https://aur.archlinux.org/packages/dub-git/>
  53.  
  54. ### Debian/Ubuntu Linux
  55.  
  56. Jordi Sayol maintains a DEB package as part of his [D APT repository](http://d-apt.sourceforge.net). Run `sudo apt-get install dub` to install.
  57.  
  58. ### Mac OS
  59.  
  60. Chris Molozian has added DUB to [Homebrew](http://mxcl.github.io/homebrew/). Use `brew install dub` or `brew install dub --HEAD` to install the stable or the git HEAD version respectively.
  61.  
  62.  
  63. Using DUB as a library
  64. ----------------------
  65.  
  66. The [DUB package of DUB](http://code.dlang.org/packages/dub) can be used as a library to load or manipulate packages, or to resemble any functionality of the command line tool. The former task can be achieved by using the [Package class](https://github.com/rejectedsoftware/dub/blob/master/source/dub/package_.d#L40). For examples on how to replicate the command line functionality, see [commandline.d](https://github.com/rejectedsoftware/dub/blob/master/source/dub/commandline.d).