[QBS] Rule generating lots of files

Christian Kandeler christian.kandeler at theqtcompany.com
Wed Aug 26 18:07:22 CEST 2015

On 08/26/2015 05:24 PM, Stephan Gatzka wrote:
> My problem is, that I can't specify wildcards in the outputArtifacts
> property, so currently I only see to specify every single file by hand
> in outputArtifacts, which is rather tedious and in addition might change
> because depending from the inputs.
> Is there a clever way to achieve this? A workaround might be to generate
> a list of C files in the prepare script and hand over that list to
> outputArtifacts?

The outputArtifacts script is called first, and the prepare script gets 
its information about what the outputs are from there.
For the case where the Rule cannot know in advance which outputs will be 
generated (e.g. because that depends on the contents of input files 
and/or the logic to derive the file paths would duplicate lots of code 
from the tool to run), there are the following approaches:
     a) Ideally, the tool provides some sort of "dry run" mode where it
        only generates the information about which files it would create.
        You would call the tool in that mode in the outputArtifacts
     b) You call the tool twice. The first run happens in the
        outputArtifacts script and is only used to find out which
        files were generated. Can be tolerable if running the tool is
     c) If b) is too expensive, you can cheat and do the actual work
        in the outputArtifacts script, making the prepare script
        a no-op. I think Jake Petroules has worked on a somwhat cleaner
        version of this approach recently: he might want to chime in


More information about the Qbs mailing list