Closed zen0wu closed 10 years ago
Related to this functionality - the templates that output into the model, not into a file, should be declared before the template that needs the generated model attribute.
For example, the 'source' templates includes a test code which is generated from the 'filetest' template, so we have:
// Working
templates = [ filetest, source ]
// Not working
templates = [ source, filetest ]
I am writing a memo (it should be mentioned anywhere, maybe a documentation just before the public release)
Also, 'filetest' should be dependent on 'testcase' -- without it, in vain.
@shivawu, are you planning this on 2.0 or later? I am a bit confused on the behaviour. It'll be great if the dependencies are automatically included.
Yes, this feature is just an idea which comes to me that day. But I didn't put too much thought into it since it will make the configuration file more complicated (maybe much more).
You're right about the dependencies. And you can see the templates (filetest and testcase) are hooked together by the convention of the name of the testcase
template, which is considered bad practice, this name spreads everywhere in the template and config. But I haven't thought of a better idea to express this dependency or restriction, without breaking the config schema too much.
This feature can be added before the release, but it need a lot of design work I think. You can give some advise on this if you'd like.
what do you guys think of this new syntax? @wookayin @vexorian
Dependencies are defined as an array, which all elements must be satisfied, and each element can be a list of
strings concatenated by |
meaning one-of relation between them, so basically it's a logic expression in CNF.
Keys dependencies are expressed as key(xxx)
.
It seems cool.
Explicitly defined dependencies between templates, making it easier to track the correctness and ordering of the templates, and also make the configuration more complicated