Dub pre-build hook

Chris Wright via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 10 08:38:38 PST 2016


On Sun, 10 Jan 2016 16:34:51 +0000, Chris Wright wrote:

> Is there a way to write a pre-build hook in Dub?
> 
> Specifically, I want to write unittests in a separate package to the
> rest of my source code. This requires a module that imports all my
> unittest modules. It's safer to automatically generate this than to rely
> on my memory.
> 
> My other alternative is to write a D script that assembles this file and
> then invokes dub, and always invoke dub via that script.

I write this and immediately see preBuildCommands and preGenerateCommands. 
I'm not sure what the difference is, though. I think preBuildCommands is 
the way to go (and preGenerateCommands is maybe for generating project 
files). I'll give it a shot and see how it turns out.


More information about the Digitalmars-d-learn mailing list