forked from qt-creator/qt-creator
Build Qbs QML type info dynamically
... when building with qbs. Optionally also update the copies in the repository. Change-Id: I4604eff6de95101a8cb086708d5a9ef24af0fd32 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
@@ -16,6 +16,7 @@ Module {
|
||||
: ["$ORIGIN/..", "$ORIGIN/../" + qtc.ide_library_path]
|
||||
property string resourcesInstallDir: qtc.ide_data_path + "/qbs"
|
||||
property string pluginsInstallDir: qtc.ide_plugin_path + "/qbs/plugins"
|
||||
property string qmlTypeDescriptionsInstallDir: qtc.ide_data_path + "/qml-type-descriptions"
|
||||
property string appInstallDir: qtc.ide_bin_path
|
||||
property string libexecInstallDir: qtc.ide_libexec_path
|
||||
property bool installHtml: false
|
||||
|
@@ -27,6 +27,10 @@ Product {
|
||||
"themes/**/*",
|
||||
"welcomescreen/**/*"
|
||||
]
|
||||
excludeFiles: [
|
||||
"qml-type-descriptions/qbs-bundle.json",
|
||||
"qml-type-descriptions/qbs.qmltypes",
|
||||
]
|
||||
}
|
||||
|
||||
Group {
|
||||
|
@@ -1,8 +1,10 @@
|
||||
import qbs 1.0
|
||||
import qbs.File
|
||||
import qbs.FileInfo
|
||||
|
||||
QtcPlugin {
|
||||
name: "QbsProjectManager"
|
||||
type: base.concat(["qmltype-update"])
|
||||
|
||||
property var externalQbsIncludes: project.useExternalQbs
|
||||
? [project.qbs_install_dir + "/include/qbs"] : []
|
||||
@@ -116,5 +118,42 @@ QtcPlugin {
|
||||
"qbsrunconfiguration.cpp",
|
||||
"qbsrunconfiguration.h",
|
||||
]
|
||||
|
||||
// QML typeinfo stuff
|
||||
property bool updateQmlTypeInfo: useInternalQbsProducts
|
||||
Group {
|
||||
condition: !updateQmlTypeInfo
|
||||
name: "qbs qml type info"
|
||||
qbs.install: true
|
||||
qbs.installDir: FileInfo.joinPaths(qtc.ide_data_path, "qtcreator",
|
||||
"qml-type-descriptions")
|
||||
prefix: FileInfo.joinPaths(project.ide_source_tree, "share", "qtcreator",
|
||||
"qml-type-descriptions") + '/'
|
||||
files: [
|
||||
"qbs-bundle.json",
|
||||
"qbs.qmltypes",
|
||||
]
|
||||
}
|
||||
|
||||
Depends { name: "qbs resources" }
|
||||
Rule {
|
||||
condition: updateQmlTypeInfo
|
||||
inputsFromDependencies: ["qbs qml type descriptions", "qbs qml type bundle"]
|
||||
Artifact {
|
||||
filePath: "dummy." + input.fileName
|
||||
fileTags: ["qmltype-update"]
|
||||
}
|
||||
prepare: {
|
||||
var cmd = new JavaScriptCommand();
|
||||
cmd.description = "Updating " + input.fileName + " in Qt Creator repository";
|
||||
cmd.sourceCode = function() {
|
||||
var targetFilePath = FileInfo.joinPaths(project.ide_source_tree, "share",
|
||||
"qtcreator", "qml-type-descriptions",
|
||||
input.fileName);
|
||||
File.copy(input.filePath, targetFilePath);
|
||||
}
|
||||
return cmd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user