How to inform dub of generated source files?

Bastiaan Veelo Bastiaan at
Thu May 17 17:42:21 UTC 2018



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 [1].

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 
[2]. 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 



More information about the Digitalmars-d-learn mailing list