From the DUB home page:
DUB is a build tool for D projects with support for automatically retrieving dependencies and integrating them in the build process.
From that same page DUB relyies the following conventions:
- Folders named "source" or "src" get automatically scanned for sources and are treated as import folders.
- A file "app.d", or "<package name>.d" is treated as containing the applications main() and automatically gets excluded in library builds of the package
- The two configurations "application" and "library" get added automatically, depending on the availability of those files
- A folder "views" is automatically treated as a string import folder (the -J switch)
1) Download the DUB zipped binaries for Windows (X86) from here: http://code.dlang.org/download
2) Extract the files in the zip file to this folder:
Code: Select all
C:\Program Files\Zeus\zGNU
For this test I selected the Carbon library project found here: http://code.dlang.org/packages/carbon
The source for that project is found here: https://github.com/k3kaimu/carbon
I put the source files of that project into local disk location:
Code: Select all
C:\Projects\Carbon
Code: Select all
Workspace Name: Carbon
Workspace Directory: C:\Projects\Carbon
Folders: Source;
Next select the Add files to folder option and in the resulting dialog type in *.d as the file filter, select all the resulting files and add them to the folder.
5) To attach DUB to the Carbon workspace do the following:
- Use the Workspace, Option menu to open the workspace properties dialog.
- Set the configuration to Debug (using the combo box found in the top right of the dialog)
- Set the Make command line to dub build
- Apply those changes
To run the build select the Carbon project from the workspace and use the mouse right click to select the Make menu option.
That will result in the following output in the project build window:
Code: Select all
--------------------Configuration: Carbon - Debug--------------------
Using workspace project options....
carbon: ["carbon"]
Building carbon configuration "use_as_lib", build type debug.
Running dmd...
Code: Select all
Directory of C:\Projects\Carbon\.dub\build\use_as_lib-debug-windows-x86-dmd-205D7FA3726F759B34B1F7ABD4BE9F7E
17/08/2014 03:46 PM <DIR> .
17/08/2014 03:46 PM <DIR> ..
17/08/2014 03:46 PM 630,272 carbon.lib
1 File(s) 630,272 bytes
2 Dir(s) 1,216,479,232 bytes free