Am 22.10.2013 16:16, schrieb Alexandr Druzninin:
I use preBuildCommands to run simple d program that using results of git commands generates gitinfo.d file with current git commit hash and datetime to include in binary. All works fine but only the second time. The first time preBuildCommands executes and gitinfo.d file is generated as expected and project compiles but linking fails - and only the first time. I suspect it's due to internal structure of dub, but don't know it yet. How can I solve this annoying issue?
The problem here is that the source file list has already been assembled
before the "generate" and "build" phases.It should be possible to work
around that by using the
"sourceFiles" field (e.g.
And it's not possible right now, but I think it would be useful to shift
the collection of files to the "generate" phase, so that the
"preGenerateCommands" field could be used instead. I've created issue
#144 for this.