digitalmars.D.learn - How to inform dub of generated source files?
Bastiaan Veelo <Bastiaan Veelo.net> writes:
Hi, Context: https://github.com/veelo/Pascal2D One of my source files is generated by executing `cd source && rdmd generate.d`, which creates the file `source/epparser.d`. (There is actually one step in between, calling `rdmd make.d`, which checks creation times, but that's not relevant here). I have added this step as preGenerateCommands in dub.json . The problem is that the first time `dub build` is run, it does not seem to be aware of `source/epparser.d` and linking fails . A second `dub build` succeeds. Isn't preGenerateCommands meant to cover this case? I can add `epparser.d` in an extra soureFile line in dub.json, which fixes the very first build, but that makes successive builds fail because it causes the file name to appear twice in the arguments to dmd once the file exists. Changing preGenerateCommands into preBuildCommands makes no difference. Thanks! Bastiaan.  https://github.com/veelo/Pascal2D/blob/master/dub.json#L22  https://travis-ci.org/veelo/Pascal2D/builds/379096446#L511
May 17 2018