summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEl Mehdi Fekari <mfekari@blackberry.com>2013-11-12 15:56:27 +0100
committerMehdi Fekari <mfekari@blackberry.com>2013-11-20 17:21:24 +0100
commit27f3702f5675764ec1a90ba207ff46b66dd3e533 (patch)
tree5293a2f86f8b157f2361e73ec7667e6b69cb719e /src
parentb20ed0a0f3855336407dfa5d8a1f782ed0bbfbe0 (diff)
downloadqt-creator-27f3702f5675764ec1a90ba207ff46b66dd3e533.tar.gz
Qnx: Add a build step for checking the device's debug token
This patch replaces the development mode check build step by a debug token check which privdes more explicit error message if the device's debug token is not valid. Task-number: QTCREATORBUG-9673 Task-number: QTCREATORBUG-9001 Change-Id: I0a6148cc533156f3bfd6acbeb4abec2713b37b3c Reviewed-by: Tobias Nätterlund <tobias.naetterlund@kdab.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qnx/blackberrycheckdebugtokenstep.cpp156
-rw-r--r--src/plugins/qnx/blackberrycheckdebugtokenstep.h (renamed from src/plugins/qnx/blackberrycheckdevmodestep.h)34
-rw-r--r--src/plugins/qnx/blackberrycheckdebugtokenstepconfigwidget.cpp (renamed from src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.cpp)12
-rw-r--r--src/plugins/qnx/blackberrycheckdebugtokenstepconfigwidget.h (renamed from src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.h)8
-rw-r--r--src/plugins/qnx/blackberrycheckdebugtokenstepfactory.cpp (renamed from src/plugins/qnx/blackberrycheckdevmodestepfactory.cpp)34
-rw-r--r--src/plugins/qnx/blackberrycheckdebugtokenstepfactory.h (renamed from src/plugins/qnx/blackberrycheckdevmodestepfactory.h)8
-rw-r--r--src/plugins/qnx/blackberrycheckdevmodestep.cpp110
-rw-r--r--src/plugins/qnx/blackberrydeployconfigurationfactory.cpp4
-rw-r--r--src/plugins/qnx/blackberrydeviceinformation.cpp13
-rw-r--r--src/plugins/qnx/blackberrydeviceinformation.h2
-rw-r--r--src/plugins/qnx/blackberryndkprocess.cpp1
-rw-r--r--src/plugins/qnx/blackberryndkprocess.h1
-rw-r--r--src/plugins/qnx/qnx.pro12
-rw-r--r--src/plugins/qnx/qnx.qbs12
-rw-r--r--src/plugins/qnx/qnxconstants.h2
-rw-r--r--src/plugins/qnx/qnxplugin.cpp4
16 files changed, 243 insertions, 170 deletions
diff --git a/src/plugins/qnx/blackberrycheckdebugtokenstep.cpp b/src/plugins/qnx/blackberrycheckdebugtokenstep.cpp
new file mode 100644
index 0000000000..3094913a8d
--- /dev/null
+++ b/src/plugins/qnx/blackberrycheckdebugtokenstep.cpp
@@ -0,0 +1,156 @@
+/**************************************************************************
+**
+** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+**
+** Contact: BlackBerry (qt@blackberry.com)
+** Contact: KDAB (info@kdab.com)
+**
+** This file is part of Qt Creator.
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "blackberrycheckdebugtokenstep.h"
+
+#include "blackberrycheckdebugtokenstepconfigwidget.h"
+#include "blackberrydeviceinformation.h"
+#include "qnxconstants.h"
+
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/task.h>
+#include <ssh/sshconnection.h>
+
+#include <qeventloop.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryCheckDebugTokenStep::BlackBerryCheckDebugTokenStep(ProjectExplorer::BuildStepList *bsl) :
+ ProjectExplorer::BuildStep(bsl, Core::Id(Constants::QNX_CHECK_DEBUG_TOKEN_BS_ID))
+ , m_deviceInfo(0)
+ , m_eventLoop(0)
+{
+ setDisplayName(tr("Check Debug Token"));
+}
+
+BlackBerryCheckDebugTokenStep::BlackBerryCheckDebugTokenStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDebugTokenStep *bs) :
+ ProjectExplorer::BuildStep(bsl, bs)
+ , m_deviceInfo(0)
+ , m_eventLoop(0)
+{
+ setDisplayName(tr("Check Debug Token"));
+}
+
+void BlackBerryCheckDebugTokenStep::checkDeviceInfo(int status)
+{
+ // Skip debug token check for internal non secure devices and simulators
+ if (m_deviceInfo->isProductionDevice() && !m_deviceInfo->isSimulator()) {
+ if (status != BlackBerryDeviceInformation::Success) {
+ switch (status) {
+ case BlackBerryDeviceInformation::AuthenticationFailed:
+ raiseError(tr("Authentication failed."));
+ break;
+ case BlackBerryDeviceInformation::NoRouteToHost:
+ raiseError(tr("Cannot connect to device."));
+ break;
+ case BlackBerryDeviceInformation::DevelopmentModeDisabled:
+ raiseError(tr("Device is not in the development mode."));
+ break;
+ case BlackBerryDeviceInformation::InferiorProcessTimedOut:
+ raiseError(tr("Timeout querying device information."));
+ break;
+ case BlackBerryDeviceInformation::FailedToStartInferiorProcess:
+ raiseError(tr("Failed to query device information."));
+ break;
+ case BlackBerryDeviceInformation::InferiorProcessCrashed:
+ raiseError(tr("Process to query device information has crashed."));
+ break;
+ default:
+ raiseError(tr("Cannot query device information."));
+ break;
+ }
+ m_eventLoop->exit(false);
+ return;
+ }
+
+ if (!m_deviceInfo->debugTokenValid()) {
+ raiseError(m_deviceInfo->debugTokenValidationError());
+ m_eventLoop->exit(false);
+ return;
+ }
+ }
+
+ m_eventLoop->exit(true);
+}
+
+void BlackBerryCheckDebugTokenStep::emitOutputInfo()
+{
+ emit addOutput(tr("Checking debug token..."), BuildStep::MessageOutput);
+}
+
+bool BlackBerryCheckDebugTokenStep::init()
+{
+ m_device = BlackBerryDeviceConfiguration::device(target()->kit());
+ if (!m_device)
+ return false;
+
+ if (m_device->sshParameters().host.isEmpty()) {
+ raiseError(tr("No hostname specified for the device"));
+ return false;
+ }
+
+ return true;
+}
+
+void BlackBerryCheckDebugTokenStep::run(QFutureInterface<bool> &fi)
+{
+ m_eventLoop = new QEventLoop;
+ m_deviceInfo = new BlackBerryDeviceInformation;
+
+ connect(m_deviceInfo, SIGNAL(started()), this, SLOT(emitOutputInfo()));
+ connect(m_deviceInfo, SIGNAL(finished(int)), this, SLOT(checkDeviceInfo(int)), Qt::DirectConnection);
+ m_deviceInfo->setDeviceTarget(m_device->sshParameters().host, m_device->sshParameters().password);
+
+ bool returnValue = m_eventLoop->exec();
+
+ delete m_eventLoop;
+ m_eventLoop = 0;
+
+ delete m_deviceInfo;
+ m_deviceInfo = 0;
+
+ return fi.reportResult(returnValue);
+}
+
+ProjectExplorer::BuildStepConfigWidget *BlackBerryCheckDebugTokenStep::createConfigWidget()
+{
+ return new BlackBerryCheckDebugTokenConfigWidget();
+}
+
+void BlackBerryCheckDebugTokenStep::raiseError(const QString &errorMessage)
+{
+ emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
+ emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
+ ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
+}
diff --git a/src/plugins/qnx/blackberrycheckdevmodestep.h b/src/plugins/qnx/blackberrycheckdebugtokenstep.h
index 5f5e1bc9d9..84152499fe 100644
--- a/src/plugins/qnx/blackberrycheckdevmodestep.h
+++ b/src/plugins/qnx/blackberrycheckdebugtokenstep.h
@@ -29,35 +29,49 @@
**
****************************************************************************/
-#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H
-#define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H
+#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEP_H
+#define QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEP_H
-#include "blackberryabstractdeploystep.h"
+#include "blackberrydeviceconfiguration.h"
+
+#include <projectexplorer/buildstep.h>
+
+QT_BEGIN_NAMESPACE
+class QEventLoop;
+QT_END_NAMESPACE
namespace Qnx {
namespace Internal {
-class BlackBerryCheckDevModeStep : public BlackBerryAbstractDeployStep
+class BlackBerryDeviceInformation;
+class BlackBerryCheckDebugTokenStep : public ProjectExplorer::BuildStep
{
Q_OBJECT
- friend class BlackBerryCheckDevModeStepFactory;
+ friend class BlackBerryCheckDebugTokenStepFactory;
public:
- explicit BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl);
+ explicit BlackBerryCheckDebugTokenStep(ProjectExplorer::BuildStepList *bsl);
bool init();
+ void run(QFutureInterface<bool> &fi);
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
+ void raiseError(const QString& error);
+
protected:
- BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDevModeStep *bs);
+ BlackBerryCheckDebugTokenStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDebugTokenStep *bs);
- void processStarted(const ProjectExplorer::ProcessParameters &params);
+protected slots:
+ void checkDeviceInfo(int status);
+ void emitOutputInfo();
private:
- QString password() const;
+ BlackBerryDeviceInformation *m_deviceInfo;
+ BlackBerryDeviceConfiguration::ConstPtr m_device;
+ QEventLoop *m_eventLoop;
};
} // namespace Internal
} // namespace Qnx
-#endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H
+#endif // QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEP_H
diff --git a/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.cpp b/src/plugins/qnx/blackberrycheckdebugtokenstepconfigwidget.cpp
index a6bb9fbfad..de372497bd 100644
--- a/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.cpp
+++ b/src/plugins/qnx/blackberrycheckdebugtokenstepconfigwidget.cpp
@@ -29,27 +29,27 @@
**
****************************************************************************/
-#include "blackberrycheckdevmodestepconfigwidget.h"
+#include "blackberrycheckdebugtokenstepconfigwidget.h"
using namespace Qnx;
using namespace Qnx::Internal;
-BlackBerryCheckDevModeStepConfigWidget::BlackBerryCheckDevModeStepConfigWidget() :
+BlackBerryCheckDebugTokenConfigWidget::BlackBerryCheckDebugTokenConfigWidget() :
ProjectExplorer::BuildStepConfigWidget()
{
}
-QString BlackBerryCheckDevModeStepConfigWidget::displayName() const
+QString BlackBerryCheckDebugTokenConfigWidget::displayName() const
{
- return tr("<b>Check development mode</b>");
+ return tr("<b>Check debug token</b>");
}
-QString BlackBerryCheckDevModeStepConfigWidget::summaryText() const
+QString BlackBerryCheckDebugTokenConfigWidget::summaryText() const
{
return displayName();
}
-bool BlackBerryCheckDevModeStepConfigWidget::showWidget() const
+bool BlackBerryCheckDebugTokenConfigWidget::showWidget() const
{
return false;
}
diff --git a/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.h b/src/plugins/qnx/blackberrycheckdebugtokenstepconfigwidget.h
index cf14780666..f092754172 100644
--- a/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.h
+++ b/src/plugins/qnx/blackberrycheckdebugtokenstepconfigwidget.h
@@ -29,19 +29,19 @@
**
****************************************************************************/
-#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H
-#define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H
+#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEPCONFIGWIDGET_H
+#define QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEPCONFIGWIDGET_H
#include <projectexplorer/buildstep.h>
namespace Qnx {
namespace Internal {
-class BlackBerryCheckDevModeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
+class BlackBerryCheckDebugTokenConfigWidget : public ProjectExplorer::BuildStepConfigWidget
{
Q_OBJECT
public:
- explicit BlackBerryCheckDevModeStepConfigWidget();
+ explicit BlackBerryCheckDebugTokenConfigWidget();
QString displayName() const;
QString summaryText() const;
diff --git a/src/plugins/qnx/blackberrycheckdevmodestepfactory.cpp b/src/plugins/qnx/blackberrycheckdebugtokenstepfactory.cpp
index 58d69de160..3185f2c306 100644
--- a/src/plugins/qnx/blackberrycheckdevmodestepfactory.cpp
+++ b/src/plugins/qnx/blackberrycheckdebugtokenstepfactory.cpp
@@ -29,9 +29,9 @@
**
****************************************************************************/
-#include "blackberrycheckdevmodestepfactory.h"
+#include "blackberrycheckdebugtokenstepfactory.h"
-#include "blackberrycheckdevmodestep.h"
+#include "blackberrycheckdebugtokenstep.h"
#include "blackberrydeviceconfigurationfactory.h"
#include "qnxconstants.h"
@@ -43,12 +43,12 @@
using namespace Qnx;
using namespace Qnx::Internal;
-BlackBerryCheckDevModeStepFactory::BlackBerryCheckDevModeStepFactory(QObject *parent) :
+BlackBerryCheckDebugTokenStepFactory::BlackBerryCheckDebugTokenStepFactory(QObject *parent) :
ProjectExplorer::IBuildStepFactory(parent)
{
}
-QList<Core::Id> BlackBerryCheckDevModeStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
+QList<Core::Id> BlackBerryCheckDebugTokenStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
{
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
return QList<Core::Id>();
@@ -57,52 +57,52 @@ QList<Core::Id> BlackBerryCheckDevModeStepFactory::availableCreationIds(ProjectE
if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType())
return QList<Core::Id>();
- return QList<Core::Id>() << Core::Id(Constants::QNX_CHECK_DEVELOPMENT_MODE_BS_ID);
+ return QList<Core::Id>() << Core::Id(Constants::QNX_CHECK_DEBUG_TOKEN_BS_ID);
}
-QString BlackBerryCheckDevModeStepFactory::displayNameForId(const Core::Id id) const
+QString BlackBerryCheckDebugTokenStepFactory::displayNameForId(const Core::Id id) const
{
- if (id == Constants::QNX_CHECK_DEVELOPMENT_MODE_BS_ID)
- return tr("Check Development Mode");
+ if (id == Constants::QNX_CHECK_DEBUG_TOKEN_BS_ID)
+ return tr("Check Debug Token");
return QString();
}
-bool BlackBerryCheckDevModeStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
+bool BlackBerryCheckDebugTokenStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
{
return availableCreationIds(parent).contains(id);
}
-ProjectExplorer::BuildStep *BlackBerryCheckDevModeStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
+ProjectExplorer::BuildStep *BlackBerryCheckDebugTokenStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
{
if (!canCreate(parent, id))
return 0;
- return new BlackBerryCheckDevModeStep(parent);
+ return new BlackBerryCheckDebugTokenStep(parent);
}
-bool BlackBerryCheckDevModeStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
+bool BlackBerryCheckDebugTokenStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
{
return canCreate(parent, ProjectExplorer::idFromMap(map));
}
-ProjectExplorer::BuildStep *BlackBerryCheckDevModeStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
+ProjectExplorer::BuildStep *BlackBerryCheckDebugTokenStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
{
if (!canRestore(parent, map))
return 0;
- BlackBerryCheckDevModeStep *bs = new BlackBerryCheckDevModeStep(parent);
+ BlackBerryCheckDebugTokenStep *bs = new BlackBerryCheckDebugTokenStep(parent);
if (bs->fromMap(map))
return bs;
delete bs;
return 0;
}
-bool BlackBerryCheckDevModeStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
+bool BlackBerryCheckDebugTokenStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
{
return canCreate(parent, product->id());
}
-ProjectExplorer::BuildStep *BlackBerryCheckDevModeStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
+ProjectExplorer::BuildStep *BlackBerryCheckDebugTokenStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
{
if (!canClone(parent, product))
return 0;
- return new BlackBerryCheckDevModeStep(parent, static_cast<BlackBerryCheckDevModeStep *>(product));
+ return new BlackBerryCheckDebugTokenStep(parent, static_cast<BlackBerryCheckDebugTokenStep *>(product));
}
diff --git a/src/plugins/qnx/blackberrycheckdevmodestepfactory.h b/src/plugins/qnx/blackberrycheckdebugtokenstepfactory.h
index f028fd9a7c..36683130e2 100644
--- a/src/plugins/qnx/blackberrycheckdevmodestepfactory.h
+++ b/src/plugins/qnx/blackberrycheckdebugtokenstepfactory.h
@@ -29,19 +29,19 @@
**
****************************************************************************/
-#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H
-#define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H
+#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEPFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEPFACTORY_H
#include <projectexplorer/buildstep.h>
namespace Qnx {
namespace Internal {
-class BlackBerryCheckDevModeStepFactory : public ProjectExplorer::IBuildStepFactory
+class BlackBerryCheckDebugTokenStepFactory : public ProjectExplorer::IBuildStepFactory
{
Q_OBJECT
public:
- explicit BlackBerryCheckDevModeStepFactory(QObject *parent = 0);
+ explicit BlackBerryCheckDebugTokenStepFactory(QObject *parent = 0);
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
QString displayNameForId(const Core::Id id) const;
diff --git a/src/plugins/qnx/blackberrycheckdevmodestep.cpp b/src/plugins/qnx/blackberrycheckdevmodestep.cpp
deleted file mode 100644
index 93e45087f9..0000000000
--- a/src/plugins/qnx/blackberrycheckdevmodestep.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
-**
-** Contact: BlackBerry (qt@blackberry.com)
-** Contact: KDAB (info@kdab.com)
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "blackberrycheckdevmodestep.h"
-
-#include "blackberrycheckdevmodestepconfigwidget.h"
-#include "blackberrydeviceconfiguration.h"
-#include "qnxconstants.h"
-
-#include <projectexplorer/buildconfiguration.h>
-#include <projectexplorer/target.h>
-#include <ssh/sshconnection.h>
-
-using namespace Qnx;
-using namespace Qnx::Internal;
-
-BlackBerryCheckDevModeStep::BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl) :
- BlackBerryAbstractDeployStep(bsl, Core::Id(Constants::QNX_CHECK_DEVELOPMENT_MODE_BS_ID))
-{
- setDisplayName(tr("Check Development Mode"));
-}
-
-BlackBerryCheckDevModeStep::BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDevModeStep *bs) :
- BlackBerryAbstractDeployStep(bsl, bs)
-{
- setDisplayName(tr("Check Development Mode"));
-}
-
-bool BlackBerryCheckDevModeStep::init()
-{
- if (!BlackBerryAbstractDeployStep::init())
- return false;
-
- QString deployCmd = target()->activeBuildConfiguration()->environment().searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD));
- if (deployCmd.isEmpty()) {
- raiseError(tr("Could not find command '%1' in the build environment")
- .arg(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD)));
- return false;
- }
-
- BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->kit());
- QString deviceHost = device ? device->sshParameters().host : QString();
- if (deviceHost.isEmpty()) {
- raiseError(tr("No hostname specified for device"));
- return false;
- }
-
- QStringList args;
- args << QLatin1String("-listDeviceInfo");
- args << deviceHost;
- if (!device->sshParameters().password.isEmpty()) {
- args << QLatin1String("-password");
- args << device->sshParameters().password;
- }
-
- addCommand(deployCmd, args);
-
- return true;
-}
-
-ProjectExplorer::BuildStepConfigWidget *BlackBerryCheckDevModeStep::createConfigWidget()
-{
- return new BlackBerryCheckDevModeStepConfigWidget();
-}
-
-QString BlackBerryCheckDevModeStep::password() const
-{
- BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->kit());
- return device ? device->sshParameters().password : QString();
-}
-
-void BlackBerryCheckDevModeStep::processStarted(const ProjectExplorer::ProcessParameters &params)
-{
- QString arguments = params.prettyArguments();
- if (!password().isEmpty()) {
- const QString passwordLine = QLatin1String(" -password ") + password();
- const QString hiddenPasswordLine = QLatin1String(" -password <hidden>");
- arguments.replace(passwordLine, hiddenPasswordLine);
- }
-
- emitOutputInfo(params, arguments);
-}
diff --git a/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp b/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp
index 44228ec761..5f96f4c791 100644
--- a/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp
+++ b/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp
@@ -32,7 +32,7 @@
#include "blackberrydeployconfigurationfactory.h"
#include "qnxconstants.h"
-#include "blackberrycheckdevmodestep.h"
+#include "blackberrycheckdebugtokenstep.h"
#include "blackberrydeployconfiguration.h"
#include "blackberrycreatepackagestep.h"
#include "blackberrydeploystep.h"
@@ -93,7 +93,7 @@ ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::crea
return 0;
BlackBerryDeployConfiguration *dc = new BlackBerryDeployConfiguration(parent);
- dc->stepList()->insertStep(0, new BlackBerryCheckDevModeStep(dc->stepList()));
+ dc->stepList()->insertStep(0, new BlackBerryCheckDebugTokenStep(dc->stepList()));
dc->stepList()->insertStep(1, new BlackBerryCreatePackageStep(dc->stepList()));
dc->stepList()->insertStep(2, new BlackBerryDeployStep(dc->stepList()));
return dc;
diff --git a/src/plugins/qnx/blackberrydeviceinformation.cpp b/src/plugins/qnx/blackberrydeviceinformation.cpp
index b9e67d3059..12d24bdb5c 100644
--- a/src/plugins/qnx/blackberrydeviceinformation.cpp
+++ b/src/plugins/qnx/blackberrydeviceinformation.cpp
@@ -68,6 +68,7 @@ void BlackBerryDeviceInformation::resetResults()
m_deviceOS.clear();
m_hardwareId.clear();
m_debugTokenAuthor.clear();
+ m_debugTokenValidationError.clear();
m_scmBundle.clear();
m_hostName.clear();
m_debugTokenValid = false;
@@ -95,6 +96,11 @@ QString BlackBerryDeviceInformation::debugTokenAuthor() const
return m_debugTokenAuthor;
}
+QString BlackBerryDeviceInformation::debugTokenValidationError() const
+{
+ return m_debugTokenValidationError;
+}
+
QString BlackBerryDeviceInformation::scmBundle() const
{
return m_scmBundle;
@@ -125,8 +131,9 @@ void BlackBerryDeviceInformation::processData(const QString &line)
static const QString devicepin = QLatin1String("devicepin::0x");
static const QString device_os = QLatin1String("device_os::");
static const QString hardwareid = QLatin1String("hardwareid::");
- static const QString debug_token_author = QLatin1String("debug_token_author::");
- static const QString debug_token_valid = QLatin1String("debug_token_valid:b:");
+ static const QString debug_token_author = QLatin1String("[n]debug_token_author::");
+ static const QString debug_token_validation_error = QLatin1String("[n]debug_token_validation_error::");
+ static const QString debug_token_valid = QLatin1String("[n]debug_token_valid:b:");
static const QString simulator = QLatin1String("simulator:b:");
static const QString scmbundle = QLatin1String("scmbundle::");
static const QString hostname = QLatin1String("hostname::");
@@ -140,6 +147,8 @@ void BlackBerryDeviceInformation::processData(const QString &line)
m_hardwareId = line.mid(hardwareid.size()).trimmed();
else if (line.startsWith(debug_token_author))
m_debugTokenAuthor = line.mid(debug_token_author.size()).trimmed();
+ else if (line.startsWith(debug_token_validation_error))
+ m_debugTokenValidationError = line.mid(debug_token_validation_error.size()).trimmed();
else if (line.startsWith(debug_token_valid))
m_debugTokenValid = line.mid(debug_token_valid.size()).trimmed() == QLatin1String("true");
else if (line.startsWith(simulator))
diff --git a/src/plugins/qnx/blackberrydeviceinformation.h b/src/plugins/qnx/blackberrydeviceinformation.h
index bbcc4ba4b3..d64f078f0c 100644
--- a/src/plugins/qnx/blackberrydeviceinformation.h
+++ b/src/plugins/qnx/blackberrydeviceinformation.h
@@ -62,6 +62,7 @@ public:
QString deviceOS() const;
QString hardwareId() const;
QString debugTokenAuthor() const;
+ QString debugTokenValidationError() const;
bool debugTokenValid() const;
QString scmBundle() const;
QString hostName() const;
@@ -75,6 +76,7 @@ private:
QString m_debugTokenAuthor;
QString m_scmBundle;
QString m_hostName;
+ QString m_debugTokenValidationError;
bool m_debugTokenValid;
bool m_isSimulator;
bool m_isProductionDevice;
diff --git a/src/plugins/qnx/blackberryndkprocess.cpp b/src/plugins/qnx/blackberryndkprocess.cpp
index 56f52fbee3..d3d9bb3291 100644
--- a/src/plugins/qnx/blackberryndkprocess.cpp
+++ b/src/plugins/qnx/blackberryndkprocess.cpp
@@ -47,6 +47,7 @@ BlackBerryNdkProcess::BlackBerryNdkProcess(const QString &command, QObject *pare
{
m_process->setProcessChannelMode(QProcess::MergedChannels);
+ connect(m_process, SIGNAL(started()), this, SIGNAL(started()));
connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(processFinished()));
connect(m_process, SIGNAL(error(QProcess::ProcessError)),
diff --git a/src/plugins/qnx/blackberryndkprocess.h b/src/plugins/qnx/blackberryndkprocess.h
index a73a3873d1..96d3279306 100644
--- a/src/plugins/qnx/blackberryndkprocess.h
+++ b/src/plugins/qnx/blackberryndkprocess.h
@@ -65,6 +65,7 @@ public:
signals:
void finished(int status);
+ void started();
protected:
explicit BlackBerryNdkProcess(const QString &command, QObject *parent = 0);
diff --git a/src/plugins/qnx/qnx.pro b/src/plugins/qnx/qnx.pro
index 2f0b403b76..511888f146 100644
--- a/src/plugins/qnx/qnx.pro
+++ b/src/plugins/qnx/qnx.pro
@@ -69,9 +69,9 @@ SOURCES += qnxplugin.cpp \
blackberrydebugtokenuploader.cpp \
blackberrydebugtokenreader.cpp \
blackberryndkprocess.cpp \
- blackberrycheckdevmodestepfactory.cpp \
- blackberrycheckdevmodestep.cpp \
- blackberrycheckdevmodestepconfigwidget.cpp \
+ blackberrycheckdebugtokenstep.cpp \
+ blackberrycheckdebugtokenstepconfigwidget.cpp \
+ blackberrycheckdebugtokenstepfactory.cpp \
blackberrydeviceconnection.cpp \
blackberrydeviceconnectionmanager.cpp \
blackberrydeviceinformation.cpp \
@@ -167,9 +167,9 @@ HEADERS += qnxplugin.h\
blackberrydebugtokenuploader.h \
blackberrydebugtokenreader.h \
blackberryndkprocess.h \
- blackberrycheckdevmodestepfactory.h \
- blackberrycheckdevmodestep.h \
- blackberrycheckdevmodestepconfigwidget.h \
+ blackberrycheckdebugtokenstep.h \
+ blackberrycheckdebugtokenstepconfigwidget.h \
+ blackberrycheckdebugtokenstepfactory.h \
blackberrydeviceconnection.h \
blackberrydeviceconnectionmanager.h \
blackberrydeviceinformation.h \
diff --git a/src/plugins/qnx/qnx.qbs b/src/plugins/qnx/qnx.qbs
index da95f3c55e..4be75bb4df 100644
--- a/src/plugins/qnx/qnx.qbs
+++ b/src/plugins/qnx/qnx.qbs
@@ -59,12 +59,12 @@ QtcPlugin {
"blackberryabstractdeploystep.h",
"blackberryapplicationrunner.cpp",
"blackberryapplicationrunner.h",
- "blackberrycheckdevmodestep.cpp",
- "blackberrycheckdevmodestep.h",
- "blackberrycheckdevmodestepconfigwidget.cpp",
- "blackberrycheckdevmodestepconfigwidget.h",
- "blackberrycheckdevmodestepfactory.cpp",
- "blackberrycheckdevmodestepfactory.h",
+ "blackberrycheckdebugtokenstep.cpp",
+ "blackberrycheckdebugtokenstep.h",
+ "blackberrycheckdebugtokenstepconfigwidget.cpp",
+ "blackberrycheckdebugtokenstepconfigwidget.h",
+ "blackberrycheckdebugtokenstepfactory.cpp",
+ "blackberrycheckdebugtokenstepfactory.h",
"blackberryconfigurationmanager.cpp",
"blackberryconfigurationmanager.h",
"blackberrycreatepackagestep.cpp",
diff --git a/src/plugins/qnx/qnxconstants.h b/src/plugins/qnx/qnxconstants.h
index 726657f748..c5c278eddd 100644
--- a/src/plugins/qnx/qnxconstants.h
+++ b/src/plugins/qnx/qnxconstants.h
@@ -69,7 +69,7 @@ const char QNX_QNX_RUNCONFIGURATION_PREFIX[] = "Qt4ProjectManager.QNX.QNXRunConf
const char QNX_CREATE_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxCreatePackageBuildStep";
const char QNX_DEPLOY_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxDeployPackageBuildStep";
-const char QNX_CHECK_DEVELOPMENT_MODE_BS_ID[] = "Qt4ProjectManager.QnxCheckDevelopmentModeBuildStep";
+const char QNX_CHECK_DEBUG_TOKEN_BS_ID[] = "Qt4ProjectManager.QnxCheckDebugTokenBuildStep";
const char QNX_PROFILEPATH_KEY[] = "Qt4ProjectManager.QnxRunConfiguration.ProFilePath";
diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp
index 37c4216b2e..4184e094f2 100644
--- a/src/plugins/qnx/qnxplugin.cpp
+++ b/src/plugins/qnx/qnxplugin.cpp
@@ -49,7 +49,7 @@
#include "bardescriptoreditorfactory.h"
#include "bardescriptormagicmatcher.h"
#include "blackberrykeyspage.h"
-#include "blackberrycheckdevmodestepfactory.h"
+#include "blackberrycheckdebugtokenstepfactory.h"
#include "blackberrydeviceconnectionmanager.h"
#include "blackberryconfigurationmanager.h"
#include "cascadesimport/cascadesimportwizard.h"
@@ -91,7 +91,7 @@ bool QNXPlugin::initialize(const QStringList &arguments, QString *errorString)
addAutoReleasedObject(new BlackBerryRunControlFactory);
addAutoReleasedObject(new BlackBerryNDKSettingsPage);
addAutoReleasedObject(new BlackBerryKeysPage);
- addAutoReleasedObject(new BlackBerryCheckDevModeStepFactory);
+ addAutoReleasedObject(new BlackBerryCheckDebugTokenStepFactory);
addAutoReleasedObject(new CascadesImportWizard);
BlackBerryDeviceConnectionManager::instance()->initialize();