diff options
Diffstat (limited to 'tests/auto/extensionsystem/copytransformer.qbs')
-rw-r--r-- | tests/auto/extensionsystem/copytransformer.qbs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/extensionsystem/copytransformer.qbs b/tests/auto/extensionsystem/copytransformer.qbs new file mode 100644 index 0000000000..fc0d7856af --- /dev/null +++ b/tests/auto/extensionsystem/copytransformer.qbs @@ -0,0 +1,26 @@ +import qbs +import qbs.File +import qbs.FileInfo + +Transformer { + property pathList sourceFiles + property path targetDirectory + inputs: sourceFiles + Artifact { fileName: targetDirectory } + prepare: { + var commands = [] + for (var tag in inputs) { + for (var index in inputs[tag]) { + var artifact = inputs[tag][index]; + var cmd = new JavaScriptCommand(); + cmd.sourceFile = artifact.fileName; + cmd.description = "Copying '" + cmd.sourceFile + "' to '" + output.fileName + "/'."; + cmd.highlight = "codegen"; + cmd.targetFilePath = output.fileName + '/' + FileInfo.fileName(cmd.sourceFile); + cmd.sourceCode = function() { File.copy(sourceFile, targetFilePath); } + commands.push(cmd); + } + } + return commands; + } +} |