Last active
October 20, 2017 16:40
-
-
Save benlau/ebbce60659f0dd17cb22064b58df7394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qbs | |
Product { | |
id: component | |
type: ["script"] | |
builtByDefault: false | |
property string command: "" | |
property var arguments: [] | |
property string description: "" | |
property var script: null | |
Rule { | |
multiplex: true | |
requiresInputs: false | |
alwaysRun: true | |
Artifact { | |
filePath: "dummy" | |
fileTags: ["script"] | |
} | |
prepare: { | |
var cmd; | |
if (product.command !== "") { | |
cmd = new Command(product.command, product.arguments); | |
} else if (product.hasOwnProperty("script")) { | |
cmd = new JavaScriptCommand(); | |
cmd.sourceCode = product.script; | |
} | |
cmd.description = product.description; | |
return [cmd]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment