aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/protobuf/protobufbase.qbs
blob: 0ac6c194902bee544e7087eb0337379d1d25813e (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
import qbs
import qbs.File
import qbs.FileInfo
import qbs.Probes
import "protobuf.js" as HelperFunctions

Module {
    property string protocBinary: protocProbe.filePath
    property pathList importPaths: []

    property string outputDir: product.buildDirectory + "/protobuf"

    property var validateFunc: {
        return function() {
            if (!File.exists(protocBinary))
                throw "Can't find protoc binary. Please set the protocBinary property or make sure it is found in PATH";
        }
    }

    FileTagger {
        patterns: ["*.proto"]
        fileTags: ["protobuf.input"];
    }

    Probes.BinaryProbe {
        id: protocProbe
        names: ["protoc"]
    }

    validate: {
        validateFunc();
    }
}