Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
Originally, Qt provider was a JS-based re-implementation of the setup-qt tool which generated Qt modules based on templates.
What if instead of writing files to the disk and replacing templates with actual values, Provider will return properties it overrides and Qbs will set those when loading a module?
The provider will then return the path to the location where "templates" are (which are now regular modules) and thus avoid modifing filesystem.
Note, that props set per Product or command line should have higher priority then those returned by a provider.
Suggested syntax:
// modules/bar/bar.qbs Module { property string foo: "foo" property string baz: "baz" }
ModuleProvider { property string foo: "value" // built-in property var moduleInfo moduleInfo: { return { "searchPaths": ["path/to/modules"], "properties": { "bar": { // module name "foo": foo, // prop "baz": "baazz", // prop } } } } }
If providers are multi-shot (QBS-1706), this can be simplified:
ModuleProvider { // built-in property var moduleName property string foo: "value" // built-in property var moduleInfo moduleInfo: { if (moduleName === "non-existent-module") return {}; return { "searchPaths": ["path/to/modules"], "properties": { "foo": foo, // prop "baz": "baazz", // prop } }; } }
Attachments
Issue Links
- relates to
-
QBS-1593 Provide a way to clean (accidently) generated modules
- Reported