On 08/05/2016 06:45 PM, Dennis Tomas wrote:
I've hacked Qbs to make the rule available to the output artifact and
the prepare function:
https://github.com/dtomas/qbs/commit/716cc901b124903866a3ba1370e1085804342d8d

What do you think of it?

I'm not sure. The evaluation depends on whether we think of multiplex rules whose output artifact has a fixed name, but is not a product target artifact, as exotic or not. You might want to file a suggestion in JIRA about making user-provided rule properties available at rule execution time. Meanwhile, here's another idea for your concrete use case: Let the product provide a mapping between file tags and output file names:

Product {
property var tagMap: ({ qm: "translations", assets: "assets", /* ... */})
    // ...
}

Rule {
    Artifact {
        filePath: product.tagMap[Object.keys(inputs)[0]] + ".qrc"
        fileTags: "qrc"
    }
    // ...
}

Ths should be exactly what you want, I think.


Christian



_______________________________________________
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs

Reply via email to