aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs')
-rw-r--r--tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs b/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs
new file mode 100644
index 000000000..681a93f28
--- /dev/null
+++ b/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs
@@ -0,0 +1,41 @@
+import qbs 1.0
+import qbs.TextFile
+import qbs.FileInfo
+
+Project {
+ Product {
+ type: "application"
+ name: "moc_cpp"
+
+ Depends {
+ name: "Qt.core"
+ }
+
+ Group {
+ files: 'bla.txt'
+ fileTags: ['text']
+ }
+ }
+
+ Rule {
+ inputs: ['text']
+ Artifact {
+ fileTags: ['cpp', 'moc_cpp']
+ fileName: input.baseName + '.cpp'
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.sourceCode = function () {
+ var file = new TextFile(input.fileName, TextFile.ReadOnly);
+ var text = file.readAll();
+ file = new TextFile(output.fileName, TextFile.WriteOnly);
+ file.truncate();
+ file.write(text);
+ file.close();
+ }
+ cmd.description = 'generating ' + FileInfo.fileName(output.fileName);
+ cmd.highlight = 'codegen';
+ return cmd;
+ }
+ }
+}