qmakeandroidbuildapkstep.h 4.03 KB
Newer Older
BogDan Vatra's avatar
BogDan Vatra committed
1
2
/**************************************************************************
**
3
** Copyright (c) 2014 BogDan Vatra <bog_dan_ro@yahoo.com>
4
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
5
** Contact: http://www.qt-project.org/legal
BogDan Vatra's avatar
BogDan Vatra committed
6
**
hjk's avatar
hjk committed
7
** This file is part of Qt Creator.
BogDan Vatra's avatar
BogDan Vatra committed
8
**
hjk's avatar
hjk committed
9
10
11
12
13
** 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 Digia.  For licensing terms and
Eike Ziller's avatar
Eike Ziller committed
14
15
** conditions see http://www.qt.io/licensing.  For further information
** use the contact form at http://www.qt.io/contact-us.
BogDan Vatra's avatar
BogDan Vatra committed
16
17
**
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
18
** Alternatively, this file may be used under the terms of the GNU Lesser
Eike Ziller's avatar
Eike Ziller committed
19
20
21
22
23
24
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file.  Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
hjk's avatar
hjk committed
25
26
27
**
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
BogDan Vatra's avatar
BogDan Vatra committed
28
29
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
30
****************************************************************************/
BogDan Vatra's avatar
BogDan Vatra committed
31

32
33
#ifndef QMAKEANDROIDBUILDAPKSTEP_H
#define QMAKEANDROIDBUILDAPKSTEP_H
hjk's avatar
hjk committed
34

35
#include <android/androidbuildapkstep.h>
BogDan Vatra's avatar
BogDan Vatra committed
36

37
namespace QmakeAndroidSupport {
BogDan Vatra's avatar
BogDan Vatra committed
38
39
namespace Internal {

40
class QmakeAndroidBuildApkStepFactory : public ProjectExplorer::IBuildStepFactory
BogDan Vatra's avatar
BogDan Vatra committed
41
42
43
{
    Q_OBJECT
public:
44
    explicit QmakeAndroidBuildApkStepFactory(QObject *parent = 0);
BogDan Vatra's avatar
BogDan Vatra committed
45

46
    QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
47
    QString displayNameForId(Core::Id id) const;
BogDan Vatra's avatar
BogDan Vatra committed
48

49
50
    bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
    ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
BogDan Vatra's avatar
BogDan Vatra committed
51

52
    bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
53
    ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
BogDan Vatra's avatar
BogDan Vatra committed
54

55
56
57
58
    bool canClone(ProjectExplorer::BuildStepList *parent,
                  ProjectExplorer::BuildStep *product) const;
    ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
                                      ProjectExplorer::BuildStep *product);
59
60
61
62
63
64
65
66
67
68
69
70
71
private:
    bool canHandle(ProjectExplorer::Target *t) const;

};

class QmakeAndroidBuildApkStep : public Android::AndroidBuildApkStep
{
    Q_OBJECT
public:
    QmakeAndroidBuildApkStep(ProjectExplorer::BuildStepList *bc);
    QString proFilePathForInputFile() const;
    void setProFilePathForInputFile(const QString &path);

72

73
74
75
76
77
78
79
80
81
82
protected:
    friend class QmakeAndroidBuildApkStepFactory;
    QmakeAndroidBuildApkStep(ProjectExplorer::BuildStepList *bc,
        QmakeAndroidBuildApkStep *other);

    Utils::FileName androidPackageSourceDir() const;

protected:
    void ctor();
    bool init();
83
    void run(QFutureInterface<bool> &fi);
84
    void processStarted();
85
86
87
88
89
90
91
92
93
94
95
96
    ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
    bool fromMap(const QVariantMap &map);
    QVariantMap toMap() const;

signals:
    // also on purpose emitted if the possible values of this changed
    void inputFileChanged();

private slots:
    void updateInputFile();

private:
97
98
99
    void setupProcessParameters(ProjectExplorer::ProcessParameters *pp,
                                ProjectExplorer::BuildConfiguration *bc,
                                const QStringList &arguments, const QString &command);
100
    QString m_proFilePathForInputFile;
101
102
    QString m_command;
    QString m_argumentsPasswordConcealed;
103
    bool m_skipBuilding;
BogDan Vatra's avatar
BogDan Vatra committed
104
105
106
};

} // namespace Internal
107
} // namespace QmakeAndroidSupport
BogDan Vatra's avatar
BogDan Vatra committed
108

109
#endif // QMAKEANDROIDBUILDAPKSTEP_H