For instance, consider this simple case with two modules:
Module "lowerlevel":
Module {
property string prop: "value in lowerlevel module"
}
Module "higherlevel":
Module {
Depends { name: "lowerlevel" }
lowerlevel.prop: "value in higherlevel"
}
Product using these modules:
Product {
type: "mytype"
Depends { name: "higherlevel" }
Group {
files: ["dummy.txt"]
fileTags: ["dummy-input"]
}
Rule {
inputs: ["dummy-input"]
Artifact {
filePath: "dummy.out"
fileTags: product.type
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.sourceCode = function() { };
var prop = product.moduleProperty("lowerlevel", "prop");
cmd.description = "lowerlevel.prop is '" + prop + "'.";
return [cmd];
}
}
}
The value printed is the one from the lower-level module, when one would except it to get overridden by the higher-level module. Note that it does not make any difference where the rule is located; it could also be in either of the modules, with the same result.
| For Gerrit Dashboard: QBS-726 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 103674,3 | Add XFAIL-ing autotest for bug. | 1.3 | qbs/qbs | Status: MERGED | +2 | 0 |
| 104755,9 | fix look-up of scalar properties | 1.3 | qbs/qbs | Status: MERGED | +2 | 0 |