summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nätterlund <tobias.naetterlund.qnx@kdab.com>2013-03-12 09:23:08 +0100
committerTobias Nätterlund <tobias.naetterlund@kdab.com>2013-03-25 09:12:24 +0100
commite72d41cb1e84fd1b804363be4e22a584e738da43 (patch)
tree70ab1f6ded3d1f254d99615324c2888c4b8ec8f8
parent3e373927c521dc44ced11765799497afa534fc31 (diff)
downloadqt-creator-e72d41cb1e84fd1b804363be4e22a584e738da43.tar.gz
QNX: Abort deployment if device is not in Development Mode
This adds a new deploy step (BlackBerryCheckDevModeStep), which checks for Development Mode being set on the device. If not set, the deployment stops early on in the process. Without this step, the deployment would not fail until after uploading the package. Moved blackberry-deploy into a constant, as it's used in multiple places by now. Change-Id: I813754108fb4be281e752b12ac56d4f0b302077d Reviewed-by: Mehdi Fekari <mfekari@rim.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
-rw-r--r--src/plugins/qnx/blackberryabstractdeploystep.cpp9
-rw-r--r--src/plugins/qnx/blackberryabstractdeploystep.h2
-rw-r--r--src/plugins/qnx/blackberryapplicationrunner.cpp5
-rw-r--r--src/plugins/qnx/blackberrycheckdevmodestep.cpp135
-rw-r--r--src/plugins/qnx/blackberrycheckdevmodestep.h68
-rw-r--r--src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.cpp55
-rw-r--r--src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.h55
-rw-r--r--src/plugins/qnx/blackberrycheckdevmodestepfactory.cpp108
-rw-r--r--src/plugins/qnx/blackberrycheckdevmodestepfactory.h64
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestep.cpp7
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestep.h2
-rw-r--r--src/plugins/qnx/blackberrydebugtokenuploader.cpp5
-rw-r--r--src/plugins/qnx/blackberrydeployconfigurationfactory.cpp6
-rw-r--r--src/plugins/qnx/blackberrydeploystep.cpp13
-rw-r--r--src/plugins/qnx/blackberrydeploystep.h2
-rw-r--r--src/plugins/qnx/qnx.pro10
-rw-r--r--src/plugins/qnx/qnx.qbs6
-rw-r--r--src/plugins/qnx/qnxconstants.h4
-rw-r--r--src/plugins/qnx/qnxplugin.cpp2
19 files changed, 527 insertions, 31 deletions
diff --git a/src/plugins/qnx/blackberryabstractdeploystep.cpp b/src/plugins/qnx/blackberryabstractdeploystep.cpp
index 7a3af3912f..2eab527a86 100644
--- a/src/plugins/qnx/blackberryabstractdeploystep.cpp
+++ b/src/plugins/qnx/blackberryabstractdeploystep.cpp
@@ -32,7 +32,9 @@
#include "blackberryabstractdeploystep.h"
#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
+#include <projectexplorer/task.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
@@ -176,6 +178,13 @@ void BlackBerryAbstractDeployStep::emitOutputInfo(const ProjectExplorer::Process
BuildStep::MessageOutput);
}
+void BlackBerryAbstractDeployStep::raiseError(const QString &errorMessage)
+{
+ emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
+ emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
+ Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
+}
+
void BlackBerryAbstractDeployStep::processReadyReadStdOutput()
{
m_process->setReadChannel(QProcess::StandardOutput);
diff --git a/src/plugins/qnx/blackberryabstractdeploystep.h b/src/plugins/qnx/blackberryabstractdeploystep.h
index 6d07f4d095..5f8da4a53e 100644
--- a/src/plugins/qnx/blackberryabstractdeploystep.h
+++ b/src/plugins/qnx/blackberryabstractdeploystep.h
@@ -71,6 +71,8 @@ protected:
void emitOutputInfo(const ProjectExplorer::ProcessParameters &params, const QString& arguments);
+ void raiseError(const QString &errorMessage);
+
private slots:
void processReadyReadStdOutput();
void processReadyReadStdError();
diff --git a/src/plugins/qnx/blackberryapplicationrunner.cpp b/src/plugins/qnx/blackberryapplicationrunner.cpp
index e49fc6a9d5..c51895747a 100644
--- a/src/plugins/qnx/blackberryapplicationrunner.cpp
+++ b/src/plugins/qnx/blackberryapplicationrunner.cpp
@@ -33,6 +33,7 @@
#include "blackberrydeployconfiguration.h"
#include "blackberryrunconfiguration.h"
+#include "qnxconstants.h"
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
@@ -43,8 +44,6 @@
#include <QDir>
namespace {
-const char DEPLOY_CMD[] = "blackberry-deploy";
-
qint64 parsePid(const QString &line)
{
QTC_ASSERT(line.startsWith(QLatin1String("result::")), return -1);
@@ -103,7 +102,7 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool debugMode, BlackBe
Target *target = runConfiguration->target();
BuildConfiguration *buildConfig = target->activeBuildConfiguration();
m_environment = buildConfig->environment();
- m_deployCmd = m_environment.searchInPath(QLatin1String(DEPLOY_CMD));
+ m_deployCmd = m_environment.searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD));
m_device = BlackBerryDeviceConfiguration::device(target->kit());
m_barPackage = runConfiguration->barPackage();
diff --git a/src/plugins/qnx/blackberrycheckdevmodestep.cpp b/src/plugins/qnx/blackberrycheckdevmodestep.cpp
new file mode 100644
index 0000000000..885d4c7a24
--- /dev/null
+++ b/src/plugins/qnx/blackberrycheckdevmodestep.cpp
@@ -0,0 +1,135 @@
+/**************************************************************************
+**
+** Copyright (C) 2011 - 2013 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.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;
+
+namespace {
+const char ERROR_MESSAGE_START[] = "Error: ";
+const char AUTHENTICATION_ERROR[] = "Authentication failed.";
+}
+
+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();
+}
+
+void BlackBerryCheckDevModeStep::stdOutput(const QString &line)
+{
+ handleErrorOutput(line);
+}
+
+void BlackBerryCheckDevModeStep::stdError(const QString &line)
+{
+ handleErrorOutput(line);
+}
+
+void BlackBerryCheckDevModeStep::handleErrorOutput(const QString &line)
+{
+ if (line.startsWith(QLatin1String(ERROR_MESSAGE_START))) {
+ if (line.contains(QLatin1String(AUTHENTICATION_ERROR)))
+ raiseError(tr("Authentication failed. Please make sure the password for the device is correct."));
+ else
+ raiseError(line);
+ }
+}
+
+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/blackberrycheckdevmodestep.h b/src/plugins/qnx/blackberrycheckdevmodestep.h
new file mode 100644
index 0000000000..e99be40cf4
--- /dev/null
+++ b/src/plugins/qnx/blackberrycheckdevmodestep.h
@@ -0,0 +1,68 @@
+/**************************************************************************
+**
+** Copyright (C) 2011 - 2013 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.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.
+**
+****************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H
+#define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H
+
+#include "blackberryabstractdeploystep.h"
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryCheckDevModeStep : public BlackBerryAbstractDeployStep
+{
+ Q_OBJECT
+ friend class BlackBerryCheckDevModeStepFactory;
+
+public:
+ explicit BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl);
+
+ bool init();
+ ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
+
+ void stdOutput(const QString &line);
+ void stdError(const QString &line);
+
+protected:
+ BlackBerryCheckDevModeStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDevModeStep *bs);
+
+ void processStarted(const ProjectExplorer::ProcessParameters &params);
+
+private:
+ void handleErrorOutput(const QString &line);
+
+ QString password() const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEP_H
diff --git a/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.cpp b/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.cpp
new file mode 100644
index 0000000000..e3d934ad29
--- /dev/null
+++ b/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.cpp
@@ -0,0 +1,55 @@
+/**************************************************************************
+**
+** Copyright (C) 2011 - 2013 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.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 "blackberrycheckdevmodestepconfigwidget.h"
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryCheckDevModeStepConfigWidget::BlackBerryCheckDevModeStepConfigWidget() :
+ ProjectExplorer::BuildStepConfigWidget()
+{
+}
+
+QString BlackBerryCheckDevModeStepConfigWidget::displayName() const
+{
+ return tr("<b>Check development mode</b>");
+}
+
+QString BlackBerryCheckDevModeStepConfigWidget::summaryText() const
+{
+ return displayName();
+}
+
+bool BlackBerryCheckDevModeStepConfigWidget::showWidget() const
+{
+ return false;
+}
diff --git a/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.h b/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.h
new file mode 100644
index 0000000000..e1b52949a6
--- /dev/null
+++ b/src/plugins/qnx/blackberrycheckdevmodestepconfigwidget.h
@@ -0,0 +1,55 @@
+/**************************************************************************
+**
+** Copyright (C) 2011 - 2013 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.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.
+**
+****************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H
+#define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H
+
+#include <projectexplorer/buildstep.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryCheckDevModeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryCheckDevModeStepConfigWidget();
+
+ QString displayName() const;
+ QString summaryText() const;
+
+ bool showWidget() const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H
diff --git a/src/plugins/qnx/blackberrycheckdevmodestepfactory.cpp b/src/plugins/qnx/blackberrycheckdevmodestepfactory.cpp
new file mode 100644
index 0000000000..666159a934
--- /dev/null
+++ b/src/plugins/qnx/blackberrycheckdevmodestepfactory.cpp
@@ -0,0 +1,108 @@
+/**************************************************************************
+**
+** Copyright (C) 2011 - 2013 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.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 "blackberrycheckdevmodestepfactory.h"
+
+#include "blackberrycheckdevmodestep.h"
+#include "blackberrydeviceconfigurationfactory.h"
+#include "qnxconstants.h"
+
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryCheckDevModeStepFactory::BlackBerryCheckDevModeStepFactory(QObject *parent) :
+ ProjectExplorer::IBuildStepFactory(parent)
+{
+}
+
+QList<Core::Id> BlackBerryCheckDevModeStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
+{
+ if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
+ return QList<Core::Id>();
+
+ Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->target()->kit());
+ if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType())
+ return QList<Core::Id>();
+
+ return QList<Core::Id>() << Core::Id(Constants::QNX_CHECK_DEVELOPMENT_MODE_BS_ID);
+}
+
+QString BlackBerryCheckDevModeStepFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == Constants::QNX_CHECK_DEVELOPMENT_MODE_BS_ID)
+ return tr("Check Development Mode");
+ return QString();
+}
+
+bool BlackBerryCheckDevModeStepFactory::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)
+{
+ if (!canCreate(parent, id))
+ return 0;
+ return new BlackBerryCheckDevModeStep(parent);
+}
+
+bool BlackBerryCheckDevModeStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
+{
+ return canCreate(parent, ProjectExplorer::idFromMap(map));
+}
+
+ProjectExplorer::BuildStep *BlackBerryCheckDevModeStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
+{
+ if (!canRestore(parent, map))
+ return 0;
+ BlackBerryCheckDevModeStep *bs = new BlackBerryCheckDevModeStep(parent);
+ if (bs->fromMap(map))
+ return bs;
+ delete bs;
+ return 0;
+}
+
+bool BlackBerryCheckDevModeStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
+{
+ return canCreate(parent, product->id());
+}
+
+ProjectExplorer::BuildStep *BlackBerryCheckDevModeStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
+{
+ if (!canClone(parent, product))
+ return 0;
+ return new BlackBerryCheckDevModeStep(parent, static_cast<BlackBerryCheckDevModeStep *>(product));
+}
diff --git a/src/plugins/qnx/blackberrycheckdevmodestepfactory.h b/src/plugins/qnx/blackberrycheckdevmodestepfactory.h
new file mode 100644
index 0000000000..7c26d20130
--- /dev/null
+++ b/src/plugins/qnx/blackberrycheckdevmodestepfactory.h
@@ -0,0 +1,64 @@
+/**************************************************************************
+**
+** Copyright (C) 2011 - 2013 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.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.
+**
+****************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H
+
+#include <projectexplorer/buildstep.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryCheckDevModeStepFactory : public ProjectExplorer::IBuildStepFactory
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryCheckDevModeStepFactory(QObject *parent = 0);
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+
+ bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
+ ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
+
+ bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
+ ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
+ const QVariantMap &map);
+
+ bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const;
+ ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *product);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H
diff --git a/src/plugins/qnx/blackberrycreatepackagestep.cpp b/src/plugins/qnx/blackberrycreatepackagestep.cpp
index 9126d64a9b..a7c97e82d9 100644
--- a/src/plugins/qnx/blackberrycreatepackagestep.cpp
+++ b/src/plugins/qnx/blackberrycreatepackagestep.cpp
@@ -153,13 +153,6 @@ QString BlackBerryCreatePackageStep::debugToken() const
return device->debugToken();
}
-void BlackBerryCreatePackageStep::raiseError(const QString &errorMessage)
-{
- emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
- emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
- Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
-}
-
bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDescriptorPath, const QString &preparedFilePath)
{
BlackBerryQtVersion *qtVersion = dynamic_cast<BlackBerryQtVersion *>(QtSupport::QtKitInformation::qtVersion(target()->kit()));
diff --git a/src/plugins/qnx/blackberrycreatepackagestep.h b/src/plugins/qnx/blackberrycreatepackagestep.h
index bb4cad4dbc..e43f4df9c2 100644
--- a/src/plugins/qnx/blackberrycreatepackagestep.h
+++ b/src/plugins/qnx/blackberrycreatepackagestep.h
@@ -57,8 +57,6 @@ public:
protected:
BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCreatePackageStep *bs);
- void raiseError(const QString &errorMessage);
-
private:
bool prepareAppDescriptorFile(const QString &appDescriptorPath, const QString &preparedFilePath);
};
diff --git a/src/plugins/qnx/blackberrydebugtokenuploader.cpp b/src/plugins/qnx/blackberrydebugtokenuploader.cpp
index cb336a09ce..c87d066727 100644
--- a/src/plugins/qnx/blackberrydebugtokenuploader.cpp
+++ b/src/plugins/qnx/blackberrydebugtokenuploader.cpp
@@ -31,8 +31,9 @@
#include "blackberrydebugtokenuploader.h"
+#include "qnxconstants.h"
+
namespace {
-static const char PROCESS_NAME[] = "blackberry-deploy";
static const char ERR_NO_ROUTE_HOST[] = "Cannot connect";
static const char ERR_AUTH_FAILED[] = "Authentication failed";
static const char ERR_DEVELOPMENT_MODE_DISABLED[] = "Device is not in the Development Mode";
@@ -42,7 +43,7 @@ namespace Qnx {
namespace Internal {
BlackBerryDebugTokenUploader::BlackBerryDebugTokenUploader(QObject *parent) :
- BlackBerryNdkProcess(QLatin1String(PROCESS_NAME), parent)
+ BlackBerryNdkProcess(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD), parent)
{
addErrorStringMapping(QLatin1String(ERR_NO_ROUTE_HOST), NoRouteToHost);
addErrorStringMapping(QLatin1String(ERR_AUTH_FAILED), AuthenticationFailed);
diff --git a/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp b/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp
index a5b82008af..f8382b2b6c 100644
--- a/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp
+++ b/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp
@@ -32,6 +32,7 @@
#include "blackberrydeployconfigurationfactory.h"
#include "qnxconstants.h"
+#include "blackberrycheckdevmodestep.h"
#include "blackberrydeployconfiguration.h"
#include "blackberrycreatepackagestep.h"
#include "blackberrydeploystep.h"
@@ -92,8 +93,9 @@ ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::crea
return 0;
BlackBerryDeployConfiguration *dc = new BlackBerryDeployConfiguration(parent);
- dc->stepList()->insertStep(0, new BlackBerryCreatePackageStep(dc->stepList()));
- dc->stepList()->insertStep(1, new BlackBerryDeployStep(dc->stepList()));
+ dc->stepList()->insertStep(0, new BlackBerryCheckDevModeStep(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/blackberrydeploystep.cpp b/src/plugins/qnx/blackberrydeploystep.cpp
index 2086185fb3..ebb001ca4d 100644
--- a/src/plugins/qnx/blackberrydeploystep.cpp
+++ b/src/plugins/qnx/blackberrydeploystep.cpp
@@ -49,8 +49,6 @@ using namespace Qnx;
using namespace Qnx::Internal;
namespace {
-const char DEPLOY_CMD[] = "blackberry-deploy";
-
int parseProgress(const QString &line)
{
const QString startOfLine = QLatin1String("Info: Progress ");
@@ -90,10 +88,10 @@ bool BlackBerryDeployStep::init()
if (!BlackBerryAbstractDeployStep::init())
return false;
- QString deployCmd = target()->activeBuildConfiguration()->environment().searchInPath(QLatin1String(DEPLOY_CMD));
+ QString deployCmd = target()->activeBuildConfiguration()->environment().searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD));
if (deployCmd.isEmpty()) {
raiseError(tr("Could not find deploy command '%1' in the build environment")
- .arg(QLatin1String(DEPLOY_CMD)));
+ .arg(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD)));
return false;
}
@@ -189,10 +187,3 @@ QString BlackBerryDeployStep::password() const
return device->sshParameters().password;
return QString();
}
-
-void BlackBerryDeployStep::raiseError(const QString &errorMessage)
-{
- emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
- emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
- Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
-}
diff --git a/src/plugins/qnx/blackberrydeploystep.h b/src/plugins/qnx/blackberrydeploystep.h
index 358f88f432..732f6c73c2 100644
--- a/src/plugins/qnx/blackberrydeploystep.h
+++ b/src/plugins/qnx/blackberrydeploystep.h
@@ -58,8 +58,6 @@ protected:
void stdOutput(const QString &line);
void processStarted(const ProjectExplorer::ProcessParameters &params);
- void raiseError(const QString &errorMessage);
-
private:
QString deviceHost() const;
QString password() const;
diff --git a/src/plugins/qnx/qnx.pro b/src/plugins/qnx/qnx.pro
index 9509995881..ad6dff7435 100644
--- a/src/plugins/qnx/qnx.pro
+++ b/src/plugins/qnx/qnx.pro
@@ -74,7 +74,10 @@ SOURCES += qnxplugin.cpp \
blackberrydebugtokenuploader.cpp \
blackberrydebugtokenreader.cpp \
blackberryndkprocess.cpp \
- blackberrydeviceprocesssupport.cpp
+ blackberrydeviceprocesssupport.cpp \
+ blackberrycheckdevmodestepfactory.cpp \
+ blackberrycheckdevmodestep.cpp \
+ blackberrycheckdevmodestepconfigwidget.cpp
HEADERS += qnxplugin.h\
qnxconstants.h \
@@ -145,7 +148,10 @@ HEADERS += qnxplugin.h\
blackberrydebugtokenuploader.h \
blackberrydebugtokenreader.h \
blackberryndkprocess.h \
- blackberrydeviceprocesssupport.h
+ blackberrydeviceprocesssupport.h \
+ blackberrycheckdevmodestepfactory.h \
+ blackberrycheckdevmodestep.h \
+ blackberrycheckdevmodestepconfigwidget.h
FORMS += \
blackberrydeviceconfigurationwizardsetuppage.ui \
diff --git a/src/plugins/qnx/qnx.qbs b/src/plugins/qnx/qnx.qbs
index 41f699c2e5..5c41359e97 100644
--- a/src/plugins/qnx/qnx.qbs
+++ b/src/plugins/qnx/qnx.qbs
@@ -37,6 +37,12 @@ QtcPlugin {
"blackberryabstractdeploystep.h",
"blackberryapplicationrunner.cpp",
"blackberryapplicationrunner.h",
+ "blackberrycheckdevmodestep.cpp",
+ "blackberrycheckdevmodestep.h",
+ "blackberrycheckdevmodestepconfigwidget.cpp",
+ "blackberrycheckdevmodestepconfigwidget.h",
+ "blackberrycheckdevmodestepfactory.cpp",
+ "blackberrycheckdevmodestepfactory.h",
"blackberryconnect.cpp",
"blackberryconnect.h",
"blackberrycreatepackagestep.cpp",
diff --git a/src/plugins/qnx/qnxconstants.h b/src/plugins/qnx/qnxconstants.h
index 54c4dba4d5..76c5713ed7 100644
--- a/src/plugins/qnx/qnxconstants.h
+++ b/src/plugins/qnx/qnxconstants.h
@@ -69,6 +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_PROFILEPATH_KEY[] = "Qt4ProjectManager.QnxRunConfiguration.ProFilePath";
@@ -103,6 +104,9 @@ const char QNX_TASK_CATEGORY_BARDESCRIPTOR[] = "Task.Category.BarDescriptor";
const char QNX_KEY_AUTHOR[] = "author";
const char QNX_KEY_PATH[] = "path";
const char QNX_KEY_ACTIVE[] = "active";
+
+const char QNX_BLACKBERRY_DEPLOY_CMD[] = "blackberry-deploy";
+
} // namespace Constants
} // namespace Qnx
diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp
index 02f2d456ce..71df9e7982 100644
--- a/src/plugins/qnx/qnxplugin.cpp
+++ b/src/plugins/qnx/qnxplugin.cpp
@@ -49,6 +49,7 @@
#include "bardescriptoreditorfactory.h"
#include "bardescriptormagicmatcher.h"
#include "blackberrykeyspage.h"
+#include "blackberrycheckdevmodestepfactory.h"
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
@@ -80,6 +81,7 @@ bool QNXPlugin::initialize(const QStringList &arguments, QString *errorString)
addAutoReleasedObject(new BlackBerryRunControlFactory);
addAutoReleasedObject(new BlackBerryNDKSettingsPage);
addAutoReleasedObject(new BlackBerryKeysPage);
+ addAutoReleasedObject(new BlackBerryCheckDevModeStepFactory);
// Handles QNX
addAutoReleasedObject(new QnxQtVersionFactory);