aboutsummaryrefslogtreecommitdiffstats
path: root/qbs-resources/modules/qbsversion/qbsversion.qbs
blob: ff1fd18f03328a728a46866a6a508a256145c114 (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
import qbs
import qbs.File
import qbs.FileInfo
import qbs.TextFile

Module {
    Probe {
        id: qbsVersionProbe
        property var lastModified: File.lastModified(versionFilePath)
        property string versionFilePath: FileInfo.joinPaths(path, "..", "..", "..", "VERSION")
        property string version
        configure: {
            var tf = new TextFile(versionFilePath, TextFile.ReadOnly);
            try {
                version = tf.readAll().trim();
                found = !!version;
            } finally {
                tf.close();
            }
        }
    }

    version: qbsVersionProbe.version
}