aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/mac-gcc.qbs
blob: fda5da3f24d63738cdb308ba8afd60dc9e52a282 (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
68
69
import qbs.base 1.0

GenericGCC {
    condition: qbs.hostOS == 'mac' && qbs.targetOS == 'mac' && qbs.toolchain == 'gcc'

    Rule {
        multiplex: true
        inputs: ["qbs"]

        Artifact {
            fileName: product.name + ".app/Info.plist"
            fileTags: ["infoplist"]
        }

        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "generating Info.plist";
            cmd.highlight = "codegen";
            cmd.sourceCode = function() {
                var infoplist = new TextFile(outputs.infoplist[0].fileName, TextFile.WriteOnly);
                infoplist.write("<foobar>");
                infoplist.close();
            }
            return cmd;
        }
    }

    Rule {
        multiplex: true
        inputs: ["qbs"]

        Artifact {
            fileName: product.name + ".app/PkgInfo"
            fileTags: ["pkginfo"]
        }

        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "generating PkgInfo";
            cmd.highlight = "codegen";
            cmd.sourceCode = function() {
                var pkginfo = new TextFile(outputs.pkginfo[0].fileName, TextFile.WriteOnly);
                pkginfo.write("FOO");
                pkginfo.close();
            }
            return cmd;
        }
    }

    Rule {
        multiplex: true
        inputs: ["application", "infoplist", "pkginfo"]

        Artifact {
            fileName: product.name + ".app/Contents/MacOS/" + product.name
            fileTags: ["applicationbundle"]
        }

        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "generating app bundle";
            cmd.highlight = "codegen";
            cmd.sourceCode = function() {
                File.copy(inputs.application[0].fileName, outputs.applicationbundle[0].fileName);
            }
            return cmd;
        }
    }
}