From b5b6a46b4e17dde56ac4409bd6551eaaf297b375 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 26 Aug 2014 17:29:38 +0200 Subject: ExtensionSystem: Use Qt 5 plugin metadata instead of .pluginspec files Change-Id: I2b2c704260c613985a4bda179658ec1f8879e70f Reviewed-by: Christian Kandeler Reviewed-by: Christian Stenger Reviewed-by: Daniel Teske Reviewed-by: hjk --- src/qtcreatorplugin.pri | 53 ++++++++++++++----------------------------------- 1 file changed, 15 insertions(+), 38 deletions(-) (limited to 'src/qtcreatorplugin.pri') diff --git a/src/qtcreatorplugin.pri b/src/qtcreatorplugin.pri index a1fd8253d9..11916659c6 100644 --- a/src/qtcreatorplugin.pri +++ b/src/qtcreatorplugin.pri @@ -14,8 +14,8 @@ plugin_recmds = $$QTC_PLUGIN_RECOMMENDS include(../qtcreator.pri) -# for substitution in the .pluginspec -dependencyList = "" +# for substitution in the .json +dependencyList = for(dep, plugin_deps) { dependencies_file = for(dir, QTC_PLUGIN_DIRS) { @@ -27,7 +27,7 @@ for(dep, plugin_deps) { isEmpty(dependencies_file): \ error("Plugin dependency $$dep not found") include($$dependencies_file) - dependencyList += " " + dependencyList += " { \"Name\" : \"$$QTC_PLUGIN_NAME\", \"Version\" : \"$$QTCREATOR_VERSION\" }" } for(dep, plugin_recmds) { dependencies_file = @@ -40,10 +40,11 @@ for(dep, plugin_recmds) { isEmpty(dependencies_file): \ error("Plugin dependency $$dep not found") include($$dependencies_file) - dependencyList += " " + dependencyList += " { \"Name\" : \"$$QTC_PLUGIN_NAME\", \"Version\" : \"$$QTCREATOR_VERSION\", \"Type\" : \"optional\" }" } -dependencyList += " " -dependencyList = $$join(dependencyList, $$escape_expand(\\n)) +dependencyList = $$join(dependencyList, ",$$escape_expand(\\n)") + +dependencyList = "\"Dependencies\" : [$$escape_expand(\\n)$$dependencyList$$escape_expand(\\n) ]" # use gui precompiled header for plugins by default isEmpty(PRECOMPILED_HEADER):PRECOMPILED_HEADER = $$PWD/shared/qtcreator_gui_pch.h @@ -77,38 +78,16 @@ defineReplace(stripOutDir) { return($$relative_path($$1, $$OUT_PWD)) } -PLUGINSPEC = $$_PRO_FILE_PWD_/$${TARGET}.pluginspec -PLUGINSPEC_IN = $${PLUGINSPEC}.in -exists($$PLUGINSPEC_IN) { - OTHER_FILES += $$PLUGINSPEC_IN - QMAKE_SUBSTITUTES += $$PLUGINSPEC_IN - PLUGINSPEC = $$OUT_PWD/$${TARGET}.pluginspec - copy2build.output = $$DESTDIR/${QMAKE_FUNC_FILE_IN_stripOutDir} +PLUGINJSON = $$_PRO_FILE_PWD_/$${TARGET}.json +PLUGINJSON_IN = $${PLUGINJSON}.in +exists($$PLUGINJSON_IN) { + OTHER_FILES += $$PLUGINJSON_IN + QMAKE_SUBSTITUTES += $$PLUGINJSON_IN + PLUGINJSON = $$OUT_PWD/$${TARGET}.json } else { # need to support that for external plugins - OTHER_FILES += $$PLUGINSPEC - copy2build.output = $$DESTDIR/${QMAKE_FUNC_FILE_IN_stripSrcDir} + OTHER_FILES += $$PLUGINJSON } -copy2build.input = PLUGINSPEC -isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS -copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} -copy2build.name = COPY ${QMAKE_FILE_IN} -copy2build.CONFIG += no_link no_clean -QMAKE_EXTRA_COMPILERS += copy2build - -# Create a Json file containing the plugin information required by -# Qt 5's plugin system by running a XSLT sheet on the -# pluginspec file before moc runs. -XMLPATTERNS = $$targetPath($$[QT_INSTALL_BINS]/xmlpatterns) - -pluginspec2json.name = Create Qt 5 plugin json file -pluginspec2json.input = PLUGINSPEC -pluginspec2json.variable_out = GENERATED_FILES -pluginspec2json.output = $${TARGET}.json -pluginspec2json.commands = $$XMLPATTERNS -no-format -output $$pluginspec2json.output $$PWD/qtcreatorplugin2json.xsl $$PLUGINSPEC -pluginspec2json.CONFIG += no_link -moc_header.depends += $$pluginspec2json.output -QMAKE_EXTRA_COMPILERS += pluginspec2json osx: QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/PlugIns/ include(rpath.pri) @@ -121,9 +100,7 @@ linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF !macx { target.path = $$QTC_PREFIX/$$IDE_LIBRARY_BASENAME/qtcreator/plugins - pluginspec.files += $${TARGET}.pluginspec - pluginspec.path = $$QTC_PREFIX/$$IDE_LIBRARY_BASENAME/qtcreator/plugins - INSTALLS += target pluginspec + INSTALLS += target } MIMETYPES = $$_PRO_FILE_PWD_/$${TARGET}.mimetypes.xml -- cgit v1.2.1