On 10/28/2013 04:48 PM, Fischer Pavel wrote:
Thank you for the reply, but it doesn't help. It's still undefined.
Here is the sample project. Perhaps there is more than one error.
The print statement in the attached project has exactly the same problem
as the one in your last post.
I have attached a version of your module file that prints the file name
of the output artifact, which I assume the code was supposed to do. It
works as expected.
Christian
import qbs.base
import qbs.TextFile
import qbs.FileInfo
Module {
name: "enum"
Depends { name: "cpp" }
FileTagger {
pattern: "*.enum"
fileTags: ["enum"]
}
Rule {
inputs: ["enum"]
Artifact {
fileName: input.fileName.replace(/enum$/,'h')
fileTags: ["hpp"]
}
Artifact {
fileName: input.fileName.replace(/enum$/,'cpp')
fileTags: ["cpp"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "Generate enum class " +
FileInfo.fileName(input.fileName);
cmd.highlight = "codegen";
cmd.sourceCode = function() {
for (var index in outputs) {
print("Output: " + index);
for (var items in outputs[index]) {
print(outputs[index][items].fileName);
}
}
}
return cmd;
}
}
}
_______________________________________________
QBS mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qbs