diff options
author | Ulf Hermann <[email protected]> | 2020-10-01 12:40:01 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2020-10-05 14:58:32 +0200 |
commit | 767dd738d3de9306062707fe05d32c91ed755da3 (patch) | |
tree | ebadcc9809322d5d78ce28f9b82bad1db949f232 | |
parent | e7d90fc5268cdca6aa10f422f00ad4a0049ea157 (diff) |
Long live libQtQmlCompiler!
Move all the code from tools/shared into src/qmlcompiler and build a
static library from it so that we can re-use it in external tools.
Change-Id: I7c8d8e59063dc7c711f4072f103a01095e6f5997
Reviewed-by: Fabian Kosmale <[email protected]>
46 files changed, 146 insertions, 131 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d3c26e73e6..bac92c5a38 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,7 @@ add_subdirectory(plugins) if(QT_FEATURE_qml_devtools) add_subdirectory(qmldevtools) + add_subdirectory(qmlcompiler) # Build qmlcachegen now, so that we can use it in src/imports. if(QT_FEATURE_qml_devtools AND QT_FEATURE_xmlstreamwriter) diff --git a/src/qmlcompiler/CMakeLists.txt b/src/qmlcompiler/CMakeLists.txt new file mode 100644 index 0000000000..d6895704a4 --- /dev/null +++ b/src/qmlcompiler/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from qmlcompiler.pro. + +##################################################################### +## QmlCompiler Module: +##################################################################### + +qt_add_module(QmlCompiler + STATIC + INTERNAL_MODULE + SOURCES + importedmembersvisitor.cpp importedmembersvisitor_p.h + metatypes_p.h + qmljsimporter.cpp qmljsimporter_p.h + qmljstypereader.cpp qmljstypereader_p.h + qmlstreamwriter.cpp qmlstreamwriter_p.h + resourcefilemapper.cpp resourcefilemapper_p.h + scopetree.cpp scopetree_p.h + typedescriptionreader.cpp typedescriptionreader_p.h + PUBLIC_LIBRARIES + Qt::CorePrivate + Qt::QmlDevToolsPrivate +) + +#### Keys ignored in scope 1:.:.:qmlcompiler.pro:<TRUE>: +# _OPTION = "host_build" diff --git a/src/qmlcompiler/QtBootstrap/QtBootstrap b/src/qmlcompiler/QtBootstrap/QtBootstrap new file mode 100644 index 0000000000..956abd4dbe --- /dev/null +++ b/src/qmlcompiler/QtBootstrap/QtBootstrap @@ -0,0 +1 @@ +// We need this because qmake insists on including it and QtBootstrap doesn't ship it. diff --git a/src/qmlcompiler/QtQmlDevTools/QtQmlDevTools b/src/qmlcompiler/QtQmlDevTools/QtQmlDevTools new file mode 100644 index 0000000000..f4bcaed435 --- /dev/null +++ b/src/qmlcompiler/QtQmlDevTools/QtQmlDevTools @@ -0,0 +1 @@ +// We need this because qmake insists on including it and QtQmlDevTools doesn't ship it. diff --git a/tools/shared/importedmembersvisitor.cpp b/src/qmlcompiler/importedmembersvisitor.cpp index 559c0533f7..655b77d91f 100644 --- a/tools/shared/importedmembersvisitor.cpp +++ b/src/qmlcompiler/importedmembersvisitor.cpp @@ -26,8 +26,8 @@ ** ****************************************************************************/ -#include "importedmembersvisitor.h" -#include "scopetree.h" +#include "importedmembersvisitor_p.h" +#include "scopetree_p.h" using namespace QQmlJS::AST; @@ -138,7 +138,7 @@ bool ImportedMembersVisitor::visit(UiSourceElement *sourceElement) } else { const auto loc = sourceElement->firstSourceLocation(); m_errors.append( - "unsupportedd sourceElement at " + QStringLiteral("unsupportedd sourceElement at ") + QString::fromLatin1("%1:%2: ").arg(loc.startLine).arg(loc.startColumn) + QString::number(sourceElement->sourceElement->kind)); } diff --git a/tools/shared/importedmembersvisitor.h b/src/qmlcompiler/importedmembersvisitor_p.h index ab44deda9b..b909265f0b 100644 --- a/tools/shared/importedmembersvisitor.h +++ b/src/qmlcompiler/importedmembersvisitor_p.h @@ -39,8 +39,7 @@ // // We mean it. -#include "scopetree.h" -#include "qcoloroutput.h" +#include "scopetree_p.h" #include <private/qqmljsast_p.h> diff --git a/tools/shared/metatypes.h b/src/qmlcompiler/metatypes_p.h index d462fb684f..d462fb684f 100644 --- a/tools/shared/metatypes.h +++ b/src/qmlcompiler/metatypes_p.h diff --git a/src/qmlcompiler/qmlcompiler.pro b/src/qmlcompiler/qmlcompiler.pro new file mode 100644 index 0000000000..906286551f --- /dev/null +++ b/src/qmlcompiler/qmlcompiler.pro @@ -0,0 +1,25 @@ +option(host_build) +TARGET = QtQmlCompiler +QT = core-private qmldevtools-private +CONFIG += internal_module + +SOURCES = \ + resourcefilemapper.cpp \ + importedmembersvisitor.cpp \ + qmljsimporter.cpp \ + qmljstypereader.cpp \ + scopetree.cpp \ + typedescriptionreader.cpp \ + qmlstreamwriter.cpp + +HEADERS = \ + resourcefilemapper_p.h \ + importedmembersvisitor_p.h \ + qmljsimporter_p.h \ + qmljstypereader_p.h \ + metatypes_p.h \ + scopetree_p.h \ + typedescriptionreader_p.h \ + qmlstreamwriter_p.h + +load(qt_module) diff --git a/tools/shared/qmljsimporter.cpp b/src/qmlcompiler/qmljsimporter.cpp index f2e8453c7c..a5701c72d4 100644 --- a/tools/shared/qmljsimporter.cpp +++ b/src/qmlcompiler/qmljsimporter.cpp @@ -26,9 +26,9 @@ ** ****************************************************************************/ -#include "qmljsimporter.h" -#include "typedescriptionreader.h" -#include "qmljstypereader.h" +#include "qmljsimporter_p.h" +#include "typedescriptionreader_p.h" +#include "qmljstypereader_p.h" #include <QtQml/private/qqmlimportresolver_p.h> @@ -40,7 +40,7 @@ static const QLatin1String SlashPluginsDotQmltypes = QLatin1String("/plugins.qml static const QString prefixedName(const QString &prefix, const QString &name) { - Q_ASSERT(!prefix.endsWith('.')); + Q_ASSERT(!prefix.endsWith(u'.')); return prefix.isEmpty() ? name : (prefix + QLatin1Char('.') + name); } @@ -49,7 +49,7 @@ static QQmlDirParser createQmldirParserForFile(const QString &filename) QFile f(filename); f.open(QFile::ReadOnly); QQmlDirParser parser; - parser.parse(f.readAll()); + parser.parse(QString::fromUtf8(f.readAll())); return parser; } @@ -69,7 +69,7 @@ void QmlJSImporter::readQmltypes( QFile file(filename); file.open(QFile::ReadOnly); - TypeDescriptionReader reader { filename, file.readAll() }; + TypeDescriptionReader reader { filename, QString::fromUtf8(file.readAll()) }; QStringList dependencies; auto succ = reader(objects, &dependencies); if (!succ) diff --git a/tools/shared/qmljsimporter.h b/src/qmlcompiler/qmljsimporter_p.h index 6dbd5cc527..0fb81dac5f 100644 --- a/tools/shared/qmljsimporter.h +++ b/src/qmlcompiler/qmljsimporter_p.h @@ -39,7 +39,7 @@ // // We mean it. -#include "scopetree.h" +#include "scopetree_p.h" #include <QtQml/private/qqmldirparser_p.h> class QmlJSImporter diff --git a/tools/shared/qmljstypereader.cpp b/src/qmlcompiler/qmljstypereader.cpp index 4adacf96b4..ef2f5c2cbb 100644 --- a/tools/shared/qmljstypereader.cpp +++ b/src/qmlcompiler/qmljstypereader.cpp @@ -26,8 +26,8 @@ ** ****************************************************************************/ -#include "qmljstypereader.h" -#include "importedmembersvisitor.h" +#include "qmljstypereader_p.h" +#include "importedmembersvisitor_p.h" #include <QtQml/private/qqmljsast_p.h> #include <QtQml/private/qqmljsengine_p.h> diff --git a/tools/shared/qmljstypereader.h b/src/qmlcompiler/qmljstypereader_p.h index 9afa5d46e6..d3c361ff97 100644 --- a/tools/shared/qmljstypereader.h +++ b/src/qmlcompiler/qmljstypereader_p.h @@ -39,7 +39,7 @@ // // We mean it. -#include "scopetree.h" +#include "scopetree_p.h" #include <QtQml/private/qqmljsastfwd_p.h> diff --git a/tools/shared/qmlstreamwriter.cpp b/src/qmlcompiler/qmlstreamwriter.cpp index b0fbc4e443..b5b9ee0d4a 100644 --- a/tools/shared/qmlstreamwriter.cpp +++ b/src/qmlcompiler/qmlstreamwriter.cpp @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include "qmlstreamwriter.h" +#include "qmlstreamwriter_p.h" #include <QtCore/QBuffer> #include <QtCore/QStringList> diff --git a/tools/shared/qmlstreamwriter.h b/src/qmlcompiler/qmlstreamwriter_p.h index cb642159ea..260923feed 100644 --- a/tools/shared/qmlstreamwriter.h +++ b/src/qmlcompiler/qmlstreamwriter_p.h @@ -29,6 +29,16 @@ #ifndef QMLSTREAMWRITER_H #define QMLSTREAMWRITER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + #include <QtCore/QIODevice> #include <QtCore/QList> #include <QtCore/QString> diff --git a/tools/shared/resourcefilemapper.cpp b/src/qmlcompiler/resourcefilemapper.cpp index b9cf463575..d97aa27695 100644 --- a/tools/shared/resourcefilemapper.cpp +++ b/src/qmlcompiler/resourcefilemapper.cpp @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include "resourcefilemapper.h" +#include "resourcefilemapper_p.h" #include <QFileInfo> #include <QDir> diff --git a/tools/shared/resourcefilemapper.h b/src/qmlcompiler/resourcefilemapper_p.h index ed3e486149..7fa35e4a6d 100644 --- a/tools/shared/resourcefilemapper.h +++ b/src/qmlcompiler/resourcefilemapper_p.h @@ -28,6 +28,16 @@ #ifndef RESOURCEFILEMAPPER_H #define RESOURCEFILEMAPPER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + #include <QStringList> #include <QHash> #include <QFile> diff --git a/tools/shared/scopetree.cpp b/src/qmlcompiler/scopetree.cpp index 7ebf636b2a..5e24aeca73 100644 --- a/tools/shared/scopetree.cpp +++ b/src/qmlcompiler/scopetree.cpp @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include "scopetree.h" +#include "scopetree_p.h" #include <QtCore/qqueue.h> #include <QtCore/qsharedpointer.h> diff --git a/tools/shared/scopetree.h b/src/qmlcompiler/scopetree_p.h index 1794b45373..95fca89315 100644 --- a/tools/shared/scopetree.h +++ b/src/qmlcompiler/scopetree_p.h @@ -39,7 +39,7 @@ // // We mean it. -#include "metatypes.h" +#include "metatypes_p.h" #include <QtQml/private/qqmljssourcelocation_p.h> diff --git a/tools/shared/typedescriptionreader.cpp b/src/qmlcompiler/typedescriptionreader.cpp index f95e4453b3..30808e6e99 100644 --- a/tools/shared/typedescriptionreader.cpp +++ b/src/qmlcompiler/typedescriptionreader.cpp @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include "typedescriptionreader.h" +#include "typedescriptionreader_p.h" #include <QtQml/private/qqmljsparser_p.h> #include <QtQml/private/qqmljslexer_p.h> diff --git a/tools/shared/typedescriptionreader.h b/src/qmlcompiler/typedescriptionreader_p.h index 8395f09bc4..ca79a68a4f 100644 --- a/tools/shared/typedescriptionreader.h +++ b/src/qmlcompiler/typedescriptionreader_p.h @@ -39,7 +39,7 @@ // // We mean it. -#include "scopetree.h" +#include "scopetree_p.h" #include <QtQml/private/qqmljsastfwd_p.h> diff --git a/src/qmltyperegistrar/.prev_CMakeLists.txt b/src/qmltyperegistrar/.prev_CMakeLists.txt index 365aa30e40..7c2bfe5de7 100644 --- a/src/qmltyperegistrar/.prev_CMakeLists.txt +++ b/src/qmltyperegistrar/.prev_CMakeLists.txt @@ -8,7 +8,7 @@ qt_get_tool_target_name(target_name qmltyperegistrar) qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Types Registrar" SOURCES - ../../tools/shared/qmlstreamwriter.cpp ../../tools/shared/qmlstreamwriter.h + ../qmlcompiler/qmlstreamwriter.cpp ../qmlcompiler/qmlstreamwriter_p.h qmltyperegistrar.cpp qmltypesclassdescription.cpp qmltypesclassdescription.h qmltypescreator.cpp qmltypescreator.h @@ -16,7 +16,7 @@ qt_add_tool(${target_name} QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII INCLUDE_DIRECTORIES - ../../tools/shared + ../qmlcompiler PUBLIC_LIBRARIES Qt::CorePrivate ) diff --git a/src/qmltyperegistrar/CMakeLists.txt b/src/qmltyperegistrar/CMakeLists.txt index 27c7e0cadc..5f6568ac37 100644 --- a/src/qmltyperegistrar/CMakeLists.txt +++ b/src/qmltyperegistrar/CMakeLists.txt @@ -9,7 +9,7 @@ qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Types Registrar" TOOLS_TARGET Qml # special case SOURCES - ../../tools/shared/qmlstreamwriter.cpp ../../tools/shared/qmlstreamwriter.h + ../qmlcompiler/qmlstreamwriter.cpp ../qmlcompiler/qmlstreamwriter_p.h qmltyperegistrar.cpp qmltypesclassdescription.cpp qmltypesclassdescription.h qmltypescreator.cpp qmltypescreator.h @@ -17,7 +17,7 @@ qt_add_tool(${target_name} QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII INCLUDE_DIRECTORIES - ../../tools/shared + ../qmlcompiler PUBLIC_LIBRARIES Qt::CorePrivate ) diff --git a/src/qmltyperegistrar/qmltyperegistrar.pro b/src/qmltyperegistrar/qmltyperegistrar.pro index 7ed3986dd7..eafaab6559 100644 --- a/src/qmltyperegistrar/qmltyperegistrar.pro +++ b/src/qmltyperegistrar/qmltyperegistrar.pro @@ -5,16 +5,19 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII QMAKE_TARGET_DESCRIPTION = QML Types Registrar -include(../../tools/shared/shared.pri) +# We cannot link against libQmlCompiler as qmltyperegistrar +# has to be built before libQmlCompiler. + +INCLUDEPATH += $$PWD/../qmlcompiler SOURCES += \ - $$QMLSTREAMWRITER_SOURCES \ + ../qmlcompiler/qmlstreamwriter.cpp \ qmltyperegistrar.cpp \ qmltypesclassdescription.cpp \ qmltypescreator.cpp HEADERS += \ - $$QMLSTREAMWRITER_HEADERS \ + ../qmlcompiler/qmlstreamwriter_p.h \ qmltypesclassdescription.h \ qmltypescreator.h diff --git a/src/qmltyperegistrar/qmltypescreator.cpp b/src/qmltyperegistrar/qmltypescreator.cpp index 0c2a70c6d1..7e5fca0c53 100644 --- a/src/qmltyperegistrar/qmltypescreator.cpp +++ b/src/qmltyperegistrar/qmltypescreator.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include "qmltypescreator.h" -#include "qmlstreamwriter.h" #include "qmltypesclassdescription.h" #include <QtCore/qset.h> diff --git a/src/qmltyperegistrar/qmltypescreator.h b/src/qmltyperegistrar/qmltypescreator.h index 53976e775e..9fc62f9a9e 100644 --- a/src/qmltyperegistrar/qmltypescreator.h +++ b/src/qmltyperegistrar/qmltypescreator.h @@ -29,8 +29,8 @@ #ifndef QMLTYPESCREATOR_H #define QMLTYPESCREATOR_H -#include "qmlstreamwriter.h" #include "qmltypesclassdescription.h" +#include "qmlstreamwriter_p.h" #include <QtCore/qstring.h> #include <QtCore/qset.h> diff --git a/src/src.pro b/src/src.pro index d48b6390bf..d4e66be413 100644 --- a/src/src.pro +++ b/src/src.pro @@ -38,9 +38,15 @@ SUBDIRS += \ plugins \ imports -qtConfig(qml-devtools): SUBDIRS += qmldevtools +qtConfig(qml-devtools) { + SUBDIRS += \ + qmldevtools \ + qmlcompiler + + qmldevtools.depends = qml + qmlcompiler.depends = qmldevtools +} -qmldevtools.depends = qml qtConfig(qml-network) { QT_FOR_CONFIG += network diff --git a/sync.profile b/sync.profile index 06cff0f960..eac24770f1 100644 --- a/sync.profile +++ b/sync.profile @@ -9,6 +9,7 @@ "QtQmlDebug" => "$basedir/src/qmldebug", "QtQmlModels" => "$basedir/src/qmlmodels", "QtQmlWorkerScript" => "$basedir/src/qmlworkerscript", + "QtQmlCompiler" => "$basedir/src/qmlcompiler", ); %inject_headers = ( "$basedir/src/qml" => [ "^qqmljsgrammar_p.h", "^qqmljsparser_p.h", "^qml_compile_hash_p.h" ], diff --git a/tools/qmlcachegen/.prev_CMakeLists.txt b/tools/qmlcachegen/.prev_CMakeLists.txt index d21161d202..06b03d8e96 100644 --- a/tools/qmlcachegen/.prev_CMakeLists.txt +++ b/tools/qmlcachegen/.prev_CMakeLists.txt @@ -8,16 +8,14 @@ qt_get_tool_target_name(target_name qmlcachegen) qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Cache Generator" SOURCES - ../shared/resourcefilemapper.cpp ../shared/resourcefilemapper.h generateloader.cpp qmlcachegen.cpp resourcefilter.cpp DEFINES QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII - INCLUDE_DIRECTORIES - ../shared PUBLIC_LIBRARIES + Qt::QmlCompilerPrivate Qt::QmlDevToolsPrivate ) diff --git a/tools/qmlcachegen/CMakeLists.txt b/tools/qmlcachegen/CMakeLists.txt index 8cbe8dcfac..a509166dee 100644 --- a/tools/qmlcachegen/CMakeLists.txt +++ b/tools/qmlcachegen/CMakeLists.txt @@ -9,16 +9,14 @@ qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Cache Generator" TOOLS_TARGET Qml # special case SOURCES - ../shared/resourcefilemapper.cpp ../shared/resourcefilemapper.h generateloader.cpp qmlcachegen.cpp resourcefilter.cpp DEFINES QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII - INCLUDE_DIRECTORIES - ../shared PUBLIC_LIBRARIES + Qt::QmlCompilerPrivate Qt::QmlDevToolsPrivate ) diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index 174cd547f6..d8466a2a2d 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -40,8 +40,7 @@ #include <private/qqmlirbuilder_p.h> #include <private/qqmljsparser_p.h> #include <private/qqmljslexer_p.h> - -#include "resourcefilemapper.h" +#include <private/resourcefilemapper_p.h> #include <algorithm> diff --git a/tools/qmlcachegen/qmlcachegen.pro b/tools/qmlcachegen/qmlcachegen.pro index d02746cff7..530a0d54a1 100644 --- a/tools/qmlcachegen/qmlcachegen.pro +++ b/tools/qmlcachegen/qmlcachegen.pro @@ -1,19 +1,13 @@ option(host_build) -QT = qmldevtools-private +QT = qmldevtools-private qmlcompiler-private DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII -include(../shared/shared.pri) - SOURCES = \ - $$RESOURCEFILEMAPPER_SOURCES \ qmlcachegen.cpp \ resourcefilter.cpp \ generateloader.cpp -HEADERS = \ - $$RESOURCEFILEMAPPER_HEADERS - TARGET = qmlcachegen build_integration.files = qmlcache.prf qtquickcompiler.prf diff --git a/tools/qmlimportscanner/.prev_CMakeLists.txt b/tools/qmlimportscanner/.prev_CMakeLists.txt index b50a92e874..4be5ad8f06 100644 --- a/tools/qmlimportscanner/.prev_CMakeLists.txt +++ b/tools/qmlimportscanner/.prev_CMakeLists.txt @@ -8,14 +8,12 @@ qt_get_tool_target_name(target_name qmlimportscanner) qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Import Scanner" SOURCES - ../shared/resourcefilemapper.cpp ../shared/resourcefilemapper.h main.cpp DEFINES QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII - INCLUDE_DIRECTORIES - ../shared PUBLIC_LIBRARIES + Qt::QmlCompilerPrivate Qt::QmlDevToolsPrivate ) diff --git a/tools/qmlimportscanner/CMakeLists.txt b/tools/qmlimportscanner/CMakeLists.txt index 3db7579258..8bb3dd9908 100644 --- a/tools/qmlimportscanner/CMakeLists.txt +++ b/tools/qmlimportscanner/CMakeLists.txt @@ -9,14 +9,12 @@ qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Import Scanner" TOOLS_TARGET Qml # special case SOURCES - ../shared/resourcefilemapper.cpp ../shared/resourcefilemapper.h main.cpp DEFINES QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII - INCLUDE_DIRECTORIES - ../shared PUBLIC_LIBRARIES + Qt::QmlCompilerPrivate Qt::QmlDevToolsPrivate ) diff --git a/tools/qmlimportscanner/main.cpp b/tools/qmlimportscanner/main.cpp index f296cc7101..00ad0f0701 100644 --- a/tools/qmlimportscanner/main.cpp +++ b/tools/qmlimportscanner/main.cpp @@ -34,6 +34,7 @@ #include <private/qqmlirbuilder_p.h> #include <private/qqmljsdiagnosticmessage_p.h> #include <private/qqmldirparser_p.h> +#include <private/resourcefilemapper_p.h> #include <QtCore/QCoreApplication> #include <QtCore/QDir> @@ -50,8 +51,6 @@ #include <QtCore/QJsonDocument> #include <QtCore/QLibraryInfo> -#include <resourcefilemapper.h> - #include <iostream> #include <algorithm> diff --git a/tools/qmlimportscanner/qmlimportscanner.pro b/tools/qmlimportscanner/qmlimportscanner.pro index 0d2dc22ea2..67f28737e0 100644 --- a/tools/qmlimportscanner/qmlimportscanner.pro +++ b/tools/qmlimportscanner/qmlimportscanner.pro @@ -1,17 +1,11 @@ option(host_build) -QT = core qmldevtools-private +QT = core qmldevtools-private qmlcompiler-private DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII -include(../shared/shared.pri) - SOURCES += \ - $$RESOURCEFILEMAPPER_SOURCES \ main.cpp -HEADERS += \ - $$RESOURCEFILEMAPPER_HEADERS - load(cmake_functions) CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX]) diff --git a/tools/qmllint/.prev_CMakeLists.txt b/tools/qmllint/.prev_CMakeLists.txt index 3034d8699f..923371c587 100644 --- a/tools/qmllint/.prev_CMakeLists.txt +++ b/tools/qmllint/.prev_CMakeLists.txt @@ -8,20 +8,13 @@ qt_get_tool_target_name(target_name qmllint) qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Syntax Verifier" SOURCES - ../shared/importedmembersvisitor.cpp ../shared/importedmembersvisitor.h - ../shared/metatypes.h - ../shared/qmljsimporter.cpp ../shared/qmljsimporter.h - ../shared/qmljstypereader.cpp ../shared/qmljstypereader.h - ../shared/scopetree.cpp ../shared/scopetree.h - ../shared/typedescriptionreader.cpp ../shared/typedescriptionreader.h checkidentifiers.cpp checkidentifiers.h findwarnings.cpp findwarnings.h main.cpp qcoloroutput.cpp qcoloroutput.h - INCLUDE_DIRECTORIES - ../shared PUBLIC_LIBRARIES Qt::CorePrivate + Qt::QmlCompilerPrivate Qt::QmlDevToolsPrivate ) diff --git a/tools/qmllint/CMakeLists.txt b/tools/qmllint/CMakeLists.txt index e9d92cc134..9230d8117b 100644 --- a/tools/qmllint/CMakeLists.txt +++ b/tools/qmllint/CMakeLists.txt @@ -9,20 +9,13 @@ qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Syntax Verifier" TOOLS_TARGET Qml # special case SOURCES - ../shared/importedmembersvisitor.cpp ../shared/importedmembersvisitor.h - ../shared/metatypes.h - ../shared/qmljsimporter.cpp ../shared/qmljsimporter.h - ../shared/qmljstypereader.cpp ../shared/qmljstypereader.h - ../shared/scopetree.cpp ../shared/scopetree.h - ../shared/typedescriptionreader.cpp ../shared/typedescriptionreader.h checkidentifiers.cpp checkidentifiers.h findwarnings.cpp findwarnings.h main.cpp qcoloroutput.cpp qcoloroutput.h - INCLUDE_DIRECTORIES - ../shared PUBLIC_LIBRARIES Qt::CorePrivate + Qt::QmlCompilerPrivate Qt::QmlDevToolsPrivate ) diff --git a/tools/qmllint/checkidentifiers.h b/tools/qmllint/checkidentifiers.h index f05a227be7..181b54d290 100644 --- a/tools/qmllint/checkidentifiers.h +++ b/tools/qmllint/checkidentifiers.h @@ -29,8 +29,8 @@ #ifndef CHECKIDENTIFIERS_H #define CHECKIDENTIFIERS_H -#include "scopetree.h" -#include "qmljsimporter.h" +#include <QtQmlCompiler/private/scopetree_p.h> +#include <QtQmlCompiler/private/qmljsimporter_p.h> class ColorOutput; diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp index e2a5834109..128e931277 100644 --- a/tools/qmllint/findwarnings.cpp +++ b/tools/qmllint/findwarnings.cpp @@ -27,11 +27,12 @@ ****************************************************************************/ #include "findwarnings.h" -#include "importedmembersvisitor.h" -#include "scopetree.h" -#include "typedescriptionreader.h" #include "checkidentifiers.h" -#include "qmljstypereader.h" + +#include <QtQmlCompiler/private/importedmembersvisitor_p.h> +#include <QtQmlCompiler/private/scopetree_p.h> +#include <QtQmlCompiler/private/typedescriptionreader_p.h> +#include <QtQmlCompiler/private/qmljstypereader_p.h> #include <QtQml/private/qqmljsast_p.h> #include <QtQml/private/qqmljslexer_p.h> diff --git a/tools/qmllint/findwarnings.h b/tools/qmllint/findwarnings.h index 95d4055cbe..2f5007b124 100644 --- a/tools/qmllint/findwarnings.h +++ b/tools/qmllint/findwarnings.h @@ -39,12 +39,13 @@ // // We mean it. -#include "typedescriptionreader.h" -#include "scopetree.h" #include "qcoloroutput.h" -#include "qmljsimporter.h" #include "checkidentifiers.h" +#include <QtQmlCompiler/private/typedescriptionreader_p.h> +#include <QtQmlCompiler/private/scopetree_p.h> +#include <QtQmlCompiler/private/qmljsimporter_p.h> + #include <QtQml/private/qqmldirparser_p.h> #include <QtQml/private/qqmljsastvisitor_p.h> #include <QtQml/private/qqmljsast_p.h> diff --git a/tools/qmllint/qmllint.pro b/tools/qmllint/qmllint.pro index 44bf2e7ce5..1007ec5060 100644 --- a/tools/qmllint/qmllint.pro +++ b/tools/qmllint/qmllint.pro @@ -1,11 +1,8 @@ option(host_build) -QT = core-private qmldevtools-private - -include(../shared/shared.pri) +QT = core-private qmldevtools-private qmlcompiler-private SOURCES += \ - $$METATYPEREADER_SOURCES \ checkidentifiers.cpp \ main.cpp \ findwarnings.cpp \ @@ -16,7 +13,6 @@ QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier load(qt_tool) HEADERS += \ - $$METATYPEREADER_HEADERS \ checkidentifiers.h \ findwarnings.h \ qcoloroutput.h diff --git a/tools/qmlplugindump/.prev_CMakeLists.txt b/tools/qmlplugindump/.prev_CMakeLists.txt index 79a4b0b18d..bf65d71c49 100644 --- a/tools/qmlplugindump/.prev_CMakeLists.txt +++ b/tools/qmlplugindump/.prev_CMakeLists.txt @@ -8,11 +8,11 @@ qt_get_tool_target_name(target_name qmlplugindump) qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Plugin Metadata Dumper" SOURCES - ../shared/qmlstreamwriter.cpp ../shared/qmlstreamwriter.h + ../../src/qmlcompiler/qmlstreamwriter.cpp ../../src/qmlcompiler/qmlstreamwriter_p.h main.cpp qmltypereader.cpp qmltypereader.h INCLUDE_DIRECTORIES - ../shared + ../../src/qmlcompiler PUBLIC_LIBRARIES Qt::CorePrivate Qt::Gui diff --git a/tools/qmlplugindump/CMakeLists.txt b/tools/qmlplugindump/CMakeLists.txt index cbeb03f38b..d8fdaeee8c 100644 --- a/tools/qmlplugindump/CMakeLists.txt +++ b/tools/qmlplugindump/CMakeLists.txt @@ -9,11 +9,11 @@ qt_add_tool(${target_name} TARGET_DESCRIPTION "QML Plugin Metadata Dumper" TOOLS_TARGET Qml # special case SOURCES - ../shared/qmlstreamwriter.cpp ../shared/qmlstreamwriter.h + ../../src/qmlcompiler/qmlstreamwriter.cpp ../../src/qmlcompiler/qmlstreamwriter_p.h main.cpp qmltypereader.cpp qmltypereader.h INCLUDE_DIRECTORIES - ../shared + ../../src/qmlcompiler PUBLIC_LIBRARIES Qt::CorePrivate Qt::Gui diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index ab26c5b3d5..bfc78f2974 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -60,7 +60,7 @@ #include <algorithm> #include "qmltypereader.h" -#include "qmlstreamwriter.h" +#include "qmlstreamwriter_p.h" #ifdef QT_SIMULATOR #include <QtGui/private/qsimulatorconnection_p.h> diff --git a/tools/qmlplugindump/qmlplugindump.pro b/tools/qmlplugindump/qmlplugindump.pro index 8bf40d2c8d..217fe23bbe 100644 --- a/tools/qmlplugindump/qmlplugindump.pro +++ b/tools/qmlplugindump/qmlplugindump.pro @@ -5,15 +5,18 @@ CONFIG += no_import_scan QTPLUGIN.platforms = qminimal -include(../shared/shared.pri) +# We cannot use libQmlCompiler as that is built for the host +# and qmlplugindump needs to be built for the target. + +INCLUDEPATH += $$PWD/../../src/qmlcompiler SOURCES += \ - $$QMLSTREAMWRITER_SOURCES \ + ../../src/qmlcompiler/qmlstreamwriter.cpp \ main.cpp \ qmltypereader.cpp HEADERS += \ - $$QMLSTREAMWRITER_HEADERS \ + ../../src/qmlcompiler/qmlstreamwriter_p.h \ qmltypereader.h macx { diff --git a/tools/shared/shared.pri b/tools/shared/shared.pri deleted file mode 100644 index 181cda3e8b..0000000000 --- a/tools/shared/shared.pri +++ /dev/null @@ -1,31 +0,0 @@ -INCLUDEPATH += $$PWD - -# The relevant tools need different bits and pieces. -# Furthermore, some of the classes require devtools, some not. - -RESOURCEFILEMAPPER_SOURCES = \ - $$PWD/resourcefilemapper.cpp - -RESOURCEFILEMAPPER_HEADERS = \ - $$PWD/resourcefilemapper.h - -METATYPEREADER_SOURCES = \ - $$PWD/importedmembersvisitor.cpp \ - $$PWD/qmljsimporter.cpp \ - $$PWD/qmljstypereader.cpp \ - $$PWD/scopetree.cpp \ - $$PWD/typedescriptionreader.cpp - -METATYPEREADER_HEADERS = \ - $$PWD/importedmembersvisitor.h \ - $$PWD/qmljsimporter.h \ - $$PWD/qmljstypereader.h \ - $$PWD/metatypes.h \ - $$PWD/scopetree.h \ - $$PWD/typedescriptionreader.h - -QMLSTREAMWRITER_SOURCES = \ - $$PWD/qmlstreamwriter.cpp - -QMLSTREAMWRITER_HEADERS = \ - $$PWD/qmlstreamwriter.h |