1
/**************************************************************************
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
7
** This file is part of Qt Creator.
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.
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.
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.
29
****************************************************************************/
31
#ifndef ANDROIDDEPLOYQTSTEP_H
32
#define ANDROIDDEPLOYQTSTEP_H
34
#include "androidconfigurations.h"
36
#include <projectexplorer/abstractprocessstep.h>
37
#include <qtsupport/baseqtversion.h>
40
class QAbstractItemModel;
46
class AndroidDeployQtStepFactory : public ProjectExplorer::IBuildStepFactory
50
explicit AndroidDeployQtStepFactory(QObject *parent = 0);
52
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
53
QString displayNameForId(const Core::Id id) const;
55
bool canCreate(ProjectExplorer::BuildStepList *parent,
56
const Core::Id id) const;
57
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
59
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
60
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
62
bool canClone(ProjectExplorer::BuildStepList *parent,
63
ProjectExplorer::BuildStep *product) const;
64
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
65
ProjectExplorer::BuildStep *product);
68
class AndroidDeployQtStep : public ProjectExplorer::AbstractProcessStep
71
friend class AndroidDeployQtStepFactory;
73
AndroidDeployQtStep(ProjectExplorer::BuildStepList *bc);
75
enum AndroidDeployQtAction
77
MinistroDeployment, // use ministro
79
BundleLibrariesDeployment
82
bool fromMap(const QVariantMap &map);
83
QVariantMap toMap() const;
85
AndroidDeployQtStep::AndroidDeployQtAction deployAction() const;
86
QString deviceSerialNumber();
88
void setBuildTargetSdk(const QString &sdk);
89
QString buildTargetSdk() const;
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);
98
QAbstractItemModel *keystoreCertificates();
99
bool signPackage() const;
100
void setSignPackage(bool b);
102
bool openPackageLocation() const;
103
void setOpenPackageLocation(bool open);
104
bool verboseOutput() const;
105
void setVerboseOutput(bool verbose);
107
QString inputFile() const;
108
void setInputFile(const QString &file);
111
// also on purpose emitted if the possible values of this changed
112
void inputFileChanged();
115
void setDeployAction(AndroidDeployQtAction deploy); // slot?
118
void showInGraphicalShell();
120
void updateInputFile();
122
AndroidDeployQtStep(ProjectExplorer::BuildStepList *bc,
123
AndroidDeployQtStep *other);
125
bool keystorePassword();
126
bool certificatePassword();
127
void runCommand(const QString &program, const QStringList &arguments);
130
void run(QFutureInterface<bool> &fi);
131
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
132
bool immutable() const { return true; }
133
void processFinished(int exitCode, QProcess::ExitStatus status);
135
QString m_buildTargetSdk;
136
QString m_serialNumber;
137
AndroidDeployQtAction m_deployAction;
140
bool m_openPackageLocation;
141
bool m_openPackageLocationForRun;
142
QString m_buildDirectory;
144
Utils::FileName m_keystorePath;
145
QString m_keystorePasswd;
146
QString m_certificateAlias;
147
QString m_certificatePasswd;
150
QString m_targetArch;
152
int m_deviceAPILevel;
154
static const Core::Id Id;
160
#endif // ANDROIDDEPLOYQTSTEP_H