androiddeploystep.cpp 18.8 KB
Newer Older
BogDan Vatra's avatar
BogDan Vatra committed
1 2
/**************************************************************************
**
3
** Copyright (c) 2013 BogDan Vatra <bog_dan_ro@yahoo.com>
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
BogDan Vatra's avatar
BogDan Vatra committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
BogDan Vatra's avatar
BogDan Vatra committed
7
**
hjk's avatar
hjk committed
8 9 10 11 12 13 14
** 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.
BogDan Vatra's avatar
BogDan Vatra committed
15 16
**
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17 18 19 20 21 22 23 24 25
** 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
BogDan Vatra's avatar
BogDan Vatra committed
26 27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
28
****************************************************************************/
BogDan Vatra's avatar
BogDan Vatra committed
29 30 31 32 33 34 35 36

#include "androiddeploystep.h"

#include "androidconstants.h"
#include "androiddeploystepwidget.h"
#include "androidglobal.h"
#include "androidpackagecreationstep.h"
#include "androidrunconfiguration.h"
Tobias Hunger's avatar
Tobias Hunger committed
37
#include "androidmanager.h"
38
#include "androidtoolchain.h"
BogDan Vatra's avatar
BogDan Vatra committed
39

40
#include <coreplugin/messagemanager.h>
BogDan Vatra's avatar
BogDan Vatra committed
41 42 43
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
Tobias Hunger's avatar
Tobias Hunger committed
44
#include <qt4projectmanager/qt4buildconfiguration.h>
BogDan Vatra's avatar
BogDan Vatra committed
45 46 47
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>

Tobias Hunger's avatar
Tobias Hunger committed
48
#include <qtsupport/qtkitinformation.h>
BogDan Vatra's avatar
BogDan Vatra committed
49 50 51 52 53 54 55 56 57 58 59

#include <QDir>

#define ASSERT_STATE(state) ASSERT_STATE_GENERIC(State, state, m_state)

using namespace ProjectExplorer;
using namespace Qt4ProjectManager;

namespace Android {
namespace Internal {

60
static const char USE_LOCAL_QT_KEY[] = "Qt4ProjectManager.AndroidDeployStep.UseLocalQtLibs";
61
static const char DEPLOY_ACTION_KEY[] = "Qt4ProjectManager.AndroidDeployStep.DeployAction";
62

63
const Core::Id AndroidDeployStep::Id("Qt4ProjectManager.AndroidDeployStep");
BogDan Vatra's avatar
BogDan Vatra committed
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

AndroidDeployStep::AndroidDeployStep(ProjectExplorer::BuildStepList *parent)
    : BuildStep(parent, Id)
{
    ctor();
}

AndroidDeployStep::AndroidDeployStep(ProjectExplorer::BuildStepList *parent,
    AndroidDeployStep *other)
    : BuildStep(parent, other)
{
    ctor();
}

AndroidDeployStep::~AndroidDeployStep() { }

void AndroidDeployStep::ctor()
{
    //: AndroidDeployStep default display name
    setDefaultDisplayName(tr("Deploy to Android device"));
    m_deployAction = NoDeploy;
    m_useLocalQtLibs = false;
}

bool AndroidDeployStep::init()
{
Tobias Hunger's avatar
Tobias Hunger committed
90 91
    m_packageName = AndroidManager::packageName(target());
    const QString targetSDK = AndroidManager::targetSDK(target());
BogDan Vatra's avatar
BogDan Vatra committed
92 93 94 95 96 97 98 99 100 101

    writeOutput(tr("Please wait, searching for a suitable device for target:%1.").arg(targetSDK));
    m_deviceAPILevel = targetSDK.mid(targetSDK.indexOf(QLatin1Char('-')) + 1).toInt();
    m_deviceSerialNumber = AndroidConfigurations::instance().getDeployDeviceSerialNumber(&m_deviceAPILevel);
    if (!m_deviceSerialNumber.length()) {
        m_deviceSerialNumber.clear();
        raiseError(tr("Cannot deploy: no devices or emulators found for your package."));
        return false;
    }

Tobias Hunger's avatar
Tobias Hunger committed
102
    QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
Tobias Hunger's avatar
Tobias Hunger committed
103
    if (!version)
BogDan Vatra's avatar
BogDan Vatra committed
104
        return false;
BogDan Vatra's avatar
BogDan Vatra committed
105 106 107 108 109

    const Qt4BuildConfiguration *bc = static_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
    if (!bc)
        return false;

Tobias Hunger's avatar
Tobias Hunger committed
110
    m_qtVersionSourcePath = version->sourcePath().toString();
BogDan Vatra's avatar
BogDan Vatra committed
111
    m_qtVersionQMakeBuildConfig = bc->qmakeBuildConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
112 113 114 115
    m_androidDirPath = AndroidManager::dirPath(target());
    m_apkPathDebug = AndroidManager::apkPath(target(), AndroidManager::DebugBuild).toString();
    m_apkPathRelease = AndroidManager::apkPath(target(), AndroidManager::ReleaseBuildSigned).toString();
    m_buildDirectory = static_cast<Qt4Project *>(target()->project())->rootQt4ProjectNode()->buildDir();
BogDan Vatra's avatar
BogDan Vatra committed
116 117
    m_runQASIPackagePath = m_QASIPackagePath;
    m_runDeployAction = m_deployAction;
118 119
    ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
    if (!tc || tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)) {
Leena Miettinen's avatar
Leena Miettinen committed
120
        raiseError(tr("No Android toolchain selected."));
121 122 123
        return false;
    }
    m_ndkToolChainVersion = static_cast<AndroidToolChain *>(tc)->ndkToolChainVersion();
BogDan Vatra's avatar
BogDan Vatra committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
    return true;
}

void AndroidDeployStep::run(QFutureInterface<bool> &fi)
{
    fi.reportResult(deployPackage());
}

BuildStepConfigWidget *AndroidDeployStep::createConfigWidget()
{
    return new AndroidDeployStepWidget(this);
}

AndroidDeployStep::AndroidDeployAction AndroidDeployStep::deployAction()
{
    return m_deployAction;
}

bool AndroidDeployStep::useLocalQtLibs()
{
    return m_useLocalQtLibs;
}

147 148 149
bool AndroidDeployStep::fromMap(const QVariantMap &map)
{
    m_useLocalQtLibs = map.value(QLatin1String(USE_LOCAL_QT_KEY), false).toBool();
150 151 152
    m_deployAction = AndroidDeployAction(map.value(QLatin1String(DEPLOY_ACTION_KEY), NoDeploy).toInt());
    if (m_deployAction == InstallQASI)
        m_deployAction = NoDeploy;
153 154 155 156 157 158 159
    return ProjectExplorer::BuildStep::fromMap(map);
}

QVariantMap AndroidDeployStep::toMap() const
{
    QVariantMap map = ProjectExplorer::BuildStep::toMap();
    map.insert(QLatin1String(USE_LOCAL_QT_KEY), m_useLocalQtLibs);
160
    map.insert(QLatin1String(DEPLOY_ACTION_KEY), m_deployAction);
161 162 163
    return map;
}

164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
void AndroidDeployStep::cleanLibsOnDevice()
{
    const QString targetSDK = AndroidManager::targetSDK(target());

    int deviceAPILevel = targetSDK.mid(targetSDK.indexOf(QLatin1Char('-')) + 1).toInt();
    QString deviceSerialNumber = AndroidConfigurations::instance().getDeployDeviceSerialNumber(&deviceAPILevel);
    if (!deviceSerialNumber.length()) {
        Core::MessageManager::instance()->printToOutputPanePopup(tr("Could not run adb. No device found."));
        return;
    }
    QProcess *process = new QProcess(this);
    QStringList arguments;
    arguments << QLatin1String("-s") << deviceSerialNumber
              << QLatin1String("shell") << QLatin1String("rm") << QLatin1String("-r") << QLatin1String("/data/local/tmp/qt");
    connect(process, SIGNAL(finished(int)), this, SLOT(cleanLibsFinished()));
    const QString adb = AndroidConfigurations::instance().adbToolPath().toString();
    Core::MessageManager::instance()->printToOutputPanePopup(adb + QLatin1String(" ")
                                                             + arguments.join(QLatin1String(" ")));
    process->start(adb, arguments);
}

void AndroidDeployStep::cleanLibsFinished()
{
    QProcess *process = qobject_cast<QProcess *>(sender());
    if (!process)
        return;
    Core::MessageManager::instance()->printToOutputPanePopup(QString::fromLocal8Bit(process->readAll()));
    Core::MessageManager::instance()->printToOutputPane(tr("adb finished with exit code %1.").arg(process->exitCode()));
}

BogDan Vatra's avatar
BogDan Vatra committed
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
void AndroidDeployStep::setDeployAction(AndroidDeployStep::AndroidDeployAction deploy)
{
    m_deployAction = deploy;
}

void AndroidDeployStep::setDeployQASIPackagePath(const QString &package)
{
    m_QASIPackagePath = package;
    m_deployAction = InstallQASI;
}

void AndroidDeployStep::setUseLocalQtLibs(bool useLocal)
{
    m_useLocalQtLibs = useLocal;
}

bool AndroidDeployStep::runCommand(QProcess *buildProc,
    const QString &program, const QStringList &arguments)
{
    writeOutput(tr("Package deploy: Running command '%1 %2'.").arg(program).arg(arguments.join(QLatin1String(" "))), BuildStep::MessageOutput);
    buildProc->start(program, arguments);
    if (!buildProc->waitForStarted()) {
        writeOutput(tr("Packaging error: Could not start command '%1 %2'. Reason: %3")
            .arg(program).arg(arguments.join(QLatin1String(" "))).arg(buildProc->errorString()), BuildStep::ErrorMessageOutput);
        return false;
    }
    buildProc->waitForFinished(-1);
    if (buildProc->error() != QProcess::UnknownError
            || buildProc->exitCode() != 0) {
        QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.")
                .arg(program).arg(arguments.join(QLatin1String(" ")));
        if (buildProc->error() != QProcess::UnknownError)
            mainMessage += tr(" Reason: %1").arg(buildProc->errorString());
        else
            mainMessage += tr("Exit code: %1").arg(buildProc->exitCode());
        writeOutput(mainMessage, BuildStep::ErrorMessageOutput);
        return false;
    }
    return true;
}

void AndroidDeployStep::handleBuildOutput()
{
    QProcess *const buildProc = qobject_cast<QProcess *>(sender());
    if (!buildProc)
        return;
    emit addOutput(QString::fromLocal8Bit(buildProc->readAllStandardOutput())
                   , BuildStep::NormalOutput);
}

void AndroidDeployStep::handleBuildError()
{
    QProcess *const buildProc = qobject_cast<QProcess *>(sender());
    if (!buildProc)
        return;
    emit addOutput(QString::fromLocal8Bit(buildProc->readAllStandardError())
                   , BuildStep::ErrorOutput);
}

QString AndroidDeployStep::deviceSerialNumber()
{
    return m_deviceSerialNumber;
}

int AndroidDeployStep::deviceAPILevel()
{
    return m_deviceAPILevel;
}

Tobias Hunger's avatar
Tobias Hunger committed
263
Utils::FileName AndroidDeployStep::localLibsRulesFilePath()
BogDan Vatra's avatar
BogDan Vatra committed
264
{
265 266 267 268
    Utils::FileName fileName = AndroidManager::localLibsRulesFilePath(target());
    fileName.append(QLatin1String("/rules.xml"));

    return fileName;
BogDan Vatra's avatar
BogDan Vatra committed
269 270
}

271
unsigned int AndroidDeployStep::remoteModificationTime(const QString &fullDestination, QHash<QString, unsigned int> *cache)
BogDan Vatra's avatar
BogDan Vatra committed
272
{
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
    QString destination = QFileInfo(fullDestination).absolutePath();
    QProcess process;
    QHash<QString, unsigned int>::const_iterator it = cache->find(fullDestination);
    if (it != cache->constEnd())
        return *it;
    QStringList arguments;
    arguments << QLatin1String("-s") << m_deviceSerialNumber
              << QLatin1String("ls") << destination;
    process.start(AndroidConfigurations::instance().adbToolPath().toString(), arguments);
    process.waitForFinished(-1);
    if (process.error() != QProcess::UnknownError
            || process.exitCode() != 0)
        return -1;
    QByteArray output = process.readAll();
    output.replace("\r\n", "\n");
    QList<QByteArray> lines = output.split('\n');
    foreach (const QByteArray &line, lines) {
        // do some checks if we got what we expected..
        if (line.count() < (3 * 8 + 3))
            continue;
        if (line.at(8) != ' '
                || line.at(17) != ' '
                || line.at(26) != ' ')
            continue;
        bool ok;
        int time = line.mid(18, 8).toUInt(&ok, 16);
        if (!ok)
            continue;
        QString fileName = QString::fromLocal8Bit(line.mid(27));
        cache->insert(destination + QLatin1Char('/') + fileName, time);
    }
    it = cache->find(fullDestination);
    if (it != cache->constEnd())
        return *it;
    return 0;
}

void AndroidDeployStep::collectFiles(QList<DeployItem> *deployList, const QString &localPath, const QString &remotePath,
                  bool strip, const QStringList &filter)
{
    QDirIterator libsIt(localPath, filter, QDir::NoFilter, QDirIterator::Subdirectories);
    int pos = localPath.size();
BogDan Vatra's avatar
BogDan Vatra committed
315 316
    while (libsIt.hasNext()) {
        libsIt.next();
317 318 319 320 321
        const QString destFile(remotePath + libsIt.filePath().mid(pos));
        if (!libsIt.fileInfo().isDir()) {
            deployList->append(DeployItem(libsIt.filePath(),
                                          libsIt.fileInfo().lastModified().toTime_t(),
                                          destFile, strip));
BogDan Vatra's avatar
BogDan Vatra committed
322 323 324 325
        }
    }
}

326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
void AndroidDeployStep::fetchRemoteModificationTimes(QList<DeployItem> *deployList)
{
    QHash<QString, unsigned int> cache;
    for (int i = 0; i < deployList->count(); ++i) {
        DeployItem &item = (*deployList)[i];
        item.remoteTimeStamp
                = remoteModificationTime(item.remoteFileName, &cache);
    }
}

void AndroidDeployStep::filterModificationTimes(QList<DeployItem> *deployList)
{
    QList<DeployItem>::iterator it = deployList->begin();
    while (it != deployList->end()) {
        int index = it - deployList->begin();
        Q_UNUSED(index);
        if ((*it).localTimeStamp <= (*it).remoteTimeStamp)
            it = deployList->erase(it);
        else
            ++it;
    }
}

void AndroidDeployStep::copyFilesToTemp(QList<DeployItem> *deployList, const QString &tempDirectory, const QString &sourcePrefix)
{
    QDir dir;

    int pos = sourcePrefix.size();
    for (int i = 0; i < deployList->count(); ++i) {
        DeployItem &item = (*deployList)[i];
        if (!item.needsStrip)
            continue;
        const QString destFile(tempDirectory + item.localFileName.mid(pos));
        dir.mkpath(QFileInfo(destFile).absolutePath());
        QFile::copy(item.localFileName, destFile);
        item.localFileName = destFile;
    }
}

365
void AndroidDeployStep::stripFiles(const QList<DeployItem> &deployList, Abi::Architecture architecture, const QString &ndkToolchainVersion)
366 367 368
{
    QProcess stripProcess;
    foreach (const DeployItem &item, deployList) {
369
        stripProcess.start(AndroidConfigurations::instance().stripPath(architecture, ndkToolchainVersion).toString(),
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
                           QStringList()<<QLatin1String("--strip-unneeded") << item.localFileName);
        stripProcess.waitForStarted();
        if (!stripProcess.waitForFinished())
            stripProcess.kill();
    }
}

void AndroidDeployStep::deployFiles(QProcess *process, const QList<DeployItem> &deployList)
{
    foreach (const DeployItem &item, deployList) {
        runCommand(process, AndroidConfigurations::instance().adbToolPath().toString(),
                   QStringList() << QLatin1String("-s") << m_deviceSerialNumber
                   << QLatin1String("push") << item.localFileName
                   << item.remoteFileName);
    }
}

BogDan Vatra's avatar
BogDan Vatra committed
387 388 389 390 391 392 393 394 395
bool AndroidDeployStep::deployPackage()
{
    QProcess *const deployProc = new QProcess;
    connect(deployProc, SIGNAL(readyReadStandardOutput()), this,
        SLOT(handleBuildOutput()));
    connect(deployProc, SIGNAL(readyReadStandardError()), this,
        SLOT(handleBuildError()));

    if (m_runDeployAction == DeployLocal) {
396
        writeOutput(tr("Deploy Qt libraries. This may take some time, please wait."));
BogDan Vatra's avatar
BogDan Vatra committed
397 398
        const QString tempPath = QDir::tempPath() + QLatin1String("/android_qt_libs_") + m_packageName;
        AndroidPackageCreationStep::removeDirectory(tempPath);
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426

        const QString remoteRoot = QLatin1String("/data/local/tmp/qt");
        QList<DeployItem> deployList;
        collectFiles(&deployList,
                     m_qtVersionSourcePath + QLatin1String("/lib"),
                     remoteRoot + QLatin1String("/lib"),
                     true,
                     QStringList() << QLatin1String("*.so"));
        collectFiles(&deployList,
                     m_qtVersionSourcePath + QLatin1String("/plugins"),
                     remoteRoot + QLatin1String("/plugins"),
                     true);
        collectFiles(&deployList,
                     m_qtVersionSourcePath + QLatin1String("/imports"),
                     remoteRoot + QLatin1String("/imports"),
                     true);
        collectFiles(&deployList,
                     m_qtVersionSourcePath + QLatin1String("/qml"),
                     remoteRoot + QLatin1String("/qml"),
                     true);
        collectFiles(&deployList,
                     m_qtVersionSourcePath + QLatin1String("/jar"),
                     remoteRoot + QLatin1String("/jar"),
                     true);

        fetchRemoteModificationTimes(&deployList);
        filterModificationTimes(&deployList);
        copyFilesToTemp(&deployList, tempPath, m_qtVersionSourcePath);
427
        stripFiles(deployList, target()->activeRunConfiguration()->abi().architecture(), m_ndkToolChainVersion);
428 429
        deployFiles(deployProc, deployList);

BogDan Vatra's avatar
BogDan Vatra committed
430 431 432 433
        AndroidPackageCreationStep::removeDirectory(tempPath);
    }

    if (m_runDeployAction == InstallQASI) {
Tobias Hunger's avatar
Tobias Hunger committed
434
        if (!runCommand(deployProc, AndroidConfigurations::instance().adbToolPath().toString(),
BogDan Vatra's avatar
BogDan Vatra committed
435 436
                        QStringList() << QLatin1String("-s") << m_deviceSerialNumber
                        << QLatin1String("install") << QLatin1String("-r ") << m_runQASIPackagePath)) {
Friedemann Kleint's avatar
Friedemann Kleint committed
437
            raiseError(tr("Qt Android smart installer installation failed"));
BogDan Vatra's avatar
BogDan Vatra committed
438 439 440 441 442 443
            disconnect(deployProc, 0, this, 0);
            deployProc->deleteLater();
            return false;
        }
        emit resetDelopyAction();
    }
Tobias Hunger's avatar
Tobias Hunger committed
444
    deployProc->setWorkingDirectory(m_androidDirPath.toString());
BogDan Vatra's avatar
BogDan Vatra committed
445 446

    writeOutput(tr("Installing package onto %1.").arg(m_deviceSerialNumber));
Tobias Hunger's avatar
Tobias Hunger committed
447
    runCommand(deployProc, AndroidConfigurations::instance().adbToolPath().toString(),
BogDan Vatra's avatar
BogDan Vatra committed
448 449 450 451 452 453 454
               QStringList() << QLatin1String("-s") << m_deviceSerialNumber << QLatin1String("uninstall") << m_packageName);
    QString package = m_apkPathDebug;

    if (!(m_qtVersionQMakeBuildConfig & QtSupport::BaseQtVersion::DebugBuild)
         && QFile::exists(m_apkPathRelease))
        package = m_apkPathRelease;

Tobias Hunger's avatar
Tobias Hunger committed
455
    if (!runCommand(deployProc, AndroidConfigurations::instance().adbToolPath().toString(),
BogDan Vatra's avatar
BogDan Vatra committed
456
                    QStringList() << QLatin1String("-s") << m_deviceSerialNumber << QLatin1String("install") << package)) {
457
        raiseError(tr("Package installation failed."));
BogDan Vatra's avatar
BogDan Vatra committed
458 459 460 461 462
        disconnect(deployProc, 0, this, 0);
        deployProc->deleteLater();
        return false;
    }

463
    writeOutput(tr("Pulling files necessary for debugging."));
Tobias Hunger's avatar
Tobias Hunger committed
464
    runCommand(deployProc, AndroidConfigurations::instance().adbToolPath().toString(),
BogDan Vatra's avatar
BogDan Vatra committed
465 466 467
               QStringList() << QLatin1String("-s") << m_deviceSerialNumber
               << QLatin1String("pull") << QLatin1String("/system/bin/app_process")
               << QString::fromLatin1("%1/app_process").arg(m_buildDirectory));
Tobias Hunger's avatar
Tobias Hunger committed
468
    runCommand(deployProc, AndroidConfigurations::instance().adbToolPath().toString(),
BogDan Vatra's avatar
BogDan Vatra committed
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
               QStringList() << QLatin1String("-s") << m_deviceSerialNumber << QLatin1String("pull")
               << QLatin1String("/system/lib/libc.so")
               << QString::fromLatin1("%1/libc.so").arg(m_buildDirectory));
    disconnect(deployProc, 0, this, 0);
    deployProc->deleteLater();
    return true;
}

void AndroidDeployStep::raiseError(const QString &errorString)
{
    emit addTask(Task(Task::Error, errorString, Utils::FileName::fromString(QString()), -1,
        ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}

void AndroidDeployStep::writeOutput(const QString &text, OutputFormat format)
{
    emit addOutput(text, format);
}

} // namespace Internal
} // namespace Qt4ProjectManager