forked from qt-creator/qt-creator
Android: Simplify apkPath determination
It doesn't explicitly need the qtSupport indirection anymore. Change-Id: I25f0649a3b7760fdef3b62097ac55341e6b16fe4 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -94,7 +94,6 @@ SOURCES += \
|
|||||||
avddialog.cpp \
|
avddialog.cpp \
|
||||||
androidbuildapkstep.cpp \
|
androidbuildapkstep.cpp \
|
||||||
androidbuildapkwidget.cpp \
|
androidbuildapkwidget.cpp \
|
||||||
androidqtsupport.cpp \
|
|
||||||
androidtoolmanager.cpp \
|
androidtoolmanager.cpp \
|
||||||
androidsdkmanager.cpp \
|
androidsdkmanager.cpp \
|
||||||
androidavdmanager.cpp \
|
androidavdmanager.cpp \
|
||||||
|
@@ -78,7 +78,6 @@ Project {
|
|||||||
"androidpotentialkit.h",
|
"androidpotentialkit.h",
|
||||||
"androidqmltoolingsupport.cpp",
|
"androidqmltoolingsupport.cpp",
|
||||||
"androidqmltoolingsupport.h",
|
"androidqmltoolingsupport.h",
|
||||||
"androidqtsupport.cpp",
|
|
||||||
"androidqtsupport.h",
|
"androidqtsupport.h",
|
||||||
"androidqtversion.cpp",
|
"androidqtversion.cpp",
|
||||||
"androidqtversion.h",
|
"androidqtversion.h",
|
||||||
|
@@ -186,7 +186,7 @@ bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
setOutputParser(parser);
|
setOutputParser(parser);
|
||||||
|
|
||||||
m_openPackageLocationForRun = m_openPackageLocation;
|
m_openPackageLocationForRun = m_openPackageLocation;
|
||||||
m_apkPath = qtSupport->apkPath(target()).toString();
|
m_apkPath = AndroidManager::apkPath(target()).toString();
|
||||||
qCDebug(buildapkstepLog) << "APK path:" << m_apkPath;
|
qCDebug(buildapkstepLog) << "APK path:" << m_apkPath;
|
||||||
|
|
||||||
if (!AbstractProcessStep::init(earlierSteps))
|
if (!AbstractProcessStep::init(earlierSteps))
|
||||||
|
@@ -218,8 +218,7 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
m_uninstallPreviousPackageRun = true;
|
m_uninstallPreviousPackageRun = true;
|
||||||
m_command = AndroidConfigurations::currentConfig().adbToolPath().toString();
|
m_command = AndroidConfigurations::currentConfig().adbToolPath().toString();
|
||||||
const AndroidConfig &config = AndroidConfigurations::currentConfig();
|
const AndroidConfig &config = AndroidConfigurations::currentConfig();
|
||||||
m_apkPath = deployQtLive ? config.qtLiveApkPath() :
|
m_apkPath = deployQtLive ? config.qtLiveApkPath() : AndroidManager::apkPath(target());
|
||||||
(qtSupport ? qtSupport->apkPath(target()) : Utils::FileName());
|
|
||||||
m_workingDirectory = bc ? bc->buildDirectory().toString() : QString();
|
m_workingDirectory = bc ? bc->buildDirectory().toString() : QString();
|
||||||
}
|
}
|
||||||
m_environment = bc ? bc->environment() : Utils::Environment();
|
m_environment = bc ? bc->environment() : Utils::Environment();
|
||||||
|
@@ -48,7 +48,9 @@
|
|||||||
|
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -274,13 +276,32 @@ QString AndroidManager::targetArch(ProjectExplorer::Target *target)
|
|||||||
return qt->targetArch();
|
return qt->targetArch();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidManager::dirPath(ProjectExplorer::Target *target)
|
Utils::FileName AndroidManager::dirPath(const ProjectExplorer::Target *target)
|
||||||
{
|
{
|
||||||
if (target->activeBuildConfiguration())
|
if (target->activeBuildConfiguration())
|
||||||
return target->activeBuildConfiguration()->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY));
|
return target->activeBuildConfiguration()->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY));
|
||||||
return Utils::FileName();
|
return Utils::FileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utils::FileName AndroidManager::apkPath(const ProjectExplorer::Target *target)
|
||||||
|
{
|
||||||
|
QTC_ASSERT(target, return Utils::FileName());
|
||||||
|
|
||||||
|
auto buildApkStep
|
||||||
|
= Android::AndroidGlobal::buildStep<AndroidBuildApkStep>(target->activeBuildConfiguration());
|
||||||
|
|
||||||
|
if (!buildApkStep)
|
||||||
|
return Utils::FileName();
|
||||||
|
|
||||||
|
QString apkPath("build/outputs/apk/android-build-");
|
||||||
|
if (buildApkStep->signPackage())
|
||||||
|
apkPath += QLatin1String("release.apk");
|
||||||
|
else
|
||||||
|
apkPath += QLatin1String("debug.apk");
|
||||||
|
|
||||||
|
return dirPath(target).appendPath(apkPath);
|
||||||
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidManager::manifestSourcePath(ProjectExplorer::Target *target)
|
Utils::FileName AndroidManager::manifestSourcePath(ProjectExplorer::Target *target)
|
||||||
{
|
{
|
||||||
if (AndroidQtSupport *androidQtSupport = AndroidManager::androidQtSupport(target)) {
|
if (AndroidQtSupport *androidQtSupport = AndroidManager::androidQtSupport(target)) {
|
||||||
|
@@ -74,10 +74,11 @@ public:
|
|||||||
|
|
||||||
static QString targetArch(ProjectExplorer::Target *target);
|
static QString targetArch(ProjectExplorer::Target *target);
|
||||||
|
|
||||||
static Utils::FileName dirPath(ProjectExplorer::Target *target);
|
static Utils::FileName dirPath(const ProjectExplorer::Target *target);
|
||||||
static Utils::FileName manifestPath(ProjectExplorer::Target *target);
|
static Utils::FileName manifestPath(ProjectExplorer::Target *target);
|
||||||
static Utils::FileName manifestSourcePath(ProjectExplorer::Target *target);
|
static Utils::FileName manifestSourcePath(ProjectExplorer::Target *target);
|
||||||
static Utils::FileName defaultPropertiesPath(ProjectExplorer::Target *target);
|
static Utils::FileName defaultPropertiesPath(ProjectExplorer::Target *target);
|
||||||
|
static Utils::FileName apkPath(const ProjectExplorer::Target *target);
|
||||||
|
|
||||||
static QPair<int, int> apiLevelRange();
|
static QPair<int, int> apiLevelRange();
|
||||||
static QString androidNameForApiLevel(int x);
|
static QString androidNameForApiLevel(int x);
|
||||||
|
@@ -1,55 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** 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 The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "androidbuildapkstep.h"
|
|
||||||
#include "androidconstants.h"
|
|
||||||
#include "androidglobal.h"
|
|
||||||
#include "androidqtsupport.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/target.h>
|
|
||||||
|
|
||||||
using namespace Android::Internal;
|
|
||||||
|
|
||||||
Utils::FileName Android::AndroidQtSupport::apkPath(const ProjectExplorer::Target *target) const
|
|
||||||
{
|
|
||||||
if (!target)
|
|
||||||
return Utils::FileName();
|
|
||||||
|
|
||||||
auto buildApkStep
|
|
||||||
= Android::AndroidGlobal::buildStep<AndroidBuildApkStep>(target->activeBuildConfiguration());
|
|
||||||
|
|
||||||
if (!buildApkStep)
|
|
||||||
return Utils::FileName();
|
|
||||||
|
|
||||||
QString apkPath("build/outputs/apk/android-build-");
|
|
||||||
if (buildApkStep->signPackage())
|
|
||||||
apkPath += QLatin1String("release.apk");
|
|
||||||
else
|
|
||||||
apkPath += QLatin1String("debug.apk");
|
|
||||||
|
|
||||||
return target->activeBuildConfiguration()->buildDirectory()
|
|
||||||
.appendPath(QLatin1String(Android::Constants::ANDROID_BUILDDIRECTORY))
|
|
||||||
.appendPath(apkPath);
|
|
||||||
}
|
|
@@ -30,14 +30,8 @@
|
|||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QList>
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer { class Target; }
|
||||||
class DeployConfiguration;
|
|
||||||
class ProcessParameters;
|
|
||||||
class Project;
|
|
||||||
class Target;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Utils { class FileName; }
|
namespace Utils { class FileName; }
|
||||||
|
|
||||||
@@ -69,7 +63,6 @@ public:
|
|||||||
virtual bool canHandle(const ProjectExplorer::Target *target) const = 0;
|
virtual bool canHandle(const ProjectExplorer::Target *target) const = 0;
|
||||||
virtual QStringList soLibSearchPath(const ProjectExplorer::Target *target) const = 0;
|
virtual QStringList soLibSearchPath(const ProjectExplorer::Target *target) const = 0;
|
||||||
virtual QStringList projectTargetApplications(const ProjectExplorer::Target *target) const = 0;
|
virtual QStringList projectTargetApplications(const ProjectExplorer::Target *target) const = 0;
|
||||||
virtual Utils::FileName apkPath(const ProjectExplorer::Target *target) const;
|
|
||||||
|
|
||||||
virtual QString targetDataItem(Core::Id role, const ProjectExplorer::Target *target) const = 0;
|
virtual QString targetDataItem(Core::Id role, const ProjectExplorer::Target *target) const = 0;
|
||||||
virtual QStringList targetData(Core::Id role, const ProjectExplorer::Target *target) const = 0;
|
virtual QStringList targetData(Core::Id role, const ProjectExplorer::Target *target) const = 0;
|
||||||
|
Reference in New Issue
Block a user