QmlTooling: Move native debug service into own plugin

QV4DebugService and QQmlNativeDebugService cannot coexist at the same
time. Thus, there is no point in putting them into one plugin.

Change-Id: Ic042f7472fce23d504c62ccf96756b0f1bd68534
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Ulf Hermann 2016-08-26 14:33:51 +02:00
parent 9f5945a630
commit 0cbda65924
11 changed files with 141 additions and 12 deletions

View File

@ -4,7 +4,6 @@ QT = qml-private core-private packetprotocol-private
SOURCES += \
$$PWD/qqmldebuggerservicefactory.cpp \
$$PWD/qqmlenginedebugservice.cpp \
$$PWD/qqmlnativedebugservice.cpp \
$$PWD/qqmlwatcher.cpp \
$$PWD/qv4debugservice.cpp \
$$PWD/qv4debugger.cpp \
@ -17,7 +16,6 @@ HEADERS += \
$$PWD/../shared/qqmldebugpacket.h \
$$PWD/qqmldebuggerservicefactory.h \
$$PWD/qqmlenginedebugservice.h \
$$PWD/qqmlnativedebugservice.h \
$$PWD/qqmlwatcher.h \
$$PWD/qv4debugservice.h \
$$PWD/qv4debugger.h \

View File

@ -1,3 +1,3 @@
{
"Keys": [ "QmlDebugger", "V8Debugger", "NativeQmlDebugger" ]
"Keys": [ "QmlDebugger", "V8Debugger" ]
}

View File

@ -40,7 +40,6 @@
#include "qqmldebuggerservicefactory.h"
#include "qqmlenginedebugservice.h"
#include "qv4debugservice.h"
#include "qqmlnativedebugservice.h"
#include <private/qqmldebugserviceinterfaces_p.h>
QT_BEGIN_NAMESPACE
@ -53,9 +52,6 @@ QQmlDebugService *QQmlDebuggerServiceFactory::create(const QString &key)
if (key == QV4DebugServiceImpl::s_key)
return new QV4DebugServiceImpl(this);
if (key == QQmlNativeDebugServiceImpl::s_key)
return new QQmlNativeDebugServiceImpl(this);
return 0;
}

View File

@ -0,0 +1,21 @@
TARGET = qmldbg_nativedebugger
QT = qml-private core packetprotocol-private
SOURCES += \
$$PWD/qqmlnativedebugservicefactory.cpp \
$$PWD/qqmlnativedebugservice.cpp
HEADERS += \
$$PWD/../shared/qqmldebugpacket.h \
$$PWD/qqmlnativedebugservicefactory.h \
$$PWD/qqmlnativedebugservice.h \
INCLUDEPATH += $$PWD \
$$PWD/../shared
OTHER_FILES += \
$$PWD/qqmlnativedebugservice.json
PLUGIN_TYPE = qmltooling
PLUGIN_CLASS_NAME = QQmlNativeDebugServiceFactory
load(qt_plugin)

View File

@ -67,7 +67,6 @@ QT_BEGIN_NAMESPACE
class NativeDebugger;
class BreakPointHandler;
class QQmlDebuggerServiceFactory;
class QQmlNativeDebugServiceImpl : public QQmlNativeDebugService
{
@ -86,7 +85,6 @@ public:
void emitAsynchronousMessageToClient(const QJsonObject &message);
private:
friend class QQmlDebuggerServiceFactory;
friend class NativeDebugger;
QList<QPointer<NativeDebugger> > m_debuggers;

View File

@ -0,0 +1,3 @@
{
"Keys": [ "NativeQmlDebugger" ]
}

View File

@ -0,0 +1,54 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qqmlnativedebugservice.h"
#include "qqmlnativedebugservicefactory.h"
#include <private/qqmldebugserviceinterfaces_p.h>
QT_BEGIN_NAMESPACE
QQmlDebugService *QQmlNativeDebugServiceFactory::create(const QString &key)
{
if (key == QQmlNativeDebugServiceImpl::s_key)
return new QQmlNativeDebugServiceImpl(this);
return 0;
}
QT_END_NAMESPACE

View File

@ -0,0 +1,57 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QQMLNATIVEDEBUGSERVICEFACTORY_H
#define QQMLNATIVEDEBUGSERVICEFACTORY_H
#include <private/qqmldebugservicefactory_p.h>
QT_BEGIN_NAMESPACE
class QQmlNativeDebugServiceFactory : public QQmlDebugServiceFactory
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlDebugServiceFactory_iid FILE "qqmlnativedebugservice.json")
public:
QQmlDebugService *create(const QString &key);
};
QT_END_NAMESPACE
#endif // QQMLNATIVEDEBUGSERVICEFACTORY_H

View File

@ -20,13 +20,15 @@ qtConfig(qml-network) {
SUBDIRS += \
qmldbg_debugger \
qmldbg_profiler \
qmldbg_messages
qmldbg_messages \
qmldbg_nativedebugger
qmldbg_server.depends = packetprotocol
qmldbg_native.depends = packetprotocol
qmldbg_debugger.depends = packetprotocol
qmldbg_profiler.depends = packetprotocol
qmldbg_messages.depends = packetprotocol
qmldbg_nativedebugger.depends = packetprotocol
qtHaveModule(quick) {
SUBDIRS += \

View File

@ -205,14 +205,14 @@ protected:
class Q_QML_PRIVATE_EXPORT QQmlNativeDebugService : public QQmlDebugService
{
Q_OBJECT
public:
static const QString s_key;
protected:
friend class QQmlDebugConnector;
QQmlNativeDebugService(float version, QObject *parent = 0)
: QQmlDebugService(s_key, version, parent) {}
static const QString s_key;
};
#endif