forked from qt-creator/qt-creator
QML Observer: Build together on runtime with debugging tools
Moved qmljsdebugger to a dir under qml/, made qmlobserver compile without creator dependencies and made it compile with debugging helpers. Reviewed-by: hjk
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "qt-s60/s60manager.h"
|
||||
#include "qt-s60/s60projectchecker.h"
|
||||
|
||||
#include "qmlobservertool.h"
|
||||
#include "qmldumptool.h"
|
||||
#include <projectexplorer/debugginghelper.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -516,6 +517,8 @@ QtVersion::QtVersion(const QString &name, const QString &qmakeCommand, int id,
|
||||
m_isAutodetected(isAutodetected),
|
||||
m_autodetectionSource(autodetectionSource),
|
||||
m_hasDebuggingHelper(false),
|
||||
m_hasQmlDump(false),
|
||||
m_hasQmlObserver(false),
|
||||
m_toolChainUpToDate(false),
|
||||
m_versionInfoUpToDate(false),
|
||||
m_notInstalled(false),
|
||||
@@ -538,6 +541,8 @@ QtVersion::QtVersion(const QString &name, const QString &qmakeCommand,
|
||||
m_isAutodetected(isAutodetected),
|
||||
m_autodetectionSource(autodetectionSource),
|
||||
m_hasDebuggingHelper(false),
|
||||
m_hasQmlDump(false),
|
||||
m_hasQmlObserver(false),
|
||||
m_toolChainUpToDate(false),
|
||||
m_versionInfoUpToDate(false),
|
||||
m_notInstalled(false),
|
||||
@@ -556,6 +561,8 @@ QtVersion::QtVersion(const QString &qmakeCommand, bool isAutodetected, const QSt
|
||||
: m_isAutodetected(isAutodetected),
|
||||
m_autodetectionSource(autodetectionSource),
|
||||
m_hasDebuggingHelper(false),
|
||||
m_hasQmlDump(false),
|
||||
m_hasQmlObserver(false),
|
||||
m_toolChainUpToDate(false),
|
||||
m_versionInfoUpToDate(false),
|
||||
m_notInstalled(false),
|
||||
@@ -574,6 +581,8 @@ QtVersion::QtVersion()
|
||||
: m_id(-1),
|
||||
m_isAutodetected(false),
|
||||
m_hasDebuggingHelper(false),
|
||||
m_hasQmlDump(false),
|
||||
m_hasQmlObserver(false),
|
||||
m_toolChainUpToDate(false),
|
||||
m_versionInfoUpToDate(false),
|
||||
m_notInstalled(false),
|
||||
@@ -1126,6 +1135,8 @@ void QtVersion::updateVersionInfo() const
|
||||
m_hasExamples = false;
|
||||
m_hasDocumentation = false;
|
||||
m_hasDebuggingHelper = false;
|
||||
m_hasQmlDump = false;
|
||||
m_hasQmlObserver = false;
|
||||
|
||||
if (!queryQMakeVariables(qmakeCommand(), &m_versionInfo))
|
||||
return;
|
||||
@@ -1136,7 +1147,8 @@ void QtVersion::updateVersionInfo() const
|
||||
|
||||
if (!qtInstallData.isEmpty()) {
|
||||
m_hasDebuggingHelper = !DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData).isEmpty();
|
||||
m_hasQmlDump = !QmlDumpTool::qmlDumpToolByInstallData(qtInstallData).isEmpty();
|
||||
m_hasQmlDump = !QmlDumpTool::toolByInstallData(qtInstallData).isEmpty();
|
||||
m_hasQmlObserver = !QmlObserverTool::toolByInstallData(qtInstallData).isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1237,6 +1249,7 @@ QString QtVersion::qmlviewerCommand() const
|
||||
{
|
||||
if (!isValid())
|
||||
return QString();
|
||||
|
||||
if (m_qmlviewerCommand.isNull()) {
|
||||
#ifdef Q_OS_MAC
|
||||
const QString qmlViewerName = QLatin1String("QMLViewer");
|
||||
@@ -1618,6 +1631,12 @@ bool QtVersion::hasQmlDump() const
|
||||
return m_hasQmlDump;
|
||||
}
|
||||
|
||||
bool QtVersion::hasQmlObserver() const
|
||||
{
|
||||
updateVersionInfo();
|
||||
return m_hasQmlObserver;
|
||||
}
|
||||
|
||||
QString QtVersion::debuggingHelperLibrary() const
|
||||
{
|
||||
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
|
||||
@@ -1626,6 +1645,22 @@ QString QtVersion::debuggingHelperLibrary() const
|
||||
return DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData);
|
||||
}
|
||||
|
||||
QString QtVersion::qmlDumpTool() const
|
||||
{
|
||||
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
|
||||
if (qtInstallData.isEmpty())
|
||||
return QString();
|
||||
return QmlDumpTool::toolByInstallData(qtInstallData);
|
||||
}
|
||||
|
||||
QString QtVersion::qmlObserverTool() const
|
||||
{
|
||||
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
|
||||
if (qtInstallData.isEmpty())
|
||||
return QString();
|
||||
return QmlObserverTool::toolByInstallData(qtInstallData);
|
||||
}
|
||||
|
||||
QStringList QtVersion::debuggingHelperLibraryLocations() const
|
||||
{
|
||||
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
|
||||
@@ -1711,7 +1746,7 @@ bool QtVersion::isQt64Bit() const
|
||||
#endif
|
||||
}
|
||||
|
||||
QString QtVersion::buildDebuggingHelperLibrary()
|
||||
QString QtVersion::buildDebuggingHelperLibrary(QFutureInterface<void> &future)
|
||||
{
|
||||
QString qtInstallHeaders = versionInfo().value("QT_INSTALL_HEADERS");
|
||||
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
|
||||
@@ -1733,18 +1768,35 @@ QString QtVersion::buildDebuggingHelperLibrary()
|
||||
qmakeCommand(), mkspec(), env,
|
||||
(tc->type() == ToolChain::GCC_MAEMO ? QLatin1String("-unix") : QLatin1String("")));
|
||||
}
|
||||
future.setProgressValue(2);
|
||||
|
||||
if (QmlDumpTool::canBuild(qtInstallHeaders)) {
|
||||
QString qmlDumpDirectory = QmlDumpTool::copy(qtInstallData, &output);
|
||||
if (!qmlDumpDirectory.isEmpty()) {
|
||||
output += QmlDumpTool::build(qmlDumpDirectory, tc->makeCommand(),
|
||||
QString toolDirectory = QmlDumpTool::copy(qtInstallData, &output);
|
||||
if (!toolDirectory.isEmpty()) {
|
||||
output += QmlDumpTool::build(toolDirectory, tc->makeCommand(),
|
||||
qmakeCommand(), mkspec(), env,
|
||||
(tc->type() == ToolChain::GCC_MAEMO ? QLatin1String("-unix") : QLatin1String("")));
|
||||
}
|
||||
} else {
|
||||
output += QCoreApplication::tr("Cannot build qmldump; Qt version must be 4.7.1 or higher.");
|
||||
}
|
||||
future.setProgressValue(3);
|
||||
|
||||
if (QmlObserverTool::canBuild(qtInstallHeaders)) {
|
||||
QString toolDirectory = QmlObserverTool::copy(qtInstallData, &output);
|
||||
if (!toolDirectory.isEmpty()) {
|
||||
output += QmlObserverTool::build(toolDirectory, tc->makeCommand(),
|
||||
qmakeCommand(), mkspec(), env,
|
||||
(tc->type() == ToolChain::GCC_MAEMO ? QLatin1String("-unix") : QLatin1String("")));
|
||||
}
|
||||
} else {
|
||||
output += QCoreApplication::tr("Cannot build QMLObserver; Qt version must be 4.7.1 or higher.");
|
||||
}
|
||||
future.setProgressValue(4);
|
||||
|
||||
m_hasDebuggingHelper = !debuggingHelperLibrary().isEmpty();
|
||||
m_hasQmlDump = !qmlDumpTool().isEmpty();
|
||||
m_hasQmlObserver = !qmlObserverTool().isEmpty();
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user