I want to convert my DWinProgramming project to use DUB rather than my own RDMD build script, which predates DUB. The thing is I have a lot of samples in there, probably around a hundred or so. I want to avoid writing a ton of duplicated configurations sections. So is there a way to cut-down on the syntax in the .json file?

For example, the vast majority of the samples in the repo are built like so:

$ dmd <somespecificversionflags> .\Samples\Chap04\SysMets1\SysMets1.d
$ dmd specificversionflags> .\Samples\Chap04\SysMets2\SysMets2.d
$ dmd <somespecificversion_flags> .\Samples\Chap06\KeyView1\KeyView1.d

So if I didn't even have to list them in the .json file it would be great, e.g. I would like to have some kind of a generic syntax which would allow me to specify:

  • For all the leaf folders recursively found in the Samples directory create a configuration which is named as the leaf folder name (e.g. Samples\Chap04\SysMets1\ => "SysMets1" configuration name), and use <somespecificversionsimportsetc> for every configuration made.

Then the user could simply invoke:

$ dub --config=KeyView1

And dub would find the leaf folder, build and run that sample.