aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/api/testdata/qt5-plugin/qt5-plugin.qbs
blob: d50072ad829ec9a03d22a8d4b0b0eaea57d9a39a (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
import qbs.File
import qbs.FileInfo

DynamicLibrary {
    name: "echoplugin"

    Depends { name: "Qt.core" }
    Depends { name: "cpp" }
    Properties {
        condition: qbs.targetOS.contains("darwin")
        bundle.isBundle: false
    }

    Group {
        condition: Qt.core.versionMajor >= 5
        files: [
            "echoplugin.h",
            "echoplugin.cpp",
        ]
    }
    Group {
        condition: Qt.core.versionMajor >= 5
        files: ["echoplugin.json.source"]
        fileTags: ["json_in"]
    }

    Group {
        condition: Qt.core.versionMajor < 5
        files: "echoplugin_dummy.cpp"
    }

    cpp.includePaths: buildDirectory

    Rule {
        condition: Qt.core.versionMajor >= 5
        inputs: ["json_in"]
        Artifact {
            filePath: "echoplugin.json"
            fileTags: ["qt_plugin_metadata"]
        }
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "generating " + FileInfo.fileName(output.filePath);
            cmd.sourceCode = function() {
                File.copy(input.filePath, output.filePath);
            }
            return cmd;
        }
    }
}