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>
80 lines
2.6 KiB
C++
80 lines
2.6 KiB
C++
/****************************************************************************
|
|
**
|
|
** Copyright (C) 2016 Openismus GmbH.
|
|
** Author: Peter Penz (ppenz@openismus.com)
|
|
** Author: Patricia Santana Cruz (patriciasantanacruz@gmail.com)
|
|
** 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 <projectexplorer/abstractprocessstep.h>
|
|
#include <projectexplorer/projectconfigurationaspects.h>
|
|
|
|
namespace AutotoolsProjectManager {
|
|
namespace Internal {
|
|
|
|
////////////////////////////////
|
|
// AutoreconfStepFactory class
|
|
////////////////////////////////
|
|
/**
|
|
* @brief Implementation of the ProjectExplorer::IBuildStepFactory interface.
|
|
*
|
|
* The factory is used to create instances of AutoreconfStep.
|
|
*/
|
|
class AutoreconfStepFactory : public ProjectExplorer::BuildStepFactory
|
|
{
|
|
public:
|
|
AutoreconfStepFactory();
|
|
};
|
|
|
|
/////////////////////////
|
|
// AutoreconfStep class
|
|
/////////////////////////
|
|
/**
|
|
* @brief Implementation of the ProjectExplorer::AbstractProcessStep interface.
|
|
*
|
|
* A autoreconf step can be configured by selecting the "Projects" button
|
|
* of Qt Creator (in the left hand side menu) and under "Build Settings".
|
|
*
|
|
* It is possible for the user to specify custom arguments.
|
|
*/
|
|
|
|
class AutoreconfStep : public ProjectExplorer::AbstractProcessStep
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit AutoreconfStep(ProjectExplorer::BuildStepList *bsl);
|
|
|
|
bool init() override;
|
|
void doRun() override;
|
|
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
|
|
|
private:
|
|
ProjectExplorer::BaseStringAspect *m_additionalArgumentsAspect = nullptr;
|
|
bool m_runAutoreconf = false;
|
|
};
|
|
|
|
} // namespace Internal
|
|
} // namespace AutotoolsProjectManager
|