diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-02-01 14:38:39 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-02-02 09:14:01 +0000 |
commit | bc15b474878494e2b31c90d46856c3cf50690a7e (patch) | |
tree | e0d665a9d0e2b1dd2c2e13542f295b267d99f046 | |
parent | 2bde6a584617d85e435eaa85e2faad26124fb2a5 (diff) |
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>
-rw-r--r-- | qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs | 1 | ||||
-rw-r--r-- | share/share.qbs | 4 | ||||
-rw-r--r-- | src/plugins/qbsprojectmanager/qbsprojectmanager.qbs | 39 |
3 files changed, 44 insertions, 0 deletions
diff --git a/qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs b/qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs index ed754e43da..845ce4139c 100644 --- a/qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs +++ b/qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs @@ -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 diff --git a/share/share.qbs b/share/share.qbs index c5ee2b1c39..c929391115 100644 --- a/share/share.qbs +++ b/share/share.qbs @@ -27,6 +27,10 @@ Product { "themes/**/*", "welcomescreen/**/*" ] + excludeFiles: [ + "qml-type-descriptions/qbs-bundle.json", + "qml-type-descriptions/qbs.qmltypes", + ] } Group { diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs index bfa79ea519..54fbf015da 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs @@ -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; + } + } } |