You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
897 B
42 lines
897 B
import qbs
|
|
import qbs.FileInfo
|
|
|
|
Module {
|
|
Depends { name: "Qt.mvvmcore" }
|
|
|
|
property string qsettingsgeneratorName: "qsettingsgenerator"
|
|
|
|
version: Qt.mvvmcore.version
|
|
|
|
FileTagger {
|
|
fileTags: ["settings-xml"]
|
|
patterns: ["*.settings.xml"]
|
|
}
|
|
|
|
Rule {
|
|
inputs: ["settings-xml"]
|
|
|
|
Artifact {
|
|
filePath: input.baseName + ".h"
|
|
fileTags: ["hpp"]
|
|
}
|
|
Artifact {
|
|
filePath: input.baseName + ".cpp"
|
|
fileTags: ["cpp"]
|
|
}
|
|
|
|
prepare: {
|
|
var cmd = new Command();
|
|
cmd.description = "generating settings class" + input.fileName;
|
|
cmd.highlight = "codegen";
|
|
cmd.program = FileInfo.joinPaths(product.moduleProperty("Qt.core", "binPath"),
|
|
product.moduleProperty("Qt.restbuilder", "qsettingsgeneratorName"));
|
|
cmd.arguments = [
|
|
"--in", input.filePath,
|
|
"--header", outputs["hpp"][0].filePath,
|
|
"--impl", outputs["cpp"][0].filePath
|
|
];
|
|
return cmd;
|
|
}
|
|
}
|
|
}
|
|
|