aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata-windows/wixDependencies/wixDependencies.qbs
blob: d42a180544c11fab5382861d0e341d69b45c40bf (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
58
59
60
61
62
63
64
65
66
67
import qbs.TextFile

Project {
    WindowsInstallerPackage {
        Depends { name: "app" }
        Depends { name: "lib" }
        name: "QbsSetup"
        targetName: "qbs"
        files: ["QbsSetup.wxs"]
        wix.extensions: ["WixBalExtension", "WixUIExtension"]
        destinationDirectory: project.buildDirectory
    }

    Application {
        Depends { name: "cpp" }
        name: "app"
        files: ["main.c"]
        Group {
            fileTagsFilter: product.type
            qbs.install: true
        }
        destinationDirectory: project.buildDirectory
    }

    DynamicLibrary {
        Depends { name: "cpp" }
        name: "lib"
        files: ["main.c"]
        Group {
            fileTagsFilter: product.type
            qbs.install: true
        }
        Rule {
            // This rule tries to provoke the installer into building too early (and the test
            // verifies that it does not) by causing the build of the installables to take
            // a lot longer.
            multiplex: true
            outputFileTags: ["c"]
            outputArtifacts: {
                var artifacts = [];
                for (var i = 0; i < 96; ++i)
                    artifacts.push({ filePath: "c" + i + ".c", fileTags: ["c"] });
                return artifacts;
            }
            prepare: {
                var cmd = new JavaScriptCommand();
                cmd.silent = true;
                cmd.sourceCode = function() {
                    for (var j = 0; j < 1000; ++j) { // Artificial delay.
                        for (var i = 0; i < outputs["c"].length; ++i) {
                            var tf;
                            try {
                                tf = new TextFile(outputs["c"][i].filePath, TextFile.WriteOnly);
                                tf.writeLine("int main" + i + "() { return 0; }");
                            } finally {
                                if (tf)
                                    tf.close();
                            }
                        }
                    }
                };
                return [cmd];
            }
        }
        destinationDirectory: project.buildDirectory
    }
}