atilaneves / reggae

Build system in D, Python, Ruby, Javascript or Lua
BSD 3-Clause "New" or "Revised" License
182 stars 22 forks source link

How to build dub project in `--single` mode? #32

Open drug007 opened 7 years ago

drug007 commented 7 years ago

I build several file in --single mode` using:

dub build --single path/to/file

but I failed to use reggae to build them, could you help?

atilaneves commented 7 years ago

Sure, but:

  1. What happened? (error messages, etc)
  2. What did you expect to happen?
drug007 commented 7 years ago

I can be totally wrong but it seems that somehow reggae in compile time knows that the project is being builded is a dub project and enables dub support? I (random) guess because the same reggaefile.d didn't compile in non-dub project and did in dub one. But I'm not sure. Unfortunately, I can't answer your questions right now, I'll do it tomorrow.

atilaneves commented 7 years ago

There's more than one compile-time with reggae because D is a compiled language. The way it works with dub projects is that at reggae run time it detects the presence of a dub.json/dub.sdl in the project directory and automatically writes a reggaefile.d for the user (if none is present) that builds the default and unittest configurations. That happens before what would naturally be compile-time for the project.

drug007 commented 7 years ago
  1. the project is on machine I haven't access now, still can't answer the first question
  2. I expect that reggae detects *.d files with single mode and create build system for all of them.
atilaneves commented 7 years ago

I forgot about dub's --single mode. The only advantage to using reggae there would be that the dependent packages compile faster, but that only matters the first time. What's your use case?

drug007 commented 7 years ago

I have several utilities and I'd like to build them simultaneously. But moreover, in single mode dub doesn't cache building (that is it does total rebuild every time) and I expected reggae could help me.

atilaneves commented 7 years ago

This is going to take some work - I'll add the feature label and see when I can get to this.