Skip to content

Instantly share code, notes, and snippets.

@benlau
Last active October 20, 2017 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benlau/ebbce60659f0dd17cb22064b58df7394 to your computer and use it in GitHub Desktop.
Save benlau/ebbce60659f0dd17cb22064b58df7394 to your computer and use it in GitHub Desktop.
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