Commit dc40099d authored by Daniel Teske's avatar Daniel Teske

Android: Make local deployment smart

On deploying, first check the timestamps of the files on the device,
and then only copy+strip+deploy the files that are newer.
Add a button for cleaning /data/local/tmp/qt as that is no longer
done on each deployment.

Task-number: QTCREATORBUG-8538
Change-Id: I93c4e6266d7d748b0a4735e00806282315227d4b
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 259145f0
This diff is collapsed.
......@@ -47,6 +47,26 @@ namespace Internal {
class AndroidDeviceConfigListModel;
class AndroidPackageCreationStep;
class DeployItem
{
public:
DeployItem(const QString &_localFileName,
unsigned int _localTimeStamp,
const QString &_remoteFileName,
bool _needsStrip)
: localFileName(_localFileName),
remoteFileName(_remoteFileName),
localTimeStamp(_localTimeStamp),
remoteTimeStamp(0),
needsStrip(_needsStrip)
{}
QString localFileName;
QString remoteFileName;
unsigned int localTimeStamp;
unsigned int remoteTimeStamp;
bool needsStrip;
};
class AndroidDeployStep : public ProjectExplorer::BuildStep
{
Q_OBJECT
......@@ -75,6 +95,8 @@ public:
bool fromMap(const QVariantMap &map);
QVariantMap toMap() const;
void cleanLibsOnDevice();
public slots:
void setDeployAction(AndroidDeployAction deploy);
void setDeployQASIPackagePath(const QString &package);
......@@ -89,6 +111,7 @@ private slots:
bool deployPackage();
void handleBuildOutput();
void handleBuildError();
void cleanLibsFinished();
private:
AndroidDeployStep(ProjectExplorer::BuildStepList *bc,
......@@ -98,11 +121,19 @@ private:
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
virtual bool immutable() const { return true; }
void copyLibs(const QString &srcPath, const QString &destPath, QStringList &copiedLibs, const QStringList &filter = QStringList());
void ctor();
void raiseError(const QString &error);
void writeOutput(const QString &text, OutputFormat = MessageOutput);
bool runCommand(QProcess *buildProc, const QString &program, const QStringList &arguments);
unsigned int remoteModificationTime(const QString &fullDestination,
QHash<QString, unsigned int> *cache);
void collectFiles(QList<DeployItem> *deployList, const QString &localPath,
const QString &remotePath, bool strip, const QStringList &filter = QStringList());
void filterModificationTimes(QList<DeployItem> *deployList);
void copyFilesToTemp(QList<DeployItem> *deployList, const QString &tempDirectory, const QString &sourcePrefix);
void fetchRemoteModificationTimes(QList<DeployItem> *deployList);
void stripFiles(const QList<DeployItem> &deployList, ProjectExplorer::Abi::Architecture architecture);
void deployFiles(QProcess *process, const QList<DeployItem> &deployList);
private:
QString m_deviceSerialNumber;
......
......@@ -63,6 +63,7 @@ AndroidDeployStepWidget::AndroidDeployStepWidget(AndroidDeployStep *step) :
connect(ui->chooseButton, SIGNAL(clicked()), SLOT(setQASIPackagePath()));
connect(ui->useLocalQtLibs, SIGNAL(stateChanged(int)), SLOT(useLocalQtLibsStateChanged(int)));
connect(ui->editRulesFilePushButton, SIGNAL(clicked()), SLOT(editRulesFile()));
connect(ui->cleanLibsPushButton, SIGNAL(clicked()), SLOT(cleanLibsOnDevice()));
}
AndroidDeployStepWidget::~AndroidDeployStepWidget()
......@@ -110,5 +111,10 @@ void AndroidDeployStepWidget::editRulesFile()
Core::ICore::instance()->openFiles(QStringList() << m_step->localLibsRulesFilePath().toString(), Core::ICore::SwitchMode);
}
void AndroidDeployStepWidget::cleanLibsOnDevice()
{
m_step->cleanLibsOnDevice();
}
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -54,6 +54,7 @@ private slots:
void setQASIPackagePath();
void useLocalQtLibsStateChanged(int);
void editRulesFile();
void cleanLibsOnDevice();
private:
virtual QString summaryText() const;
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>560</width>
<height>136</height>
<height>145</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -56,6 +56,13 @@ You must have Qt libraries compiled for that platform</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cleanLibsPushButton">
<property name="text">
<string>Clean libs on device</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editRulesFilePushButton">
<property name="text">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment