Am 22.03.2018 um 22:36 schrieb Luís Marques:

I wanted to use preBuildCommands to generate some .d files to add to my project, but dub doesn't include those files in the build. You have to build the project a second time. I don't see a good reason for this behavior, so I'd argue it's a bug. preGenerateCommands has the same limitation.

The case of preGenerateCommands can definitely be argued, but
preBuildCommands are simply executing in a logical step after the
build description has already assembled. This can be best seen when
generating a VisualD or CMake project. The commands will still be run as
part of the build, but the list of files has long been generated at that
point, and DUB is not in the game anymore.

However, as long as the generated file name is known, it can simply be
added explicitly with sourceFiles. There should be no missing file
errors, as long as it is present just before the compiler gets invoked.