forked from qt-creator/qt-creator
Originally, the build manager used to run all build steps in a dedicated thread. Communication between the step and the manager happened via a QFutureInterface that was passed into the step's run() function. Later, new steps were added that operated asynchronously, so the build manager had to differentiate between the different kinds of steps for starting and stopping. These days, almost all build and deploy steps work asynchronously, which made the QFuture-based interface look increasingly odd. With this patch, all build steps are expected to work asynchronously, so the build manager no longer needs to differentiate. Steps are started and requested to stop via the run() and cancel() functions, respectively, and emit the finished() signal when they are done. Build step implementors no longer have to deal with a QFutureInterface. For steps whose implementation is inherently synchronous, the BuildStep base class offers a runInThread() function. Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803 Reviewed-by: hjk <hjk@qt.io>
70 lines
2.4 KiB
C++
70 lines
2.4 KiB
C++
/****************************************************************************
|
|
**
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
** Contact: https://www.qt.io/licensing/
|
|
**
|
|
** 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 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 General Public License Usage
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
** General Public License version 3 as published by the Free Software
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
** 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-3.0.html.
|
|
**
|
|
****************************************************************************/
|
|
#pragma once
|
|
|
|
#include "androidconfigurations.h"
|
|
|
|
#include <functional>
|
|
#include <memory>
|
|
|
|
namespace Android {
|
|
namespace Internal {
|
|
|
|
class AndroidToolManager;
|
|
class AvdManagerOutputParser;
|
|
|
|
class AndroidAvdManager
|
|
{
|
|
Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidAvdManager)
|
|
|
|
public:
|
|
AndroidAvdManager(const AndroidConfig& config = AndroidConfigurations::currentConfig());
|
|
~AndroidAvdManager();
|
|
|
|
void launchAvdManagerUiTool() const;
|
|
QFuture<CreateAvdInfo> createAvd(CreateAvdInfo info) const;
|
|
bool removeAvd(const QString &name) const;
|
|
QFuture<AndroidDeviceInfoList> avdList() const;
|
|
|
|
QString startAvd(const QString &name) const;
|
|
bool startAvdAsync(const QString &avdName) const;
|
|
QString findAvd(const QString &avdName) const;
|
|
QString waitForAvd(const QString &avdName,
|
|
const std::function<bool()> &cancelChecker = {}) const;
|
|
bool isAvdBooted(const QString &device) const;
|
|
|
|
private:
|
|
bool waitForBooted(const QString &serialNumber,
|
|
const std::function<bool()> &cancelChecker) const;
|
|
|
|
private:
|
|
const AndroidConfig &m_config;
|
|
std::unique_ptr<AndroidToolManager> m_androidTool;
|
|
std::unique_ptr<AvdManagerOutputParser> m_parser;
|
|
};
|
|
|
|
} // namespace Internal
|
|
} // namespace Android
|