~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/android/androiddeployqtstep.h

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************
 
2
**
 
3
** Copyright (c) 2013 BogDan Vatra <bog_dan_ro@yahoo.com>
 
4
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 
5
** Contact: http://www.qt-project.org/legal
 
6
**
 
7
** This file is part of Qt Creator.
 
8
**
 
9
** Commercial License Usage
 
10
** Licensees holding valid commercial Qt licenses may use this file in
 
11
** accordance with the commercial license agreement provided with the
 
12
** Software or, alternatively, in accordance with the terms contained in
 
13
** a written agreement between you and Digia.  For licensing terms and
 
14
** conditions see http://qt.digia.com/licensing.  For further information
 
15
** use the contact form at http://qt.digia.com/contact-us.
 
16
**
 
17
** GNU Lesser General Public License Usage
 
18
** Alternatively, this file may be used under the terms of the GNU Lesser
 
19
** General Public License version 2.1 as published by the Free Software
 
20
** Foundation and appearing in the file LICENSE.LGPL included in the
 
21
** packaging of this file.  Please review the following information to
 
22
** ensure the GNU Lesser General Public License version 2.1 requirements
 
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 
24
**
 
25
** In addition, as a special exception, Digia gives you certain additional
 
26
** rights.  These rights are described in the Digia Qt LGPL Exception
 
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 
28
**
 
29
****************************************************************************/
 
30
 
 
31
#ifndef ANDROIDDEPLOYQTSTEP_H
 
32
#define ANDROIDDEPLOYQTSTEP_H
 
33
 
 
34
#include "androidconfigurations.h"
 
35
 
 
36
#include <projectexplorer/abstractprocessstep.h>
 
37
#include <qtsupport/baseqtversion.h>
 
38
 
 
39
QT_BEGIN_NAMESPACE
 
40
class QAbstractItemModel;
 
41
QT_END_NAMESPACE
 
42
 
 
43
namespace Android {
 
44
namespace Internal {
 
45
 
 
46
class AndroidDeployQtStepFactory : public ProjectExplorer::IBuildStepFactory
 
47
{
 
48
    Q_OBJECT
 
49
public:
 
50
    explicit AndroidDeployQtStepFactory(QObject *parent = 0);
 
51
 
 
52
    QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
 
53
    QString displayNameForId(const Core::Id id) const;
 
54
 
 
55
    bool canCreate(ProjectExplorer::BuildStepList *parent,
 
56
                   const Core::Id id) const;
 
57
    ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
 
58
 
 
59
    bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
 
60
    ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
 
61
 
 
62
    bool canClone(ProjectExplorer::BuildStepList *parent,
 
63
                  ProjectExplorer::BuildStep *product) const;
 
64
    ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
 
65
                                      ProjectExplorer::BuildStep *product);
 
66
};
 
67
 
 
68
class AndroidDeployQtStep : public ProjectExplorer::AbstractProcessStep
 
69
{
 
70
    Q_OBJECT
 
71
    friend class AndroidDeployQtStepFactory;
 
72
public:
 
73
    AndroidDeployQtStep(ProjectExplorer::BuildStepList *bc);
 
74
 
 
75
    enum AndroidDeployQtAction
 
76
    {
 
77
        MinistroDeployment, // use ministro
 
78
        DebugDeployment,
 
79
        BundleLibrariesDeployment
 
80
    };
 
81
 
 
82
    bool fromMap(const QVariantMap &map);
 
83
    QVariantMap toMap() const;
 
84
 
 
85
    AndroidDeployQtStep::AndroidDeployQtAction deployAction() const;
 
86
    QString deviceSerialNumber();
 
87
 
 
88
    void setBuildTargetSdk(const QString &sdk);
 
89
    QString buildTargetSdk() const;
 
90
 
 
91
    // signing
 
92
    Utils::FileName keystorePath();
 
93
    void setKeystorePath(const Utils::FileName &path);
 
94
    void setKeystorePassword(const QString &pwd);
 
95
    void setCertificateAlias(const QString &alias);
 
96
    void setCertificatePassword(const QString &pwd);
 
97
 
 
98
    QAbstractItemModel *keystoreCertificates();
 
99
    bool signPackage() const;
 
100
    void setSignPackage(bool b);
 
101
 
 
102
    bool openPackageLocation() const;
 
103
    void setOpenPackageLocation(bool open);
 
104
    bool verboseOutput() const;
 
105
    void setVerboseOutput(bool verbose);
 
106
 
 
107
    QString inputFile() const;
 
108
    void setInputFile(const QString &file);
 
109
 
 
110
signals:
 
111
    // also on purpose emitted if the possible values of this changed
 
112
    void inputFileChanged();
 
113
 
 
114
public slots:
 
115
    void setDeployAction(AndroidDeployQtAction deploy); // slot?
 
116
 
 
117
private slots:
 
118
    void showInGraphicalShell();
 
119
 
 
120
    void updateInputFile();
 
121
private:
 
122
    AndroidDeployQtStep(ProjectExplorer::BuildStepList *bc,
 
123
        AndroidDeployQtStep *other);
 
124
    void ctor();
 
125
    bool keystorePassword();
 
126
    bool certificatePassword();
 
127
    void runCommand(const QString &program, const QStringList &arguments);
 
128
 
 
129
    bool init();
 
130
    void run(QFutureInterface<bool> &fi);
 
131
    ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
 
132
    bool immutable() const { return true; }
 
133
    void processFinished(int exitCode, QProcess::ExitStatus status);
 
134
 
 
135
    QString m_buildTargetSdk;
 
136
    QString m_serialNumber;
 
137
    AndroidDeployQtAction m_deployAction;
 
138
    bool m_signPackage;
 
139
    bool m_verbose;
 
140
    bool m_openPackageLocation;
 
141
    bool m_openPackageLocationForRun;
 
142
    QString m_buildDirectory;
 
143
 
 
144
    Utils::FileName m_keystorePath;
 
145
    QString m_keystorePasswd;
 
146
    QString m_certificateAlias;
 
147
    QString m_certificatePasswd;
 
148
    QString m_avdName;
 
149
    QString m_apkPath;
 
150
    QString m_targetArch;
 
151
    QString m_inputFile;
 
152
    int m_deviceAPILevel;
 
153
 
 
154
    static const Core::Id Id;
 
155
};
 
156
 
 
157
}
 
158
}
 
159
 
 
160
#endif // ANDROIDDEPLOYQTSTEP_H