On 20 October 2017 at 19:25, Christian Kandeler <[email protected]> wrote:
> On Fri, 20 Oct 2017 17:44:54 +0800 > Ben Lau <[email protected]> wrote: > > > Let's summarize about how to write a custom script by QBS > > > > 1. Write it as a part of the "build" process, then run by `qbs -p > > scriptName` > > Yes, the "script name" is a "product" in qbs lingo. > > > 3. Set "requiresInputs" to false if input are not needed. > > Note that this is essentially implied if the rule does not declare any > inputs. > > > Christian > _______________________________________________ > To make it more simple to use, I have written a Script.qbs https://gist.github.com/benlau/ebbce60659f0dd17cb22064b58df7394 Usage : Script { id: ls name: "ls" command: "ls" arguments: ["-lh"] } or Script { id: ls name: "ls" function script() { var process = Process(); process.start("ls", ["-lh"]); console.info(process.readStdOut()); } } By the way, is there any method to list all available product within a project by qbs itself? I am thinking about to make a script like `qbs -p listScript` then it will search for all products and check is it a script then return.
_______________________________________________ Qbs mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qbs
