RejectedSoftware Forums

Sign up

What is the appropriate way to handle a project with lots of samples?

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<br>$ dmd <somespecificversionflags> .\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.

Re: What is the appropriate way to handle a project with lots of samples?

On Wed, 09 Apr 2014 18:34:20 GMT, Andrej Mitrovic wrote:

snip

Looks like Markdown escapes some characters when the underscore is used, ignore the italics in my post.

Re: What is the appropriate way to handle a project with lots of samples?

On Wed, 09 Apr 2014 18:34:20 GMT, Andrej Mitrovic wrote:

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?

Anyone has any ideas?

Re: What is the appropriate way to handle a project with lots of samples?

In vibe.d Sonke has used nested folders with own dub.json - https://github.com/rejectedsoftware/vibe.d/tree/master/examples

Re: What is the appropriate way to handle a project with lots of samples?

On Wed, 30 Apr 2014 17:38:56 GMT, Dicebot wrote:

In vibe.d Sonke has used nested folders with own dub.json - https://github.com/rejectedsoftware/vibe.d/tree/master/examples

I'm specifically trying to avoid writing hundreds of dub files.

Re: What is the appropriate way to handle a project with lots of samples?

On Wed, 30 Apr 2014 20:36:02 GMT, Andrej Mitrovic wrote:

On Wed, 30 Apr 2014 17:38:56 GMT, Dicebot wrote:

In vibe.d Sonke has used nested folders with own dub.json - https://github.com/rejectedsoftware/vibe.d/tree/master/examples

I'm specifically trying to avoid writing hundreds of dub files.

You can generate those from makefile :P