digitalmars.D.learn - Do you have any suggestions for project directory structure?
- Orfeo (28/28) Feb 05 2014 Suppose I have a project "protocols" that uses DMock and a
- Dicebot (4/4) Feb 05 2014 I'd try to keep external libraries out of the main source
- Orfeo (8/9) Feb 05 2014 Something like this?
- Dicebot (4/13) Feb 05 2014 Yes. And make sure build script for your project allows to define
- Chris Williams (6/34) Feb 05 2014 I would probably advise against having the outside libraries
- Jesse Phillips (17/17) Feb 05 2014 I'm not sure I would recommend this, but I've been using
Suppose I have a project "protocols" that uses DMock and a library Foo. I would like to use a structure dub style..Which solution is better: A. protocols ├── bin │ └── protocols.a ├── dmocks │ └── *.d ├── foo │ └── *.d ├── src │ └── protocols │ └── *.d B. protocols ├── bin │ └── protocols.a ├── src │ ├── dmocks │ │ └── *.d │ ├── foo │ │ └── *.d │ └── protocols │ └── *.d Or another solution? Thanks
Feb 05 2014
I'd try to keep external libraries out of the main source directory or as part of separate git submodule hierarchy if using stuff like dub is not an option. They don't belong to project sources.
Feb 05 2014
On Wednesday, 5 February 2014 at 21:54:15 UTC, Dicebot wrote:I'd try to keep external libraries out of the main source [cut]Something like this? ├── protocols │ └── src ├── dmocks │ └── *.d ├── foo │ └── *.d
Feb 05 2014
On Wednesday, 5 February 2014 at 22:01:08 UTC, Orfeo wrote:On Wednesday, 5 February 2014 at 21:54:15 UTC, Dicebot wrote:Yes. And make sure build script for your project allows to define path to external import folder(s). dub automates that for youI'd try to keep external libraries out of the main source [cut]Something like this? ├── protocols │ └── src ├── dmocks │ └── *.d ├── foo │ └── *.d
Feb 05 2014
On Wednesday, 5 February 2014 at 21:50:17 UTC, Orfeo wrote:Suppose I have a project "protocols" that uses DMock and a library Foo. I would like to use a structure dub style..Which solution is better: A. protocols ├── bin │ └── protocols.a ├── dmocks │ └── *.d ├── foo │ └── *.d ├── src │ └── protocols │ └── *.d B. protocols ├── bin │ └── protocols.a ├── src │ ├── dmocks │ │ └── *.d │ ├── foo │ │ └── *.d │ └── protocols │ └── *.d Or another solution? ThanksI would probably advise against having the outside libraries inside your project at all. Have them parallel to protocols either add a /lib folder to protocols that can hold their binaries or pull from the outside (you'll need to point your includes outside your own project anyways).
Feb 05 2014
I'm not sure I would recommend this, but I've been using something like this: protocols ├── dmocks (I don't use this) │ └── *.d ├── libs │ └──foo │ └── *.d │ └── bar │ └── source │ └── *.d │ ├── source │ └── protocols │ └── *.d The libraries can actually have dependencies on other libraries, in this case bar requires foo and will expect to find ../foo
Feb 05 2014