aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/exports-qbs/tool.qbs
blob: cea46d3fdb919e271da04aa445006cc0db5d4934 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import qbs.FileInfo

import "helper.js" as Helper
import Helper2

CppApplication {
    name: "MyTool"
    consoleApplication: true
    property stringList toolTags: ["MyTool.tool"]
    Depends { name: "Exporter.qbs" }
    Exporter.qbs.artifactTypes: ["installable", "blubb"]
    files: ["tool.cpp"]
    install: true
    qbs.installPrefix: project.installPrefix
    Group {
        files: ["helper.js"]
        qbs.install: true
        qbs.installDir: "qbs/modules/MyTool"
    }
    Group {
        files: ["imports/Helper2/helper2.js"]
        qbs.install: true
        qbs.installDir: "qbs/imports/Helper2"
    }

    Group {
        fileTagsFilter: ["application"]
        fileTags: toolTags
    }
    Group {
        fileTagsFilter: ["Exporter.qbs.module"]
        qbs.installDir: "qbs/modules/MyTool"
    }

    Export {
        property stringList toolTags: exportingProduct.toolTags
        property stringList outTags: [importingProduct.outTag]
        property var helper2Obj: Helper2
        Rule {
            inputs: Helper.toolInputs()
            explicitlyDependsOnFromDependencies: toolTags

            outputFileTags: parent.outTags
            outputArtifacts: [{
                    filePath: FileInfo.completeBaseName(input.fileName)
                              + product.MyTool.helper2Obj.suffix,
                    fileTags: product.MyTool.outTags
            }]
            prepare: {
                var cmd = new Command(explicitlyDependsOn["MyTool.tool"][0].filePath,
                                      [input.filePath, output.filePath]);
                cmd.description = input.fileName + " -> " + output.fileName;
                return [cmd];
            }
        }
    }
}