[QBS] Referencing Rule properties

Dennis Tomas den.t at gmx.de
Fri Aug 5 13:40:32 CEST 2016


Am 02.08.2016 um 12:29 schrieb Christian Kandeler:
> On 08/01/2016 10:24 AM, Dennis Tomas wrote:
>> Am 01.08.2016 um 09:20 schrieb Christian Kandeler:
>>> On 07/29/2016 09:05 PM, Dennis Tomas wrote:
>>>> Rule {
>>>>     property string fileName: "resources"
>>>>     multiplex: true
>>>>     Artifact {
>>>>         filePath: baseName + ".qrc" // ReferenceError
>>>>         fileTags: ["qrc"]
>>>>     }
>>>>     prepare: {
>>>> [...]
>>>>     }
>>>> }
>>>>
>>>> I get a ReferenceError as marked above. Is there a way to somehow
>>>> reference baseName from the Artifact's filePath property?
>>>
>>> Have you tried parent.baseName?
>>>
>> Yes, this also results in a ReferenceError.
>
> Ah yes. That's because the filePath property is evaluated in a 
> different context and at a later stage (so that you can refer to 
> "inputs", for instance). This means your approach cannot work as is; 
> you'll have to look for a different way to set your output file name. 
> There are lots of possibilities; for instance, you could derive it 
> from the name of the first input artifact. It just has to be unique.
>
In my case it's not sufficient for the name to be unique, because I have 
to reference it when using the Q_INIT_RESOURCE macro.
Is it technically possible to solve this in Qbs, i.e. by somehow 
injecting the Rule property values into the context of the Artifact?



More information about the Qbs mailing list