Makefile の使用には慣れていますが、現在のプロジェクトでは.qbs
ファイルを使用しています。ファイルを作成したり要求したりせずに、qbs を介して単純な端末コマンドを実行するにはどうすればよいですか? make の偽のルールに似ています。
以下は機能し、私の端末で「素晴らしい」と表示されます。
import qbs 1.0
Project {
name: "cli"
Product {
name: "helloworld"
type: "application"
files: "TEST.c"
Depends { name: "cpp" }
}
Product {
type: ["custom-image"]
Depends { name: "helloworld" }
Rule {
inputsFromDependencies: ["application"]
Artifact {
fileTags: ["custom-image"]
}
prepare: {
var cmd = new Command("echo", "awesome")
return cmd
}
}
}
}
ただし、実行するたびにダミーTEST.c
ファイルに触れる必要があります。依存関係がないとhelloworld
、ルールは実行されません。
何か案は?どうもありがとうございました!