2009-03-10 14:20:07 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2011-01-11 16:28:15 +01:00
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
2011-11-02 15:59:12 +01:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** 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.
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-11-02 15:59:12 +01:00
|
|
|
** Nokia at qt-info@nokia.com.
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2009-03-18 15:58:36 +01:00
|
|
|
#ifndef GENERICMAKESTEP_H
|
|
|
|
|
#define GENERICMAKESTEP_H
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2009-12-09 13:54:46 +01:00
|
|
|
#include <projectexplorer/abstractprocessstep.h>
|
2009-03-10 14:20:07 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QListWidgetItem;
|
2009-03-19 11:35:25 +01:00
|
|
|
QT_END_NAMESPACE
|
2009-03-18 15:58:36 +01:00
|
|
|
|
2009-03-10 14:20:07 +01:00
|
|
|
namespace GenericProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2009-11-26 14:43:27 +01:00
|
|
|
class GenericBuildConfiguration;
|
2009-10-15 19:06:51 +02:00
|
|
|
class GenericMakeStepConfigWidget;
|
2010-01-14 17:41:29 +01:00
|
|
|
class GenericMakeStepFactory;
|
2011-11-24 13:00:01 +01:00
|
|
|
namespace Ui { class GenericMakeStep; }
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2009-12-09 13:54:46 +01:00
|
|
|
class GenericMakeStep : public ProjectExplorer::AbstractProcessStep
|
2009-03-10 14:20:07 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-11-24 13:00:01 +01:00
|
|
|
|
2009-10-15 19:06:51 +02:00
|
|
|
friend class GenericMakeStepConfigWidget; // TODO remove again?
|
2010-01-14 17:41:29 +01:00
|
|
|
friend class GenericMakeStepFactory;
|
|
|
|
|
|
2009-03-10 14:20:07 +01:00
|
|
|
public:
|
2010-07-16 14:00:41 +02:00
|
|
|
GenericMakeStep(ProjectExplorer::BuildStepList *parent);
|
2010-01-14 17:41:29 +01:00
|
|
|
virtual ~GenericMakeStep();
|
|
|
|
|
|
2009-11-26 14:43:27 +01:00
|
|
|
GenericBuildConfiguration *genericBuildConfiguration() const;
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
virtual bool init();
|
2009-03-10 14:20:07 +01:00
|
|
|
|
|
|
|
|
virtual void run(QFutureInterface<bool> &fi);
|
|
|
|
|
|
|
|
|
|
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
|
|
|
|
virtual bool immutable() const;
|
2009-10-27 14:16:28 +01:00
|
|
|
bool buildsTarget(const QString &target) const;
|
|
|
|
|
void setBuildTarget(const QString &target, bool on);
|
2010-11-12 17:23:55 +01:00
|
|
|
QString allArguments() const;
|
2009-10-27 14:16:28 +01:00
|
|
|
QString makeCommand() const;
|
2009-10-15 19:06:51 +02:00
|
|
|
|
2011-11-08 19:28:05 +01:00
|
|
|
void setClean(bool clean);
|
|
|
|
|
bool isClean() const;
|
|
|
|
|
|
2010-01-14 17:41:29 +01:00
|
|
|
QVariantMap toMap() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
2010-07-16 14:00:41 +02:00
|
|
|
GenericMakeStep(ProjectExplorer::BuildStepList *parent, GenericMakeStep *bs);
|
|
|
|
|
GenericMakeStep(ProjectExplorer::BuildStepList *parent, const QString &id);
|
2010-01-14 17:41:29 +01:00
|
|
|
virtual bool fromMap(const QVariantMap &map);
|
|
|
|
|
|
2009-03-10 14:20:07 +01:00
|
|
|
private:
|
2010-01-14 17:41:29 +01:00
|
|
|
void ctor();
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
QStringList m_buildTargets;
|
2010-10-19 11:14:03 +02:00
|
|
|
QString m_makeArguments;
|
2009-10-27 14:16:28 +01:00
|
|
|
QString m_makeCommand;
|
2011-11-08 19:28:05 +01:00
|
|
|
bool m_clean;
|
2009-03-10 14:20:07 +01:00
|
|
|
};
|
|
|
|
|
|
2009-03-18 13:33:00 +01:00
|
|
|
class GenericMakeStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
|
2009-03-10 14:20:07 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2009-03-18 13:33:00 +01:00
|
|
|
GenericMakeStepConfigWidget(GenericMakeStep *makeStep);
|
2009-03-10 14:20:07 +01:00
|
|
|
virtual QString displayName() const;
|
2009-08-06 15:31:32 +02:00
|
|
|
virtual QString summaryText() const;
|
2009-03-10 14:20:07 +01:00
|
|
|
private slots:
|
|
|
|
|
void itemChanged(QListWidgetItem*);
|
2009-03-18 15:58:36 +01:00
|
|
|
void makeLineEditTextEdited();
|
|
|
|
|
void makeArgumentsLineEditTextEdited();
|
2009-08-12 17:02:28 +02:00
|
|
|
void updateMakeOverrrideLabel();
|
2009-08-06 18:31:46 +02:00
|
|
|
void updateDetails();
|
2009-08-17 18:19:16 +02:00
|
|
|
private:
|
2009-03-18 15:58:36 +01:00
|
|
|
Ui::GenericMakeStep *m_ui;
|
2009-03-18 13:33:00 +01:00
|
|
|
GenericMakeStep *m_makeStep;
|
2009-08-06 18:31:46 +02:00
|
|
|
QString m_summaryText;
|
2009-03-10 14:20:07 +01:00
|
|
|
};
|
|
|
|
|
|
2009-03-18 13:33:00 +01:00
|
|
|
class GenericMakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
2009-03-10 14:20:07 +01:00
|
|
|
{
|
2010-01-14 17:41:29 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit GenericMakeStepFactory(QObject *parent = 0);
|
|
|
|
|
virtual ~GenericMakeStepFactory();
|
|
|
|
|
|
2010-07-16 14:00:41 +02:00
|
|
|
virtual bool canCreate(ProjectExplorer::BuildStepList *parent,
|
2010-03-16 14:36:59 +01:00
|
|
|
const QString &id) const;
|
2010-07-16 14:00:41 +02:00
|
|
|
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent,
|
2010-01-14 17:41:29 +01:00
|
|
|
const QString &id);
|
2010-07-16 14:00:41 +02:00
|
|
|
virtual bool canClone(ProjectExplorer::BuildStepList *parent,
|
2010-01-14 17:41:29 +01:00
|
|
|
ProjectExplorer::BuildStep *source) const;
|
2010-07-16 14:00:41 +02:00
|
|
|
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
|
2010-01-14 17:41:29 +01:00
|
|
|
ProjectExplorer::BuildStep *source);
|
2010-07-16 14:00:41 +02:00
|
|
|
virtual bool canRestore(ProjectExplorer::BuildStepList *parent,
|
2010-01-14 17:41:29 +01:00
|
|
|
const QVariantMap &map) const;
|
2010-07-16 14:00:41 +02:00
|
|
|
virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
|
2010-01-14 17:41:29 +01:00
|
|
|
const QVariantMap &map);
|
|
|
|
|
|
2010-07-16 14:00:41 +02:00
|
|
|
virtual QStringList availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
2010-01-07 18:17:24 +01:00
|
|
|
virtual QString displayNameForId(const QString &id) const;
|
2009-03-10 14:20:07 +01:00
|
|
|
};
|
|
|
|
|
|
2009-03-18 12:18:59 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace GenericProjectManager
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2009-03-18 15:58:36 +01:00
|
|
|
#endif // GENERICMAKESTEP_H
|