www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dub to create multiple executables from one source directory?

reply biocyberman <biocyberman gmail.com> writes:
Hi
I am learning D and dub, and playing with this repository: 
https://github.com/biod/BioD
The whole repo itself and be compiled with `dub build` command. 
How write dub.json under `examples` directory and compile every d 
source file in there?
Dec 19 2016
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 19.12.2016 um 11:24 schrieb biocyberman:
 Hi
 I am learning D and dub, and playing with this repository:
 https://github.com/biod/BioD
 The whole repo itself and be compiled with `dub build` command. How
 write dub.json under `examples` directory and compile every d source
 file in there?
The cleanest way would be to make each example a single file package: http://code.dlang.org/getting_started#single-file-packages
Dec 19 2016
parent John Colvin <john.loughran.colvin gmail.com> writes:
On Monday, 19 December 2016 at 12:36:13 UTC, Sönke Ludwig wrote:
 Am 19.12.2016 um 11:24 schrieb biocyberman:
 Hi
 I am learning D and dub, and playing with this repository:
 https://github.com/biod/BioD
 The whole repo itself and be compiled with `dub build` 
 command. How
 write dub.json under `examples` directory and compile every d 
 source
 file in there?
The cleanest way would be to make each example a single file package: http://code.dlang.org/getting_started#single-file-packages
and use path based dependencies to refer to the local version of the main package, not whatever is available remotely. https://code.dlang.org/package-format?lang=sdl#version-specs
Dec 19 2016