[Qbs] Dynamic generation of the resource file

Denis Shienkov denis.shienkov at gmail.com
Sat Oct 2 08:17:58 CEST 2021


Hi,

 > how to add another "qresource prefix" section to this resource file, 
for example "binary"?

But, for what? You can create/generate just a second resource file with 
the binaries.

BR, Denis

01.10.2021 22:47, Карелин Павел пишет:
> Good time of day, colleagues
>
> I previously asked how to dynamically create a resource file for 
> project QGit (https://github.com/hkarel/qgit). The answer was received 
> (see correspondence below).
> I got the following solution:
>
>     Group {
>         name: "trigrams"
>         fileTags: "trigrams"
>         files: FileInfo.joinPaths(product.sourceDirectory, 
> "spellcheck/sonnet/trigrams/*")
>     }
>
>     Group {
>         fileTagsFilter: ["trigrams-map"]
>         fileTags: ["qt.core.resource_data"]
>     }
>     Qt.core.resourceFileBaseName: "trigrams"
>     Qt.core.resourcePrefix: "trigrams"
>
>     Rule {
>         id: idtrigrams
>         inputs: ["trigrams"]
>         explicitlyDependsOnFromDependencies: ["trigrams-generator"]
>
>         Artifact {
>             fileTags: ["trigrams-map"]
>             filePath: FileInfo.joinPaths(project.buildDirectory, 
> "trigrams", input.baseName + ".tmap")
>         }
>         prepare: {
>             var runUtl = 
> explicitlyDependsOn["trigrams-generator"][0].filePath
>             var outputFile = 
> FileInfo.joinPaths(project.buildDirectory, "trigrams", input.baseName 
> + ".tmap");
>
>             var cmd = new Command(runUtl, [input.filePath, outputFile]);
>             cmd.description = "sonnet parse trigrams";
>             cmd.highlight = "filegen";
>             return cmd;
>         }
>     }
>
> As a result, such a resource file is created:
>
> <!DOCTYPE RCC>
> <RCC version="1.0">
>     <qresource prefix="trigrams">
>         <file 
> alias="en_US.tmap">/home/hkarel/CProjects/QGit/build/Debug/trigrams/en_US.tmap</file>
>         <file 
> alias="ru_RU.tmap">/home/hkarel/CProjects/QGit/build/Debug/trigrams/ru_RU.tmap</file>
>     </qresource>
> </RCC>
>
> Question: how to add another "qresource prefix" section to this 
> resource file, for example "binary"?
> So that the resource file looks like this:
>
> <!DOCTYPE RCC>
> <RCC version="1.0">
>     <qresource prefix="trigrams">
>         <file 
> alias="en_US.tmap">/home/hkarel/CProjects/QGit/build/Debug/trigrams/en_US.tmap</file>
>         <file 
> alias="ru_RU.tmap">/home/hkarel/CProjects/QGit/build/Debug/trigrams/ru_RU.tmap</file>
>     </qresource>
>     <qresource prefix="binary">
>         <file 
> alias="file1.bin">/home/hkarel/CProjects/QGit/build/Debug/binary_res/file1.bin</file>
>         <file 
> alias="file2.bin">/home/hkarel/CProjects/QGit/build/Debug/binary_res/file1.bin</file>
>     </qresource>
> </RCC>
>
> --
> BR, Pavel
>
>
>
> -------- Перенаправленное сообщение --------
> Тема: 	Re: [Qbs] Build and run a AuxiliaryApplication before build a 
> MainApplication
> Дата: 	Mon, 22 Feb 2021 11:00:18 +0100
> От: 	Christian Kandeler <christian.kandeler at qt.io>
> Кому: 	qbs at qt-project.org
>
>
>
> On 2/19/21 5:43 PM, Карелин Павел wrote:
>> Project QGit__micro is attached.
>> The situation is reproduced 
>
> I've attached the corrected qbs files.
>
>
>
> Christian
>
>
>
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> https://lists.qt-project.org/listinfo/qbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20211002/527952c4/attachment.html>


More information about the Qbs mailing list