maemopackagecreationstep.h 3.62 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of Qt Creator.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** 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, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

#ifndef MAEMOPACKAGECREATIONSTEP_H
#define MAEMOPACKAGECREATIONSTEP_H

#include <projectexplorer/buildstep.h>

47
#include <QtCore/QScopedPointer>
48

ck's avatar
ck committed
49
QT_BEGIN_NAMESPACE
50
class QFile;
ck's avatar
ck committed
51
52
53
class QProcess;
QT_END_NAMESPACE

54
55
56
namespace Qt4ProjectManager {
namespace Internal {

57
class MaemoDeployStep;
ck's avatar
ck committed
58
class MaemoToolChain;
ck's avatar
ck committed
59
class MaemoProFileWrapper;
ck's avatar
ck committed
60
61
class Qt4BuildConfiguration;

62
63
class MaemoPackageCreationStep : public ProjectExplorer::BuildStep
{
64
    Q_OBJECT
65
66
67
    friend class MaemoPackageCreationFactory;
public:
    MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig);
68
    ~MaemoPackageCreationStep();
69

70
    QString packageFilePath() const;
71

ck's avatar
ck committed
72
73
74
    bool isPackagingEnabled() const { return m_packagingEnabled; }
    void setPackagingEnabled(bool enabled) { m_packagingEnabled = enabled; }

75
76
77
    QString versionString() const;
    void setVersionString(const QString &version);

ck's avatar
ck committed
78
79
80
signals:
    void packageFilePathChanged();

81
82
83
private slots:
    void handleBuildOutput();

84
85
86
87
private:
    MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig,
                             MaemoPackageCreationStep *other);

ck's avatar
ck committed
88
    void ctor();
89
90
91
92
    virtual bool init();
    virtual void run(QFutureInterface<bool> &fi);
    virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
    virtual bool immutable() const { return true; }
ck's avatar
ck committed
93
94
    virtual QVariantMap toMap() const;
    virtual bool fromMap(const QVariantMap &map);
95

ck's avatar
ck committed
96
    bool createPackage();
97
    bool runCommand(const QString &command);
ck's avatar
ck committed
98
99
    QString maddeRoot() const;
    QString targetRoot() const;
100
    QString nativePath(const QFile &file) const;
ck's avatar
ck committed
101
    bool packagingNeeded() const;
102
103
    void raiseError(const QString &shortMsg,
                    const QString &detailedMsg = QString());
104
    QString buildDirectory() const;
ck's avatar
ck committed
105
    QString projectName() const;
106
107
108
    const Qt4BuildConfiguration *qt4BuildConfiguration() const;
    const MaemoToolChain *maemoToolChain() const;
    MaemoDeployStep * deployStep() const;
109

110
    static const QLatin1String CreatePackageId;
111

ck's avatar
ck committed
112
    bool m_packagingEnabled;
113
    QString m_versionString;
114
    QScopedPointer<QProcess> m_buildProc;
115
116
117
118
119
120
};

} // namespace Internal
} // namespace Qt4ProjectManager

#endif // MAEMOPACKAGECREATIONSTEP_H