On Mon, 09 Dec 2013 11:11:35 GMT, Sönke Ludwig wrote:
Am 09.12.2013 11:38, schrieb zhaopuming:> Hi Sönke,
Sorry for the repost, I incorrectly replied to myself in the last post...
There's a little problem when I tried ddb:
I want to try it with a simple project, so I
dub init hello
and then modified package.json to add "ddb" : "~master".
Then when I ran
dub
it automatilly finds dependency vibe-d~master and then echos the error:
Compiling...
source/app.d(3): Error: only one main allowedSo using ddb changes the project to a vibe.d project, but I only want to do a simple void main() experiment.
Sorry, this is still a left-over from the times when RDMD was used for building vibe.d projects. You can add a
"versions": ["VibeCustomMain"]
to your package.json file to fix this.
Thanks, this works!
I'll try to remove the need for this, but unfortunately it would break a lot of existing projects, including the examples on the vibe.d homepage, if just done directly. Ideally DUB should auto-detect this using dependency tracking, like RDMD. Until it does, the situation is a bit sub-optimal.
I'm fine with the aforementioned workaround. Maybe you could put it in the docs. Or even directly in the dub init
generated main function.
I checked the source code of ddb in https://github.com/etcimon/ddb/blob/master/package.json
(...)
It seems that one should be able to NOT use vibe.d (because to use vibe.d one should use version Have_vibe_d, right?).
Is there a config value in package.json to disable the dependency for vibe.d in dub, and then tells the ddb lib that we are not using version Have_vibe_d?
I've made a pull request to fix this in the original repository, it should have used an
"optional": true
parameter for the "vibe-d" dependency:https://github.com/pszturmaj/ddb/pull/12
So if you want to use ddb without vibe.d, you can now do "dub upgrade" followed by "dub remove vibe-d" and it should run without
Have_vibe_d
defined.
Thanks :-)