1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
36 #include <projectexplorer/abstractprocessstep.h>
37 #include <projectexplorer/buildstep.h>
38 #include <projectexplorer/task.h>
46 namespace ProjectExplorer {
49 class IBuildStepFactory;
53 namespace Qt4ProjectManager {
54 class Qt4BuildConfiguration;
58 class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
63 explicit MakeStepFactory(QObject *parent = 0);
64 virtual ~MakeStepFactory();
66 bool canCreate(ProjectExplorer::BuildStepList *parent, const QString &id) const;
67 ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const QString &id);
68 bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
69 ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
70 bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
71 ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
73 QStringList availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
74 QString displayNameForId(const QString &id) const;
76 } //namespace Internal
80 class MakeStep : public ProjectExplorer::AbstractProcessStep
83 friend class Internal::MakeStepFactory;
84 friend class MakeStepConfigWidget; // TODO remove this
85 // used to access internal stuff
88 explicit MakeStep(ProjectExplorer::BuildStepList *bsl);
91 Qt4BuildConfiguration *qt4BuildConfiguration() const;
94 virtual void run(QFutureInterface<bool> &);
95 bool processSucceeded(int exitCode, QProcess::ExitStatus status);
97 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
98 virtual bool immutable() const;
99 QString userArguments();
100 void setUserArguments(const QString &arguments);
101 void setClean(bool clean);
102 bool isClean() const;
104 QVariantMap toMap() const;
107 void userArgumentsChanged();
110 MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
111 MakeStep(ProjectExplorer::BuildStepList *bsl, const QString &id);
112 virtual bool fromMap(const QVariantMap &map);
117 QString m_makeFileToCheck;
120 QList<ProjectExplorer::Task> m_tasks;
123 class MakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
127 explicit MakeStepConfigWidget(MakeStep *makeStep);
128 virtual ~MakeStepConfigWidget();
130 QString displayName() const;
132 QString summaryText() const;
134 // User changes to our widgets
136 void makeArgumentsLineEdited();
138 void updateMakeOverrideLabel();
139 void updateDetails();
140 void userArgumentsChanged();
141 void qtVersionChanged();
144 MakeStep *m_makeStep;
145 QString m_summaryText;
149 } // Qt4ProjectManager