[Qbs] Understanding installation rules

Alberto Mardegan mardy at users.sourceforge.net
Mon Nov 18 21:26:51 CET 2019

Hi all!
  About a couple of weeks ago I posted a message to this list about a
module I've written to handle freedesktop.org desktop files. I thought
it was working really well, until I noticed the following problem: if I
manually delete the directory tree which I was as installRoot and I run
QBS again, the .desktop file is not copied over.

I paste here the relevant parts of the module (which you can see in its
entirety here: [1]):

    FileTagger {
        patterns: [ "*.desktop" ]
        fileTags: [ "desktopfile_source" ]

    Rule {
        inputs: [ "desktopfile_source" ]
        outputFileTags: [ "desktopfile", "application" ]
        outputArtifacts: [
                fileTags: [ "desktopfile" ],
                filePath: input.fileName


        prepare: {

            ...take the input .desktop file and add some keys,
            then save it as output.filePath...

    Group {
        fileTagsFilter: [ "desktopfile" ]
        qbs.install: true
        qbs.installDir: "share/applications"

The reason why I added the "application" tag to the rule is that this
seemed to force the execution of the rule, with otherwise wouldn't be

I understand that QBS is not running the rule again, because both the
application and the desktopfile are still available under the build
directory. But why isn't the desktopfile copied to the installRoot
again, along with the application?

Any ideas of how to debug this?


[1]: https://gitlab.com/mardy/mappero/tree/master/qbs/modules/freedesktop

http://www.mardy.it - Geek in un lingua international

More information about the Qbs mailing list