[QBS] Fwd: Function to enumerate all files in desired directory

Johannes.Matokic at microchip.com Johannes.Matokic at microchip.com
Mon Jun 2 17:12:40 CEST 2014


Hi Denis,

If you only need the files for use with WiX there might be a workaround.

WiX provides the tool head.exe which can create wxs files with a component containing all files found in one directory.
This tool could be easily used in special rule or transform which requires only one file as the root of the directory structure as input.

This rule would then call “heat.exe dir sourceDir -out output.wxs” with extra arguments as required and would produce output.wxs which when tagged as “wxs” should be used by the wix module like any normal wxs-file.

You then don’t have a list of all files inside qbs but they will still be included in the installer.
However I don’t think that heat is able to filter for specific files. You have to make sure that only the files you really want are inside the directory.

Best Regards,
Johannes


From: Denis Shienkov
Sent: Montag, 2. Juni 2014 12:16
To: qbs at qt-project.org; Christian Kandeler
Subject: [QBS] Fwd: Function to enumerate all files in desired directory


Joerg,

> Care to create a suggestion?
Done: https://bugreports.qt-project.org/browse/QBS-605

So, not exists any workaround for this?
E.g. I need to add all *.qm files from the /translations output directory to my WiX project file. This *.qm files  automatically are copied into this directory from the all sub-products of my Project (at building of my Project)..
I hoped that I will be able to make it by means of qbs. Now I in the deadlock... bad bad..  Need to find out some workaround.. :(
BR,
Denis

2014-06-02 12:56 GMT+04:00 Joerg Bornemann <joerg.bornemann at digia.com<mailto:joerg.bornemann at digia.com>>:

On 30-May-14 14:01, Denis Shienkov wrote:
1)

It is possible to create an some JS function to return a list of all
available files (e.g. by a file mask or extension) in target directory?

function(targetDirectory, fileMaskOrExtension) {
     var fullFilePaths = [];
     ...
     ...
     return fullFilePaths;
}

maybe similar core (example) is already exists in Qbs sources and so on?
(but I can not find anything similar ...)

As of now there's no such function in JS context. The files properties of Product and Group support wildcards though.
Without extending the built-in JS extensions I don't see a good way to implement such a function... apart from an ugly hack by calling ls/dir and parsing the output.
Having such a function would be useful. Care to create a suggestion?


BR,

Joerg


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20140602/b2cb0a04/attachment.html>


More information about the Qbs mailing list