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:
Christian Kandeler
2018-02-01 14:38:39 +01:00
parent 2bde6a5846
commit bc15b47487
3 changed files with 44 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ Module {
: ["$ORIGIN/..", "$ORIGIN/../" + qtc.ide_library_path] : ["$ORIGIN/..", "$ORIGIN/../" + qtc.ide_library_path]
property string resourcesInstallDir: qtc.ide_data_path + "/qbs" property string resourcesInstallDir: qtc.ide_data_path + "/qbs"
property string pluginsInstallDir: qtc.ide_plugin_path + "/qbs/plugins" 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 appInstallDir: qtc.ide_bin_path
property string libexecInstallDir: qtc.ide_libexec_path property string libexecInstallDir: qtc.ide_libexec_path
property bool installHtml: false property bool installHtml: false

View File

@@ -27,6 +27,10 @@ Product {
"themes/**/*", "themes/**/*",
"welcomescreen/**/*" "welcomescreen/**/*"
] ]
excludeFiles: [
"qml-type-descriptions/qbs-bundle.json",
"qml-type-descriptions/qbs.qmltypes",
]
} }
Group { Group {

View File

@@ -1,8 +1,10 @@
import qbs 1.0 import qbs 1.0
import qbs.File
import qbs.FileInfo import qbs.FileInfo
QtcPlugin { QtcPlugin {
name: "QbsProjectManager" name: "QbsProjectManager"
type: base.concat(["qmltype-update"])
property var externalQbsIncludes: project.useExternalQbs property var externalQbsIncludes: project.useExternalQbs
? [project.qbs_install_dir + "/include/qbs"] : [] ? [project.qbs_install_dir + "/include/qbs"] : []
@@ -116,5 +118,42 @@ QtcPlugin {
"qbsrunconfiguration.cpp", "qbsrunconfiguration.cpp",
"qbsrunconfiguration.h", "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;
}
}
} }