On Mon, 23 Feb 2015 15:33:58 GMT, Sönke Ludwig wrote:
But the way to fix the concrete issue is to use separate (sub) packages for the examples instead of configurations:
{ "name": "qcore", "targetName": "qcore", "targetType": "library", "targetPath": "bin", "versions": ["trace"], "postBuildCommands-posix": ["./buildExamples.sh"], "subPackages": [ { "name": "ex1", "dependencies": {"qcore": "*"} "targetName": "ex1", "targetType": "executable", "targetPath": "../bin", "sourcePaths": ["ex1/"], "versions": ["trace"] }, { "name": "ex2", "dependencies": {"qcore": "*"} "targetName": "ex2", "targetType": "executable", "targetPath": "../bin", "sourcePaths": ["ex2/"], "versions": ["trace"] } ] }
To build an example, you'd then run
dub build qcore:ex1
, or shorter:dub build :ex1
I changed config to subPackages, but defined them in examples separately:
root/dub.json
root/examples/ex1/dub.json
root/examples/ex2/dub.json
and changed main config to
"subPackages": [
"./examples/ex1/",
"./examples/ex1/"
]
when I run "dub build" it goes to infinite loop compiling examples over and over again.