forked from qt-creator/qt-creator
android: code cosmetics
Fix whitespace, capitalization, naming, comments, add 'using' in .cpp, remove 'using' in .h, remove unneeded Q_UNUSED, add needed Q_UNUSED, etc. Change-Id: Ibf9ba57850cbea1e79e152ec0165c8b01fa66567 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -54,6 +54,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
@@ -94,25 +95,24 @@ namespace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QLatin1String AndroidConfigurations::toolchainPrefix(ProjectExplorer::Abi::Architecture architecture)
|
QLatin1String AndroidConfigurations::toolchainPrefix(Abi::Architecture architecture)
|
||||||
{
|
{
|
||||||
switch (architecture) {
|
switch (architecture) {
|
||||||
case ProjectExplorer::Abi::ArmArchitecture:
|
case Abi::ArmArchitecture:
|
||||||
return ArmToolchainPrefix;
|
return ArmToolchainPrefix;
|
||||||
case ProjectExplorer::Abi::X86Architecture:
|
case Abi::X86Architecture:
|
||||||
return X86ToolchainPrefix;
|
return X86ToolchainPrefix;
|
||||||
default:
|
default:
|
||||||
return Unknown;
|
return Unknown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QLatin1String AndroidConfigurations::toolsPrefix(Abi::Architecture architecture)
|
||||||
QLatin1String AndroidConfigurations::toolsPrefix(ProjectExplorer::Abi::Architecture architecture)
|
|
||||||
{
|
{
|
||||||
switch (architecture) {
|
switch (architecture) {
|
||||||
case ProjectExplorer::Abi::ArmArchitecture:
|
case Abi::ArmArchitecture:
|
||||||
return ArmToolsPrefix;
|
return ArmToolsPrefix;
|
||||||
case ProjectExplorer::Abi::X86Architecture:
|
case Abi::X86Architecture:
|
||||||
return X86ToolsPrefix;
|
return X86ToolsPrefix;
|
||||||
default:
|
default:
|
||||||
return Unknown;
|
return Unknown;
|
||||||
@@ -122,16 +122,16 @@ QLatin1String AndroidConfigurations::toolsPrefix(ProjectExplorer::Abi::Architect
|
|||||||
AndroidConfig::AndroidConfig(const QSettings &settings)
|
AndroidConfig::AndroidConfig(const QSettings &settings)
|
||||||
{
|
{
|
||||||
// user settings
|
// user settings
|
||||||
armGdbLocation = Utils::FileName::fromString(settings.value(ArmGdbLocationKey).toString());
|
armGdbLocation = FileName::fromString(settings.value(ArmGdbLocationKey).toString());
|
||||||
armGdbserverLocation = Utils::FileName::fromString(settings.value(ArmGdbserverLocationKey).toString());
|
armGdbserverLocation = FileName::fromString(settings.value(ArmGdbserverLocationKey).toString());
|
||||||
x86GdbLocation = Utils::FileName::fromString(settings.value(X86GdbLocationKey).toString());
|
x86GdbLocation = FileName::fromString(settings.value(X86GdbLocationKey).toString());
|
||||||
x86GdbserverLocation = Utils::FileName::fromString(settings.value(X86GdbserverLocationKey).toString());
|
x86GdbserverLocation = FileName::fromString(settings.value(X86GdbserverLocationKey).toString());
|
||||||
partitionSize = settings.value(PartitionSizeKey, 1024).toInt();
|
partitionSize = settings.value(PartitionSizeKey, 1024).toInt();
|
||||||
sdkLocation = Utils::FileName::fromString(settings.value(SDKLocationKey).toString());
|
sdkLocation = FileName::fromString(settings.value(SDKLocationKey).toString());
|
||||||
ndkLocation = Utils::FileName::fromString(settings.value(NDKLocationKey).toString());
|
ndkLocation = FileName::fromString(settings.value(NDKLocationKey).toString());
|
||||||
antLocation = Utils::FileName::fromString(settings.value(AntLocationKey).toString());
|
antLocation = FileName::fromString(settings.value(AntLocationKey).toString());
|
||||||
openJDKLocation = Utils::FileName::fromString(settings.value(OpenJDKLocationKey).toString());
|
openJDKLocation = FileName::fromString(settings.value(OpenJDKLocationKey).toString());
|
||||||
keystoreLocation = Utils::FileName::fromString(settings.value(KeystoreLocationKey).toString());
|
keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString());
|
||||||
|
|
||||||
QRegExp versionRegExp(NDKGccVersionRegExp);
|
QRegExp versionRegExp(NDKGccVersionRegExp);
|
||||||
const QString &value = settings.value(NDKToolchainVersionKey).toString();
|
const QString &value = settings.value(NDKToolchainVersionKey).toString();
|
||||||
@@ -145,11 +145,11 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
|
|||||||
if (reader.load(settingsFileName())
|
if (reader.load(settingsFileName())
|
||||||
&& settings.value(changeTimeStamp).toInt() != QFileInfo(settingsFileName()).lastModified().toMSecsSinceEpoch() / 1000) {
|
&& settings.value(changeTimeStamp).toInt() != QFileInfo(settingsFileName()).lastModified().toMSecsSinceEpoch() / 1000) {
|
||||||
// persisten settings
|
// persisten settings
|
||||||
sdkLocation = Utils::FileName::fromString(reader.restoreValue(SDKLocationKey).toString());
|
sdkLocation = FileName::fromString(reader.restoreValue(SDKLocationKey).toString());
|
||||||
ndkLocation = Utils::FileName::fromString(reader.restoreValue(NDKLocationKey).toString());
|
ndkLocation = FileName::fromString(reader.restoreValue(NDKLocationKey).toString());
|
||||||
antLocation = Utils::FileName::fromString(reader.restoreValue(AntLocationKey).toString());
|
antLocation = FileName::fromString(reader.restoreValue(AntLocationKey).toString());
|
||||||
openJDKLocation = Utils::FileName::fromString(reader.restoreValue(OpenJDKLocationKey).toString());
|
openJDKLocation = FileName::fromString(reader.restoreValue(OpenJDKLocationKey).toString());
|
||||||
keystoreLocation = Utils::FileName::fromString(reader.restoreValue(KeystoreLocationKey).toString());
|
keystoreLocation = FileName::fromString(reader.restoreValue(KeystoreLocationKey).toString());
|
||||||
|
|
||||||
QRegExp versionRegExp(NDKGccVersionRegExp);
|
QRegExp versionRegExp(NDKGccVersionRegExp);
|
||||||
const QString &value = reader.restoreValue(NDKToolchainVersionKey).toString();
|
const QString &value = reader.restoreValue(NDKToolchainVersionKey).toString();
|
||||||
@@ -159,16 +159,16 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
|
|||||||
ndkToolchainVersion = value.mid(versionRegExp.indexIn(value)+1);
|
ndkToolchainVersion = value.mid(versionRegExp.indexIn(value)+1);
|
||||||
|
|
||||||
if (armGdbLocation.isEmpty())
|
if (armGdbLocation.isEmpty())
|
||||||
armGdbLocation = Utils::FileName::fromString(reader.restoreValue(ArmGdbLocationKey).toString());
|
armGdbLocation = FileName::fromString(reader.restoreValue(ArmGdbLocationKey).toString());
|
||||||
|
|
||||||
if (armGdbserverLocation.isEmpty())
|
if (armGdbserverLocation.isEmpty())
|
||||||
armGdbserverLocation = Utils::FileName::fromString(reader.restoreValue(ArmGdbserverLocationKey).toString());
|
armGdbserverLocation = FileName::fromString(reader.restoreValue(ArmGdbserverLocationKey).toString());
|
||||||
|
|
||||||
if (x86GdbLocation.isEmpty())
|
if (x86GdbLocation.isEmpty())
|
||||||
x86GdbLocation = Utils::FileName::fromString(reader.restoreValue(X86GdbLocationKey).toString());
|
x86GdbLocation = FileName::fromString(reader.restoreValue(X86GdbLocationKey).toString());
|
||||||
|
|
||||||
if (x86GdbserverLocation.isEmpty())
|
if (x86GdbserverLocation.isEmpty())
|
||||||
x86GdbserverLocation = Utils::FileName::fromString(reader.restoreValue(X86GdbserverLocationKey).toString());
|
x86GdbserverLocation = FileName::fromString(reader.restoreValue(X86GdbserverLocationKey).toString());
|
||||||
// persistent settings
|
// persistent settings
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,8 +197,6 @@ void AndroidConfig::save(QSettings &settings) const
|
|||||||
settings.setValue(X86GdbLocationKey, x86GdbLocation.toString());
|
settings.setValue(X86GdbLocationKey, x86GdbLocation.toString());
|
||||||
settings.setValue(X86GdbserverLocationKey, x86GdbserverLocation.toString());
|
settings.setValue(X86GdbserverLocationKey, x86GdbserverLocation.toString());
|
||||||
settings.setValue(PartitionSizeKey, partitionSize);
|
settings.setValue(PartitionSizeKey, partitionSize);
|
||||||
// user settings
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
|
void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
|
||||||
@@ -212,7 +210,7 @@ void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
|
|||||||
void AndroidConfigurations::updateAvailablePlatforms()
|
void AndroidConfigurations::updateAvailablePlatforms()
|
||||||
{
|
{
|
||||||
m_availablePlatforms.clear();
|
m_availablePlatforms.clear();
|
||||||
Utils::FileName path = m_config.ndkLocation;
|
FileName path = m_config.ndkLocation;
|
||||||
QDirIterator it(path.appendPath(QLatin1String("platforms")).toString(), QStringList() << QLatin1String("android-*"), QDir::Dirs);
|
QDirIterator it(path.appendPath(QLatin1String("platforms")).toString(), QStringList() << QLatin1String("android-*"), QDir::Dirs);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
const QString &fileName = it.next();
|
const QString &fileName = it.next();
|
||||||
@@ -246,7 +244,7 @@ QStringList AndroidConfigurations::ndkToolchainVersions() const
|
|||||||
{
|
{
|
||||||
QRegExp versionRegExp(NDKGccVersionRegExp);
|
QRegExp versionRegExp(NDKGccVersionRegExp);
|
||||||
QStringList result;
|
QStringList result;
|
||||||
Utils::FileName path = m_config.ndkLocation;
|
FileName path = m_config.ndkLocation;
|
||||||
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
|
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
|
||||||
QStringList() << QLatin1String("*"), QDir::Dirs);
|
QStringList() << QLatin1String("*"), QDir::Dirs);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
@@ -261,46 +259,46 @@ QStringList AndroidConfigurations::ndkToolchainVersions() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::adbToolPath() const
|
FileName AndroidConfigurations::adbToolPath() const
|
||||||
{
|
{
|
||||||
Utils::FileName path = m_config.sdkLocation;
|
FileName path = m_config.sdkLocation;
|
||||||
return path.appendPath(QLatin1String("platform-tools/adb" ANDROID_EXE_SUFFIX));
|
return path.appendPath(QLatin1String("platform-tools/adb" ANDROID_EXE_SUFFIX));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::androidToolPath() const
|
FileName AndroidConfigurations::androidToolPath() const
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
// I want to switch from using android.bat to using an executable. All it really does is call
|
// I want to switch from using android.bat to using an executable. All it really does is call
|
||||||
// Java and I've made some progress on it. So if android.exe exists, return that instead.
|
// Java and I've made some progress on it. So if android.exe exists, return that instead.
|
||||||
Utils::FileName path = m_config.sdkLocation;
|
FileName path = m_config.sdkLocation;
|
||||||
path.appendPath(QLatin1String("tools/android"ANDROID_EXE_SUFFIX));
|
path.appendPath(QLatin1String("tools/android"ANDROID_EXE_SUFFIX));
|
||||||
if (path.toFileInfo().exists())
|
if (path.toFileInfo().exists())
|
||||||
return path;
|
return path;
|
||||||
path = m_config.sdkLocation;
|
path = m_config.sdkLocation;
|
||||||
return path.appendPath(QLatin1String("tools/android"ANDROID_BAT_SUFFIX));
|
return path.appendPath(QLatin1String("tools/android"ANDROID_BAT_SUFFIX));
|
||||||
#else
|
#else
|
||||||
Utils::FileName path = m_config.sdkLocation;
|
FileName path = m_config.sdkLocation;
|
||||||
return path.appendPath(QLatin1String("tools/android"));
|
return path.appendPath(QLatin1String("tools/android"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::antToolPath() const
|
FileName AndroidConfigurations::antToolPath() const
|
||||||
{
|
{
|
||||||
if (!m_config.antLocation.isEmpty())
|
if (!m_config.antLocation.isEmpty())
|
||||||
return m_config.antLocation;
|
return m_config.antLocation;
|
||||||
else
|
else
|
||||||
return Utils::FileName::fromString(QLatin1String("ant"));
|
return FileName::fromString(QLatin1String("ant"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::emulatorToolPath() const
|
FileName AndroidConfigurations::emulatorToolPath() const
|
||||||
{
|
{
|
||||||
Utils::FileName path = m_config.sdkLocation;
|
FileName path = m_config.sdkLocation;
|
||||||
return path.appendPath(QLatin1String("tools/emulator" ANDROID_EXE_SUFFIX));
|
return path.appendPath(QLatin1String("tools/emulator" ANDROID_EXE_SUFFIX));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::toolPath(ProjectExplorer::Abi::Architecture architecture) const
|
FileName AndroidConfigurations::toolPath(Abi::Architecture architecture) const
|
||||||
{
|
{
|
||||||
Utils::FileName path = m_config.ndkLocation;
|
FileName path = m_config.ndkLocation;
|
||||||
return path.appendPath(QString::fromLatin1("toolchains/%1-%2/prebuilt/%3/bin/%4")
|
return path.appendPath(QString::fromLatin1("toolchains/%1-%2/prebuilt/%3/bin/%4")
|
||||||
.arg(toolchainPrefix(architecture))
|
.arg(toolchainPrefix(architecture))
|
||||||
.arg(m_config.ndkToolchainVersion)
|
.arg(m_config.ndkToolchainVersion)
|
||||||
@@ -308,56 +306,56 @@ Utils::FileName AndroidConfigurations::toolPath(ProjectExplorer::Abi::Architectu
|
|||||||
.arg(toolsPrefix(architecture)));
|
.arg(toolsPrefix(architecture)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::stripPath(ProjectExplorer::Abi::Architecture architecture) const
|
FileName AndroidConfigurations::stripPath(Abi::Architecture architecture) const
|
||||||
{
|
{
|
||||||
return toolPath(architecture).append(QLatin1String("-strip" ANDROID_EXE_SUFFIX));
|
return toolPath(architecture).append(QLatin1String("-strip" ANDROID_EXE_SUFFIX));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::readelfPath(ProjectExplorer::Abi::Architecture architecture) const
|
FileName AndroidConfigurations::readelfPath(Abi::Architecture architecture) const
|
||||||
{
|
{
|
||||||
return toolPath(architecture).append(QLatin1String("-readelf" ANDROID_EXE_SUFFIX));
|
return toolPath(architecture).append(QLatin1String("-readelf" ANDROID_EXE_SUFFIX));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::gccPath(ProjectExplorer::Abi::Architecture architecture) const
|
FileName AndroidConfigurations::gccPath(Abi::Architecture architecture) const
|
||||||
{
|
{
|
||||||
return toolPath(architecture).append(QLatin1String("-gcc" ANDROID_EXE_SUFFIX));
|
return toolPath(architecture).append(QLatin1String("-gcc" ANDROID_EXE_SUFFIX));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::gdbServerPath(ProjectExplorer::Abi::Architecture architecture) const
|
FileName AndroidConfigurations::gdbServerPath(Abi::Architecture architecture) const
|
||||||
{
|
{
|
||||||
Utils::FileName gdbServerPath;
|
FileName gdbServerPath;
|
||||||
switch (architecture) {
|
switch (architecture) {
|
||||||
case ProjectExplorer::Abi::ArmArchitecture:
|
case Abi::ArmArchitecture:
|
||||||
gdbServerPath = m_config.armGdbserverLocation;
|
gdbServerPath = m_config.armGdbserverLocation;
|
||||||
break;
|
break;
|
||||||
case ProjectExplorer::Abi::X86Architecture:
|
case Abi::X86Architecture:
|
||||||
gdbServerPath = m_config.x86GdbserverLocation;
|
gdbServerPath = m_config.x86GdbserverLocation;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
gdbServerPath = Utils::FileName::fromString(Unknown);
|
gdbServerPath = FileName::fromString(Unknown);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gdbServerPath.isEmpty())
|
if (!gdbServerPath.isEmpty())
|
||||||
return gdbServerPath;
|
return gdbServerPath;
|
||||||
Utils::FileName path = m_config.ndkLocation;
|
FileName path = m_config.ndkLocation;
|
||||||
return path.appendPath(QString::fromLatin1("toolchains/%1-%2/prebuilt/gdbserver")
|
return path.appendPath(QString::fromLatin1("toolchains/%1-%2/prebuilt/gdbserver")
|
||||||
.arg(toolchainPrefix(architecture))
|
.arg(toolchainPrefix(architecture))
|
||||||
.arg(m_config.ndkToolchainVersion));
|
.arg(m_config.ndkToolchainVersion));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::gdbPath(ProjectExplorer::Abi::Architecture architecture) const
|
FileName AndroidConfigurations::gdbPath(Abi::Architecture architecture) const
|
||||||
{
|
{
|
||||||
Utils::FileName gdbPath;
|
FileName gdbPath;
|
||||||
switch (architecture) {
|
switch (architecture) {
|
||||||
case ProjectExplorer::Abi::ArmArchitecture:
|
case Abi::ArmArchitecture:
|
||||||
gdbPath = m_config.armGdbLocation;
|
gdbPath = m_config.armGdbLocation;
|
||||||
break;
|
break;
|
||||||
case ProjectExplorer::Abi::X86Architecture:
|
case Abi::X86Architecture:
|
||||||
gdbPath = m_config.x86GdbLocation;
|
gdbPath = m_config.x86GdbLocation;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
gdbPath = Utils::FileName::fromString(Unknown);
|
gdbPath = FileName::fromString(Unknown);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!gdbPath.isEmpty())
|
if (!gdbPath.isEmpty())
|
||||||
@@ -365,30 +363,30 @@ Utils::FileName AndroidConfigurations::gdbPath(ProjectExplorer::Abi::Architectur
|
|||||||
return toolPath(architecture).append(QLatin1String("-gdb" ANDROID_EXE_SUFFIX));
|
return toolPath(architecture).append(QLatin1String("-gdb" ANDROID_EXE_SUFFIX));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::openJDKPath() const
|
FileName AndroidConfigurations::openJDKPath() const
|
||||||
{
|
{
|
||||||
return m_config.openJDKLocation;
|
return m_config.openJDKLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::openJDKBinPath() const
|
FileName AndroidConfigurations::openJDKBinPath() const
|
||||||
{
|
{
|
||||||
Utils::FileName path = m_config.openJDKLocation;
|
FileName path = m_config.openJDKLocation;
|
||||||
if (!path.isEmpty())
|
if (!path.isEmpty())
|
||||||
return path.appendPath(QLatin1String("bin"));
|
return path.appendPath(QLatin1String("bin"));
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::keytoolPath() const
|
FileName AndroidConfigurations::keytoolPath() const
|
||||||
{
|
{
|
||||||
return openJDKBinPath().appendPath(keytoolName);
|
return openJDKBinPath().appendPath(keytoolName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::jarsignerPath() const
|
FileName AndroidConfigurations::jarsignerPath() const
|
||||||
{
|
{
|
||||||
return openJDKBinPath().appendPath(jarsignerName);
|
return openJDKBinPath().appendPath(jarsignerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName AndroidConfigurations::zipalignPath() const
|
FileName AndroidConfigurations::zipalignPath() const
|
||||||
{
|
{
|
||||||
Utils::FileName path = m_config.sdkLocation;
|
Utils::FileName path = m_config.sdkLocation;
|
||||||
return path.appendPath(QLatin1String("tools/zipalign" ANDROID_EXE_SUFFIX));
|
return path.appendPath(QLatin1String("tools/zipalign" ANDROID_EXE_SUFFIX));
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ public:
|
|||||||
unsigned partitionSize;
|
unsigned partitionSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AndroidDeviceInfo {
|
struct AndroidDeviceInfo
|
||||||
|
{
|
||||||
QString serialNumber;
|
QString serialNumber;
|
||||||
QString cpuABI;
|
QString cpuABI;
|
||||||
int sdk;
|
int sdk;
|
||||||
@@ -87,9 +88,8 @@ struct AndroidDeviceInfo {
|
|||||||
class AndroidConfigurations : public QObject
|
class AndroidConfigurations : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY(AndroidConfigurations)
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
public:
|
||||||
static AndroidConfigurations &instance(QObject *parent = 0);
|
static AndroidConfigurations &instance(QObject *parent = 0);
|
||||||
AndroidConfig config() const { return m_config; }
|
AndroidConfig config() const { return m_config; }
|
||||||
void setConfig(const AndroidConfig &config);
|
void setConfig(const AndroidConfig &config);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#ifndef ANDROIDCONSTANTS_H
|
#ifndef ANDROIDCONSTANTS_H
|
||||||
#define ANDROIDCONSTANTS_H
|
#define ANDROIDCONSTANTS_H
|
||||||
|
|
||||||
#include <QLatin1String>
|
#include <QtGlobal>
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -44,8 +44,6 @@ enum AndroidQemuStatus {
|
|||||||
AndroidQemuUserReason
|
AndroidQemuUserReason
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ANDROID_PREFIX "Qt4ProjectManager.AndroidRunConfiguration"
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
#define ANDROID_EXE_SUFFIX ".exe"
|
#define ANDROID_EXE_SUFFIX ".exe"
|
||||||
#define ANDROID_BAT_SUFFIX ".bat"
|
#define ANDROID_BAT_SUFFIX ".bat"
|
||||||
@@ -54,8 +52,6 @@ enum AndroidQemuStatus {
|
|||||||
#define ANDROID_BAT_SUFFIX ""
|
#define ANDROID_BAT_SUFFIX ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX ":");
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
namespace Constants {
|
namespace Constants {
|
||||||
@@ -68,8 +64,7 @@ const char ANDROIDQT[] = "Qt4ProjectManager.QtVersion.Android";
|
|||||||
|
|
||||||
const char ANDROID_DEVICE_TYPE[] = "Android.Device.Type";
|
const char ANDROID_DEVICE_TYPE[] = "Android.Device.Type";
|
||||||
const char ANDROID_DEVICE_ID[] = "Android Device";
|
const char ANDROID_DEVICE_ID[] = "Android Device";
|
||||||
|
} // namespace Constants;
|
||||||
}
|
|
||||||
} // namespace Android
|
} // namespace Android
|
||||||
|
|
||||||
#endif // ANDROIDCONSTANTS_H
|
#endif // ANDROIDCONSTANTS_H
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AndroidCreateKeystoreCertificate : public QDialog
|
class AndroidCreateKeystoreCertificate : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
@@ -191,4 +191,4 @@ QStringList AndroidDebugSupport::qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Android
|
||||||
|
|||||||
@@ -34,16 +34,12 @@
|
|||||||
#include "androidrunconfiguration.h"
|
#include "androidrunconfiguration.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QPointer>
|
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger { class DebuggerRunControl; }
|
||||||
class DebuggerRunControl;
|
|
||||||
}
|
|
||||||
namespace QtSupport {class BaseQtVersion; }
|
namespace QtSupport {class BaseQtVersion; }
|
||||||
namespace ProjectExplorer { class RunControl; }
|
namespace ProjectExplorer { class RunControl; }
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AndroidRunConfiguration;
|
class AndroidRunConfiguration;
|
||||||
@@ -52,6 +48,7 @@ class AndroidRunner;
|
|||||||
class AndroidDebugSupport : public QObject
|
class AndroidDebugSupport : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static ProjectExplorer::RunControl *createDebugRunControl(AndroidRunConfiguration *runConfig);
|
static ProjectExplorer::RunControl *createDebugRunControl(AndroidRunConfiguration *runConfig);
|
||||||
|
|
||||||
|
|||||||
@@ -42,40 +42,36 @@
|
|||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtprofileinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
using namespace Android::Internal;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
AndroidDeployConfiguration::AndroidDeployConfiguration(ProjectExplorer::Target *parent, Core::Id id)
|
namespace Android {
|
||||||
:DeployConfiguration(parent, id)
|
namespace Internal {
|
||||||
|
|
||||||
|
AndroidDeployConfiguration::AndroidDeployConfiguration(Target *parent, Core::Id id)
|
||||||
|
: DeployConfiguration(parent, id)
|
||||||
{
|
{
|
||||||
setDisplayName(tr("Deploy to Android device"));
|
setDisplayName(tr("Deploy to Android device"));
|
||||||
setDefaultDisplayName(displayName());
|
setDefaultDisplayName(displayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidDeployConfiguration::~AndroidDeployConfiguration()
|
AndroidDeployConfiguration::AndroidDeployConfiguration(Target *parent, DeployConfiguration *source)
|
||||||
|
: DeployConfiguration(parent, source)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidDeployConfiguration::AndroidDeployConfiguration(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source)
|
AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *parent)
|
||||||
:DeployConfiguration(parent, source)
|
: DeployConfigurationFactory(parent)
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *parent) :
|
|
||||||
ProjectExplorer::DeployConfigurationFactory(parent)
|
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("AndroidDeployConfigurationFactory"));
|
setObjectName(QLatin1String("AndroidDeployConfigurationFactory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const
|
bool AndroidDeployConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
||||||
{
|
{
|
||||||
return availableCreationIds(parent).contains(id);
|
return availableCreationIds(parent).contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::create(ProjectExplorer::Target *parent, const Core::Id id)
|
DeployConfiguration *AndroidDeployConfigurationFactory::create(Target *parent, const Core::Id id)
|
||||||
{
|
{
|
||||||
Q_UNUSED(id);
|
|
||||||
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, id);
|
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, id);
|
||||||
if (!dc)
|
if (!dc)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -85,17 +81,17 @@ ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::create(
|
|||||||
return dc;
|
return dc;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const
|
bool AndroidDeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
|
||||||
{
|
{
|
||||||
return canCreate(parent, ProjectExplorer::idFromMap(map));
|
return canCreate(parent, idFromMap(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
|
DeployConfiguration *AndroidDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
|
||||||
{
|
{
|
||||||
if (!canRestore(parent, map))
|
if (!canRestore(parent, map))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, ProjectExplorer::idFromMap(map));
|
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, idFromMap(map));
|
||||||
if (dc->fromMap(map))
|
if (dc->fromMap(map))
|
||||||
return dc;
|
return dc;
|
||||||
|
|
||||||
@@ -103,21 +99,21 @@ ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::restore
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const
|
bool AndroidDeployConfigurationFactory::canClone(Target *parent, DeployConfiguration *source) const
|
||||||
{
|
{
|
||||||
if (!AndroidManager::supportsAndroid(parent))
|
if (!AndroidManager::supportsAndroid(parent))
|
||||||
return false;
|
return false;
|
||||||
return source->id() == ANDROID_DEPLOYCONFIGURATION_ID;
|
return source->id() == ANDROID_DEPLOYCONFIGURATION_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source)
|
DeployConfiguration *AndroidDeployConfigurationFactory::clone(Target *parent, DeployConfiguration *source)
|
||||||
{
|
{
|
||||||
if (!canClone(parent, source))
|
if (!canClone(parent, source))
|
||||||
return 0;
|
return 0;
|
||||||
return new AndroidDeployConfiguration(parent, source);
|
return new AndroidDeployConfiguration(parent, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
|
QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(Target *parent) const
|
||||||
{
|
{
|
||||||
QList<Core::Id> ids;
|
QList<Core::Id> ids;
|
||||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
||||||
@@ -126,10 +122,9 @@ QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(ProjectE
|
|||||||
if (!parent->project()->supportsProfile(parent->profile()))
|
if (!parent->project()->supportsProfile(parent->profile()))
|
||||||
return ids;
|
return ids;
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *tc
|
ToolChain *tc = ToolChainProfileInformation::toolChain(parent->profile());
|
||||||
= ProjectExplorer::ToolChainProfileInformation::toolChain(parent->profile());
|
|
||||||
|
|
||||||
if (!tc || tc->targetAbi().osFlavor() != ProjectExplorer::Abi::AndroidLinuxFlavor)
|
if (!tc || tc->targetAbi().osFlavor() != Abi::AndroidLinuxFlavor)
|
||||||
return ids;
|
return ids;
|
||||||
|
|
||||||
if (QtSupport::QtProfileInformation::qtVersion(parent->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
if (QtSupport::QtProfileInformation::qtVersion(parent->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||||
@@ -141,12 +136,15 @@ QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(ProjectE
|
|||||||
|
|
||||||
QString AndroidDeployConfigurationFactory::displayNameForId(const Core::Id id) const
|
QString AndroidDeployConfigurationFactory::displayNameForId(const Core::Id id) const
|
||||||
{
|
{
|
||||||
if (id.toString().startsWith(QLatin1String(ANDROID_DC_PREFIX)))
|
if (id.name().startsWith(ANDROID_DC_PREFIX))
|
||||||
return tr("Deploy on Android");
|
return tr("Deploy on Android");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidDeployConfigurationFactory::canHandle(ProjectExplorer::Target *parent) const
|
bool AndroidDeployConfigurationFactory::canHandle(Target *parent) const
|
||||||
{
|
{
|
||||||
return AndroidManager::supportsAndroid(parent);
|
return AndroidManager::supportsAndroid(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Android
|
||||||
|
|||||||
@@ -28,15 +28,14 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef QT4PROJECTMANAGER_QT4ANDROIDDEPLOYCONFIGURATION_H
|
#ifndef ANDROIDDEPLOYCONFIGURATION_H
|
||||||
#define QT4PROJECTMANAGER_QT4ANDROIDDEPLOYCONFIGURATION_H
|
#define ANDROIDDEPLOYCONFIGURATION_H
|
||||||
|
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class Target;
|
|
||||||
const char ANDROID_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.AndroidDeployConfiguration";
|
const char ANDROID_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.AndroidDeployConfiguration";
|
||||||
const char ANDROID_DC_PREFIX[] = "Qt4ProjectManager.AndroidDeployConfiguration.";
|
const char ANDROID_DC_PREFIX[] = "Qt4ProjectManager.AndroidDeployConfiguration.";
|
||||||
|
|
||||||
@@ -47,7 +46,7 @@ class AndroidDeployConfiguration : public ProjectExplorer::DeployConfiguration
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
AndroidDeployConfiguration(ProjectExplorer::Target *parent, Core::Id id);
|
AndroidDeployConfiguration(ProjectExplorer::Target *parent, Core::Id id);
|
||||||
virtual ~AndroidDeployConfiguration();
|
|
||||||
protected:
|
protected:
|
||||||
AndroidDeployConfiguration(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source);
|
AndroidDeployConfiguration(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source);
|
||||||
|
|
||||||
@@ -78,4 +77,4 @@ private:
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Android
|
} // namespace Android
|
||||||
|
|
||||||
#endif // QT4PROJECTMANAGER_QT4ANDROIDDEPLOYCONFIGURATION_H
|
#endif // ANDROIDDEPLOYCONFIGURATION_H
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ bool AndroidDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id i
|
|||||||
BuildStep *AndroidDeployStepFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *AndroidDeployStepFactory::create(BuildStepList *parent, const Core::Id id)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canCreate(parent, id));
|
Q_ASSERT(canCreate(parent, id));
|
||||||
|
Q_UNUSED(id);
|
||||||
return new AndroidDeployStep(parent);
|
return new AndroidDeployStep(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,7 @@
|
|||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
namespace Ui {
|
namespace Ui { class AndroidDeployStepWidget; }
|
||||||
class AndroidDeployStepWidget;
|
|
||||||
}
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ AndroidDevice::AndroidDevice()
|
|||||||
}
|
}
|
||||||
|
|
||||||
AndroidDevice::AndroidDevice(const AndroidDevice &other)
|
AndroidDevice::AndroidDevice(const AndroidDevice &other)
|
||||||
: ProjectExplorer::IDevice(other)
|
: IDevice(other)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include "androiddevice.h"
|
#include "androiddevice.h"
|
||||||
|
|
||||||
#include "androidconstants.h"
|
#include "androidconstants.h"
|
||||||
#include <coreplugin/id.h>
|
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|||||||
@@ -39,10 +39,6 @@
|
|||||||
#define ASSERT_STATE_GENERIC(State, expected, actual) \
|
#define ASSERT_STATE_GENERIC(State, expected, actual) \
|
||||||
AndroidGlobal::assertState<State>(expected, actual, Q_FUNC_INFO)
|
AndroidGlobal::assertState<State>(expected, actual, Q_FUNC_INFO)
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QString;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,6 @@
|
|||||||
namespace ProjectExplorer { class Target; }
|
namespace ProjectExplorer { class Target; }
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
class AndroidPlugin;
|
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AndroidManager : public QObject
|
class AndroidManager : public QObject
|
||||||
|
|||||||
@@ -36,26 +36,20 @@
|
|||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
using ProjectExplorer::BuildStepList;
|
|
||||||
using ProjectExplorer::BuildStep;
|
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
AndroidPackageCreationFactory::AndroidPackageCreationFactory(QObject *parent)
|
AndroidPackageCreationFactory::AndroidPackageCreationFactory(QObject *parent)
|
||||||
: ProjectExplorer::IBuildStepFactory(parent)
|
: IBuildStepFactory(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Core::Id> AndroidPackageCreationFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
|
QList<Core::Id> AndroidPackageCreationFactory::availableCreationIds(BuildStepList *parent) const
|
||||||
{
|
{
|
||||||
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
|
if (parent->id() != Constants::BUILDSTEPS_DEPLOY)
|
||||||
return QList<Core::Id>();
|
return QList<Core::Id>();
|
||||||
if (!AndroidManager::supportsAndroid(parent->target()))
|
if (!AndroidManager::supportsAndroid(parent->target()))
|
||||||
return QList<Core::Id>();
|
return QList<Core::Id>();
|
||||||
@@ -71,29 +65,27 @@ QString AndroidPackageCreationFactory::displayNameForId(const Core::Id id) const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidPackageCreationFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
|
bool AndroidPackageCreationFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
||||||
{
|
{
|
||||||
return availableCreationIds(parent).contains(id);
|
return availableCreationIds(parent).contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AndroidPackageCreationFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
|
BuildStep *AndroidPackageCreationFactory::create(BuildStepList *parent, const Core::Id id)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canCreate(parent, id));
|
Q_ASSERT(canCreate(parent, id));
|
||||||
|
Q_UNUSED(id);
|
||||||
return new AndroidPackageCreationStep(parent);
|
return new AndroidPackageCreationStep(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidPackageCreationFactory::canRestore(ProjectExplorer::BuildStepList *parent,
|
bool AndroidPackageCreationFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
|
||||||
const QVariantMap &map) const
|
|
||||||
{
|
{
|
||||||
return canCreate(parent, ProjectExplorer::idFromMap(map));
|
return canCreate(parent, idFromMap(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AndroidPackageCreationFactory::restore(ProjectExplorer::BuildStepList *parent,
|
BuildStep *AndroidPackageCreationFactory::restore(BuildStepList *parent, const QVariantMap &map)
|
||||||
const QVariantMap &map)
|
|
||||||
{
|
{
|
||||||
Q_ASSERT(canRestore(parent, map));
|
Q_ASSERT(canRestore(parent, map));
|
||||||
AndroidPackageCreationStep *const step
|
AndroidPackageCreationStep *const step = new AndroidPackageCreationStep(parent);
|
||||||
= new AndroidPackageCreationStep(parent);
|
|
||||||
if (!step->fromMap(map)) {
|
if (!step->fromMap(map)) {
|
||||||
delete step;
|
delete step;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -101,14 +93,12 @@ BuildStep *AndroidPackageCreationFactory::restore(ProjectExplorer::BuildStepList
|
|||||||
return step;
|
return step;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidPackageCreationFactory::canClone(ProjectExplorer::BuildStepList *parent,
|
bool AndroidPackageCreationFactory::canClone(BuildStepList *parent, BuildStep *product) const
|
||||||
ProjectExplorer::BuildStep *product) const
|
|
||||||
{
|
{
|
||||||
return canCreate(parent, product->id());
|
return canCreate(parent, product->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AndroidPackageCreationFactory::clone(ProjectExplorer::BuildStepList *parent,
|
BuildStep *AndroidPackageCreationFactory::clone(BuildStepList *parent, BuildStep *product)
|
||||||
ProjectExplorer::BuildStep *product)
|
|
||||||
{
|
{
|
||||||
Q_ASSERT(canClone(parent, product));
|
Q_ASSERT(canClone(parent, product));
|
||||||
return new AndroidPackageCreationStep(parent, static_cast<AndroidPackageCreationStep *>(product));
|
return new AndroidPackageCreationStep(parent, static_cast<AndroidPackageCreationStep *>(product));
|
||||||
|
|||||||
@@ -58,9 +58,6 @@
|
|||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace ProjectExplorer::Constants;
|
using namespace ProjectExplorer::Constants;
|
||||||
using ProjectExplorer::BuildStepList;
|
|
||||||
using ProjectExplorer::BuildStepConfigWidget;
|
|
||||||
using ProjectExplorer::Task;
|
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -127,10 +124,6 @@ AndroidPackageCreationStep::AndroidPackageCreationStep(BuildStepList *bsl,
|
|||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidPackageCreationStep::~AndroidPackageCreationStep()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void AndroidPackageCreationStep::ctor()
|
void AndroidPackageCreationStep::ctor()
|
||||||
{
|
{
|
||||||
setDefaultDisplayName(tr("Packaging for Android"));
|
setDefaultDisplayName(tr("Packaging for Android"));
|
||||||
|
|||||||
@@ -31,14 +31,14 @@
|
|||||||
#ifndef ANDROIDPACKAGECREATIONSTEP_H
|
#ifndef ANDROIDPACKAGECREATIONSTEP_H
|
||||||
#define ANDROIDPACKAGECREATIONSTEP_H
|
#define ANDROIDPACKAGECREATIONSTEP_H
|
||||||
|
|
||||||
#include <projectexplorer/abi.h>
|
|
||||||
#include <projectexplorer/buildstep.h>
|
|
||||||
#include <QAbstractItemModel>
|
|
||||||
#include "javaparser.h"
|
#include "javaparser.h"
|
||||||
|
|
||||||
|
#include <projectexplorer/abi.h>
|
||||||
|
#include <projectexplorer/buildstep.h>
|
||||||
|
|
||||||
|
#include <QAbstractItemModel>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QDateTime;
|
|
||||||
class QFile;
|
|
||||||
class QProcess;
|
class QProcess;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
@@ -53,12 +53,11 @@ class AndroidPackageCreationStep : public ProjectExplorer::BuildStep
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class AndroidPackageCreationFactory;
|
friend class AndroidPackageCreationFactory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AndroidPackageCreationStep(ProjectExplorer::BuildStepList *bsl);
|
AndroidPackageCreationStep(ProjectExplorer::BuildStepList *bsl);
|
||||||
~AndroidPackageCreationStep();
|
|
||||||
|
|
||||||
static bool removeDirectory(const QString &dirPath);
|
static bool removeDirectory(const QString &dirPath);
|
||||||
|
|
||||||
static void stripAndroidLibs(const QStringList &files, ProjectExplorer::Abi::Architecture architecture);
|
static void stripAndroidLibs(const QStringList &files, ProjectExplorer::Abi::Architecture architecture);
|
||||||
|
|
||||||
static const QLatin1String DefaultVersionNumber;
|
static const QLatin1String DefaultVersionNumber;
|
||||||
@@ -76,8 +75,8 @@ public:
|
|||||||
QAbstractItemModel *keystoreCertificates();
|
QAbstractItemModel *keystoreCertificates();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
virtual QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleBuildStdOutOutput();
|
void handleBuildStdOutOutput();
|
||||||
@@ -88,6 +87,9 @@ private slots:
|
|||||||
void setQtLibs(const QStringList &qtLibs);
|
void setQtLibs(const QStringList &qtLibs);
|
||||||
void setPrebundledLibs(const QStringList &prebundledLibs);
|
void setPrebundledLibs(const QStringList &prebundledLibs);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void updateRequiredLibrariesModels();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AndroidPackageCreationStep(ProjectExplorer::BuildStepList *buildConfig,
|
AndroidPackageCreationStep(ProjectExplorer::BuildStepList *buildConfig,
|
||||||
AndroidPackageCreationStep *other);
|
AndroidPackageCreationStep *other);
|
||||||
@@ -130,8 +132,6 @@ private:
|
|||||||
QStringList m_qtLibs;
|
QStringList m_qtLibs;
|
||||||
QStringList m_availableQtLibs;
|
QStringList m_availableQtLibs;
|
||||||
QStringList m_prebundledLibs;
|
QStringList m_prebundledLibs;
|
||||||
signals:
|
|
||||||
void updateRequiredLibrariesModels();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -63,9 +63,10 @@ bool checkPackageName(const QString &packageName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////// CheckModel /////////////////////////////
|
///////////////////////////// CheckModel /////////////////////////////
|
||||||
CheckModel::CheckModel(QObject *parent) : QAbstractListModel(parent)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
CheckModel::CheckModel(QObject *parent)
|
||||||
|
: QAbstractListModel(parent)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckModel::setAvailableItems(const QStringList &items)
|
void CheckModel::setAvailableItems(const QStringList &items)
|
||||||
@@ -136,11 +137,12 @@ Qt::ItemFlags CheckModel::flags(const QModelIndex &/*index*/) const
|
|||||||
{
|
{
|
||||||
return Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled;
|
return Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled;
|
||||||
}
|
}
|
||||||
///////////////////////////// CheckModel /////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////// PermissionsModel /////////////////////////////
|
///////////////////////////// PermissionsModel /////////////////////////////
|
||||||
PermissionsModel::PermissionsModel(QObject *parent):QAbstractListModel(parent)
|
|
||||||
|
PermissionsModel::PermissionsModel(QObject *parent)
|
||||||
|
: QAbstractListModel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,6 +151,7 @@ void PermissionsModel::setPermissions(const QStringList &permissions)
|
|||||||
m_permissions = permissions;
|
m_permissions = permissions;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStringList &PermissionsModel::permissions()
|
const QStringList &PermissionsModel::permissions()
|
||||||
{
|
{
|
||||||
return m_permissions;
|
return m_permissions;
|
||||||
@@ -195,10 +198,10 @@ int PermissionsModel::rowCount(const QModelIndex &parent) const
|
|||||||
Q_UNUSED(parent)
|
Q_UNUSED(parent)
|
||||||
return m_permissions.count();
|
return m_permissions.count();
|
||||||
}
|
}
|
||||||
///////////////////////////// PermissionsModel /////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////// AndroidPackageCreationWidget /////////////////////////////
|
///////////////////////////// AndroidPackageCreationWidget /////////////////////////////
|
||||||
|
|
||||||
AndroidPackageCreationWidget::AndroidPackageCreationWidget(AndroidPackageCreationStep *step)
|
AndroidPackageCreationWidget::AndroidPackageCreationWidget(AndroidPackageCreationStep *step)
|
||||||
: ProjectExplorer::BuildStepConfigWidget(),
|
: ProjectExplorer::BuildStepConfigWidget(),
|
||||||
m_step(step),
|
m_step(step),
|
||||||
@@ -215,7 +218,6 @@ AndroidPackageCreationWidget::AndroidPackageCreationWidget(AndroidPackageCreatio
|
|||||||
connect(m_step, SIGNAL(updateRequiredLibrariesModels()), SLOT(updateRequiredLibrariesModels()));
|
connect(m_step, SIGNAL(updateRequiredLibrariesModels()), SLOT(updateRequiredLibrariesModels()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AndroidPackageCreationWidget::initGui()
|
void AndroidPackageCreationWidget::initGui()
|
||||||
{
|
{
|
||||||
updateAndroidProjectInfo();
|
updateAndroidProjectInfo();
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#define ANDROIDPACKAGECREATIONWIDGET_H
|
#define ANDROIDPACKAGECREATIONWIDGET_H
|
||||||
|
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,6 @@
|
|||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtprofileinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
@@ -77,6 +75,7 @@ bool AndroidPackageInstallationFactory::canCreate(BuildStepList *parent, const C
|
|||||||
BuildStep *AndroidPackageInstallationFactory::create(BuildStepList *parent, const Core::Id id)
|
BuildStep *AndroidPackageInstallationFactory::create(BuildStepList *parent, const Core::Id id)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canCreate(parent, id));
|
Q_ASSERT(canCreate(parent, id));
|
||||||
|
Q_UNUSED(id);
|
||||||
return new AndroidPackageInstallationStep(parent);
|
return new AndroidPackageInstallationStep(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#ifndef ANDROIDPACKAGEINSTALLATIONFACTORY_H
|
#ifndef ANDROIDPACKAGEINSTALLATIONFACTORY_H
|
||||||
#define ANDROIDPACKAGEINSTALLATIONFACTORY_H
|
#define ANDROIDPACKAGEINSTALLATIONFACTORY_H
|
||||||
|
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
|
|||||||
@@ -31,30 +31,22 @@
|
|||||||
#include "androidpackageinstallationstep.h"
|
#include "androidpackageinstallationstep.h"
|
||||||
#include "androidmanager.h"
|
#include "androidmanager.h"
|
||||||
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QDir>
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
|
|
||||||
using namespace Android::Internal;
|
using namespace Android::Internal;
|
||||||
|
|
||||||
const Core::Id AndroidPackageInstallationStep::Id("Qt4ProjectManager.AndroidPackageInstallationStep");
|
const Core::Id AndroidPackageInstallationStep::Id = Core::Id("Qt4ProjectManager.AndroidPackageInstallationStep");
|
||||||
|
|
||||||
static inline QString stepDisplayName()
|
AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl)
|
||||||
|
: MakeStep(bsl, Id)
|
||||||
{
|
{
|
||||||
return AndroidPackageInstallationStep::tr("Copy application data");
|
const QString name = tr("Copy application data");
|
||||||
}
|
|
||||||
|
|
||||||
AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl) : MakeStep(bsl, Id)
|
|
||||||
{
|
|
||||||
const QString name = stepDisplayName();
|
|
||||||
setDefaultDisplayName(name);
|
setDefaultDisplayName(name);
|
||||||
setDisplayName(name);
|
setDisplayName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bc, AndroidPackageInstallationStep *other): MakeStep(bc, other)
|
AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bc, AndroidPackageInstallationStep *other)
|
||||||
{ }
|
: MakeStep(bc, other)
|
||||||
|
|
||||||
AndroidPackageInstallationStep::~AndroidPackageInstallationStep()
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
bool AndroidPackageInstallationStep::init()
|
bool AndroidPackageInstallationStep::init()
|
||||||
|
|||||||
@@ -40,15 +40,14 @@ class AndroidPackageInstallationStep : public Qt4ProjectManager::MakeStep
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class AndroidPackageInstallationFactory;
|
friend class AndroidPackageInstallationFactory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl);
|
explicit AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl);
|
||||||
virtual ~AndroidPackageInstallationStep();
|
bool init();
|
||||||
virtual bool init();
|
|
||||||
private:
|
private:
|
||||||
AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bc,
|
AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bc,
|
||||||
AndroidPackageInstallationStep *other);
|
AndroidPackageInstallationStep *other);
|
||||||
|
|
||||||
private:
|
|
||||||
static const Core::Id Id;
|
static const Core::Id Id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -54,14 +54,10 @@ namespace Android {
|
|||||||
AndroidPlugin::AndroidPlugin()
|
AndroidPlugin::AndroidPlugin()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
AndroidPlugin::~AndroidPlugin()
|
bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
{ }
|
|
||||||
|
|
||||||
bool AndroidPlugin::initialize(const QStringList &arguments,
|
|
||||||
QString *error_message)
|
|
||||||
{
|
{
|
||||||
Q_UNUSED(arguments);
|
Q_UNUSED(arguments);
|
||||||
Q_UNUSED(error_message);
|
Q_UNUSED(errorMessage);
|
||||||
|
|
||||||
Internal::AndroidConfigurations::instance(this);
|
Internal::AndroidConfigurations::instance(this);
|
||||||
|
|
||||||
|
|||||||
@@ -41,9 +41,8 @@ class AndroidPlugin : public ExtensionSystem::IPlugin
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
AndroidPlugin();
|
AndroidPlugin();
|
||||||
~AndroidPlugin();
|
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *error_message);
|
bool initialize(const QStringList &arguments, QString *errorMessage);
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ using namespace Android::Internal;
|
|||||||
AndroidQtVersion::AndroidQtVersion()
|
AndroidQtVersion::AndroidQtVersion()
|
||||||
: QtSupport::BaseQtVersion()
|
: QtSupport::BaseQtVersion()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidQtVersion::AndroidQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
|
AndroidQtVersion::AndroidQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
|
||||||
@@ -47,11 +46,6 @@ AndroidQtVersion::AndroidQtVersion(const Utils::FileName &path, bool isAutodetec
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidQtVersion::~AndroidQtVersion()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
AndroidQtVersion *AndroidQtVersion::clone() const
|
AndroidQtVersion *AndroidQtVersion::clone() const
|
||||||
{
|
{
|
||||||
return new AndroidQtVersion(*this);
|
return new AndroidQtVersion(*this);
|
||||||
|
|||||||
@@ -41,14 +41,13 @@ namespace Internal {
|
|||||||
class AndroidQtVersion : public QtSupport::BaseQtVersion
|
class AndroidQtVersion : public QtSupport::BaseQtVersion
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidQtVersion)
|
Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidQtVersion)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AndroidQtVersion();
|
AndroidQtVersion();
|
||||||
AndroidQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
AndroidQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||||
~AndroidQtVersion ();
|
|
||||||
AndroidQtVersion *clone() const;
|
AndroidQtVersion *clone() const;
|
||||||
|
|
||||||
QString type() const;
|
QString type() const;
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
QString invalidReason() const;
|
QString invalidReason() const;
|
||||||
|
|
||||||
|
|||||||
@@ -43,12 +43,6 @@ namespace Internal {
|
|||||||
AndroidQtVersionFactory::AndroidQtVersionFactory(QObject *parent)
|
AndroidQtVersionFactory::AndroidQtVersionFactory(QObject *parent)
|
||||||
: QtSupport::QtVersionFactory(parent)
|
: QtSupport::QtVersionFactory(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
AndroidQtVersionFactory::~AndroidQtVersionFactory()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidQtVersionFactory::canRestore(const QString &type)
|
bool AndroidQtVersionFactory::canRestore(const QString &type)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#ifndef ANDROIDQTVERSIONFACTORY_H
|
#ifndef ANDROIDQTVERSIONFACTORY_H
|
||||||
#define ANDROIDQTVERSIONFACTORY_H
|
#define ANDROIDQTVERSIONFACTORY_H
|
||||||
|
|
||||||
#include <qtsupport/qtversionfactory.h>
|
#include <qtsupport/qtversionfactory.h>
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
@@ -39,13 +40,12 @@ class AndroidQtVersionFactory : public QtSupport::QtVersionFactory
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit AndroidQtVersionFactory(QObject *parent = 0);
|
explicit AndroidQtVersionFactory(QObject *parent = 0);
|
||||||
~AndroidQtVersionFactory();
|
|
||||||
|
|
||||||
virtual bool canRestore(const QString &type);
|
bool canRestore(const QString &type);
|
||||||
virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
|
QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
|
||||||
|
|
||||||
virtual int priority() const;
|
int priority() const;
|
||||||
virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
|
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
|
||||||
bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -37,16 +37,13 @@
|
|||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
|
||||||
#include <QIcon>
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
using ProjectExplorer::RunConfiguration;
|
|
||||||
using namespace ProjectExplorer;
|
|
||||||
|
|
||||||
AndroidRunControl::AndroidRunControl(AndroidRunConfiguration *rc)
|
AndroidRunControl::AndroidRunControl(AndroidRunConfiguration *rc)
|
||||||
: RunControl(rc, ProjectExplorer::NormalRunMode)
|
: RunControl(rc, NormalRunMode)
|
||||||
, m_runner(new AndroidRunner(this, rc, false))
|
, m_runner(new AndroidRunner(this, rc, false))
|
||||||
, m_running(false)
|
, m_running(false)
|
||||||
{
|
{
|
||||||
@@ -73,7 +70,7 @@ void AndroidRunControl::start()
|
|||||||
m_runner->start();
|
m_runner->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunControl::StopResult AndroidRunControl::stop()
|
RunControl::StopResult AndroidRunControl::stop()
|
||||||
{
|
{
|
||||||
m_runner->stop();
|
m_runner->stop();
|
||||||
return StoppedSynchronously;
|
return StoppedSynchronously;
|
||||||
|
|||||||
@@ -33,25 +33,25 @@
|
|||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AndroidRunConfiguration;
|
class AndroidRunConfiguration;
|
||||||
class AndroidRunner;
|
class AndroidRunner;
|
||||||
|
|
||||||
class AndroidRunControl : public ProjectExplorer::RunControl
|
class AndroidRunControl : public ProjectExplorer::RunControl
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AndroidRunControl(AndroidRunConfiguration *runConfig);
|
explicit AndroidRunControl(AndroidRunConfiguration *runConfig);
|
||||||
virtual ~AndroidRunControl();
|
~AndroidRunControl();
|
||||||
|
|
||||||
virtual void start();
|
void start();
|
||||||
virtual StopResult stop();
|
StopResult stop();
|
||||||
virtual bool isRunning() const;
|
bool isRunning() const;
|
||||||
virtual QString displayName() const;
|
QString displayName() const;
|
||||||
virtual QIcon icon() const;
|
QIcon icon() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleRemoteProcessFinished(const QString &error);
|
void handleRemoteProcessFinished(const QString &error);
|
||||||
|
|||||||
@@ -47,15 +47,16 @@
|
|||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Android {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
|
|
||||||
namespace {
|
namespace Android {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
QString pathFromId(const Core::Id id)
|
#define ANDROID_PREFIX "Qt4ProjectManager.AndroidRunConfiguration"
|
||||||
|
static QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX ":");
|
||||||
|
|
||||||
|
static QString pathFromId(const Core::Id id)
|
||||||
{
|
{
|
||||||
QString pathStr = id.toString();
|
QString pathStr = id.toString();
|
||||||
const QString prefix = QLatin1String(ANDROID_RC_ID_PREFIX);
|
const QString prefix = QLatin1String(ANDROID_RC_ID_PREFIX);
|
||||||
@@ -64,14 +65,11 @@ QString pathFromId(const Core::Id id)
|
|||||||
return pathStr.mid(prefix.size());
|
return pathStr.mid(prefix.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
AndroidRunConfigurationFactory::AndroidRunConfigurationFactory(QObject *parent)
|
AndroidRunConfigurationFactory::AndroidRunConfigurationFactory(QObject *parent)
|
||||||
: QmakeRunConfigurationFactory(parent)
|
: QmakeRunConfigurationFactory(parent)
|
||||||
{ setObjectName(QLatin1String("AndroidRunConfigurationFactory")); }
|
{
|
||||||
|
setObjectName(QLatin1String("AndroidRunConfigurationFactory"));
|
||||||
AndroidRunConfigurationFactory::~AndroidRunConfigurationFactory()
|
}
|
||||||
{ }
|
|
||||||
|
|
||||||
bool AndroidRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
bool AndroidRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
||||||
{
|
{
|
||||||
@@ -88,8 +86,7 @@ bool AndroidRunConfigurationFactory::canRestore(Target *parent, const QVariantMa
|
|||||||
return id.startsWith(QLatin1String(ANDROID_RC_ID_PREFIX));
|
return id.startsWith(QLatin1String(ANDROID_RC_ID_PREFIX));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidRunConfigurationFactory::canClone(Target *parent,
|
bool AndroidRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
|
||||||
RunConfiguration *source) const
|
|
||||||
{
|
{
|
||||||
return canCreate(parent, source->id());
|
return canCreate(parent, source->id());
|
||||||
}
|
}
|
||||||
@@ -165,10 +162,6 @@ AndroidRunControlFactory::AndroidRunControlFactory(QObject *parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidRunControlFactory::~AndroidRunControlFactory()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AndroidRunControlFactory::canRun(RunConfiguration *runConfiguration,
|
bool AndroidRunControlFactory::canRun(RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const
|
ProjectExplorer::RunMode mode) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,18 +35,11 @@
|
|||||||
#include <qt4projectmanager/qmakerunconfigurationfactory.h>
|
#include <qt4projectmanager/qmakerunconfigurationfactory.h>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class RunControl;
|
class RunControl;
|
||||||
class RunConfigWidget;
|
class RunConfigWidget;
|
||||||
class Target;
|
class Target;
|
||||||
}
|
class Node;
|
||||||
|
} // namespace ProjectExplorer
|
||||||
using ProjectExplorer::IRunControlFactory;
|
|
||||||
using ProjectExplorer::RunConfiguration;
|
|
||||||
using ProjectExplorer::RunControl;
|
|
||||||
using ProjectExplorer::RunConfigWidget;
|
|
||||||
using ProjectExplorer::Target;
|
|
||||||
|
|
||||||
namespace ProjectExplorer { class Node; }
|
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -57,37 +50,36 @@ class AndroidRunConfigurationFactory : public Qt4ProjectManager::QmakeRunConfigu
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AndroidRunConfigurationFactory(QObject *parent = 0);
|
explicit AndroidRunConfigurationFactory(QObject *parent = 0);
|
||||||
~AndroidRunConfigurationFactory();
|
|
||||||
|
|
||||||
QString displayNameForId(const Core::Id id) const;
|
QString displayNameForId(const Core::Id id) const;
|
||||||
QList<Core::Id> availableCreationIds(Target *parent) const;
|
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
|
||||||
|
|
||||||
bool canCreate(Target *parent, const Core::Id id) const;
|
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
|
||||||
RunConfiguration *create(Target *parent, const Core::Id id);
|
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
|
||||||
|
|
||||||
bool canRestore(Target *parent, const QVariantMap &map) const;
|
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
||||||
RunConfiguration *restore(Target *parent, const QVariantMap &map);
|
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
|
||||||
|
|
||||||
bool canClone(Target *parent, RunConfiguration *source) const;
|
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
|
||||||
RunConfiguration *clone(Target *parent, RunConfiguration *source);
|
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
|
||||||
|
|
||||||
bool canHandle(ProjectExplorer::Target *t) const;
|
bool canHandle(ProjectExplorer::Target *t) const;
|
||||||
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t,
|
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t,
|
||||||
ProjectExplorer::Node *n);
|
ProjectExplorer::Node *n);
|
||||||
};
|
};
|
||||||
|
|
||||||
class AndroidRunControlFactory : public IRunControlFactory
|
class AndroidRunControlFactory : public ProjectExplorer::IRunControlFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AndroidRunControlFactory(QObject *parent = 0);
|
explicit AndroidRunControlFactory(QObject *parent = 0);
|
||||||
~AndroidRunControlFactory();
|
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|
||||||
bool canRun(RunConfiguration *runConfiguration,
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const;
|
ProjectExplorer::RunMode mode) const;
|
||||||
RunControl *create(RunConfiguration *runConfiguration,
|
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode);
|
ProjectExplorer::RunMode mode);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,15 +34,14 @@
|
|||||||
#include "androidconfigurations.h"
|
#include "androidconfigurations.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QStringList>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AndroidRunConfiguration;
|
class AndroidRunConfiguration;
|
||||||
|
|
||||||
class AndroidRunner : public QThread
|
class AndroidRunner : public QThread
|
||||||
|
|||||||
@@ -47,18 +47,18 @@
|
|||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
void AVDModel::setAvdList(QVector<AndroidDeviceInfo> list)
|
void AvdModel::setAvdList(const QVector<AndroidDeviceInfo> &list)
|
||||||
{
|
{
|
||||||
m_list = list;
|
m_list = list;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AVDModel::avdName(const QModelIndex &index)
|
QString AvdModel::avdName(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
return m_list[index.row()].serialNumber;
|
return m_list[index.row()].serialNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant AVDModel::data(const QModelIndex &index, int role) const
|
QVariant AvdModel::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
if (role != Qt::DisplayRole || !index.isValid())
|
if (role != Qt::DisplayRole || !index.isValid())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
@@ -73,7 +73,7 @@ QVariant AVDModel::data(const QModelIndex &index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant AVDModel::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant AvdModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
@@ -89,12 +89,12 @@ QVariant AVDModel::headerData(int section, Qt::Orientation orientation, int role
|
|||||||
return QAbstractItemModel::headerData(section, orientation, role );
|
return QAbstractItemModel::headerData(section, orientation, role );
|
||||||
}
|
}
|
||||||
|
|
||||||
int AVDModel::rowCount(const QModelIndex &/*parent*/) const
|
int AvdModel::rowCount(const QModelIndex &/*parent*/) const
|
||||||
{
|
{
|
||||||
return m_list.size();
|
return m_list.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
int AVDModel::columnCount(const QModelIndex &/*parent*/) const
|
int AvdModel::columnCount(const QModelIndex &/*parent*/) const
|
||||||
{
|
{
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,31 +34,26 @@
|
|||||||
#include "androidconfigurations.h"
|
#include "androidconfigurations.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QSharedPointer>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QLineEdit;
|
|
||||||
class QModelIndex;
|
|
||||||
|
|
||||||
class Ui_AndroidSettingsWidget;
|
class Ui_AndroidSettingsWidget;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AVDModel: public QAbstractTableModel
|
class AvdModel: public QAbstractTableModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
void setAvdList(QVector<AndroidDeviceInfo> list);
|
void setAvdList(const QVector<AndroidDeviceInfo> &list);
|
||||||
QString avdName(const QModelIndex &index);
|
QString avdName(const QModelIndex &index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||||
QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
|
|
||||||
@@ -110,7 +105,7 @@ private:
|
|||||||
|
|
||||||
Ui_AndroidSettingsWidget *m_ui;
|
Ui_AndroidSettingsWidget *m_ui;
|
||||||
AndroidConfig m_androidConfig;
|
AndroidConfig m_androidConfig;
|
||||||
AVDModel m_AVDModel;
|
AvdModel m_AVDModel;
|
||||||
bool m_saveSettingsRequested;
|
bool m_saveSettingsRequested;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,6 @@
|
|||||||
#include "androidmanager.h"
|
#include "androidmanager.h"
|
||||||
#include "androidqtversion.h"
|
#include "androidqtversion.h"
|
||||||
|
|
||||||
#include "qt4projectmanager/qt4projectmanagerconstants.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/toolchainmanager.h>
|
#include <projectexplorer/toolchainmanager.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
@@ -52,18 +50,19 @@
|
|||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
using namespace ProjectExplorer;
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
|
|
||||||
static const char ANDROID_QT_VERSION_KEY[] = "Qt4ProjectManager.Android.QtVersion";
|
static const char ANDROID_QT_VERSION_KEY[] = "Qt4ProjectManager.Android.QtVersion";
|
||||||
|
|
||||||
|
|
||||||
AndroidToolChain::AndroidToolChain(bool autodetected) :
|
AndroidToolChain::AndroidToolChain(bool autodetected) :
|
||||||
ProjectExplorer::GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), autodetected),
|
GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), autodetected),
|
||||||
m_qtVersionId(-1)
|
m_qtVersionId(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
AndroidToolChain::AndroidToolChain(const AndroidToolChain &tc) :
|
AndroidToolChain::AndroidToolChain(const AndroidToolChain &tc) :
|
||||||
ProjectExplorer::GccToolChain(tc),
|
GccToolChain(tc),
|
||||||
m_qtVersionId(tc.m_qtVersionId)
|
m_qtVersionId(tc.m_qtVersionId)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@@ -91,7 +90,7 @@ void AndroidToolChain::addToEnvironment(Utils::Environment &env) const
|
|||||||
// TODO this vars should be configurable in projects -> build tab
|
// TODO this vars should be configurable in projects -> build tab
|
||||||
// TODO invalidate all .pro files !!!
|
// TODO invalidate all .pro files !!!
|
||||||
|
|
||||||
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorer::ProjectExplorerPlugin::instance()->currentProject());
|
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
|
||||||
if (!qt4pro || !qt4pro->activeTarget()
|
if (!qt4pro || !qt4pro->activeTarget()
|
||||||
|| QtSupport::QtProfileInformation::qtVersion(qt4pro->activeTarget()->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
|| QtSupport::QtProfileInformation::qtVersion(qt4pro->activeTarget()->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||||
return;
|
return;
|
||||||
@@ -116,7 +115,7 @@ void AndroidToolChain::addToEnvironment(Utils::Environment &env) const
|
|||||||
AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(qt4pro->activeTarget())));
|
AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(qt4pro->activeTarget())));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidToolChain::operator ==(const ProjectExplorer::ToolChain &tc) const
|
bool AndroidToolChain::operator ==(const ToolChain &tc) const
|
||||||
{
|
{
|
||||||
if (!ToolChain::operator ==(tc))
|
if (!ToolChain::operator ==(tc))
|
||||||
return false;
|
return false;
|
||||||
@@ -125,7 +124,7 @@ bool AndroidToolChain::operator ==(const ProjectExplorer::ToolChain &tc) const
|
|||||||
return m_qtVersionId == tcPtr->m_qtVersionId;
|
return m_qtVersionId == tcPtr->m_qtVersionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::ToolChainConfigWidget *AndroidToolChain::configurationWidget()
|
ToolChainConfigWidget *AndroidToolChain::configurationWidget()
|
||||||
{
|
{
|
||||||
return new AndroidToolChainConfigWidget(this);
|
return new AndroidToolChainConfigWidget(this);
|
||||||
}
|
}
|
||||||
@@ -164,7 +163,7 @@ QString AndroidToolChain::makeCommand() const
|
|||||||
void AndroidToolChain::setQtVersionId(int id)
|
void AndroidToolChain::setQtVersionId(int id)
|
||||||
{
|
{
|
||||||
if (id < 0) {
|
if (id < 0) {
|
||||||
setTargetAbi(ProjectExplorer::Abi());
|
setTargetAbi(Abi());
|
||||||
m_qtVersionId = -1;
|
m_qtVersionId = -1;
|
||||||
toolChainUpdated();
|
toolChainUpdated();
|
||||||
return;
|
return;
|
||||||
@@ -186,14 +185,14 @@ int AndroidToolChain::qtVersionId() const
|
|||||||
return m_qtVersionId;
|
return m_qtVersionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::Abi> AndroidToolChain::detectSupportedAbis() const
|
QList<Abi> AndroidToolChain::detectSupportedAbis() const
|
||||||
{
|
{
|
||||||
if (m_qtVersionId < 0)
|
if (m_qtVersionId < 0)
|
||||||
return QList<ProjectExplorer::Abi>();
|
return QList<Abi>();
|
||||||
|
|
||||||
AndroidQtVersion *aqv = dynamic_cast<AndroidQtVersion *>(QtSupport::QtVersionManager::instance()->version(m_qtVersionId));
|
AndroidQtVersion *aqv = dynamic_cast<AndroidQtVersion *>(QtSupport::QtVersionManager::instance()->version(m_qtVersionId));
|
||||||
if (!aqv)
|
if (!aqv)
|
||||||
return QList<ProjectExplorer::Abi>();
|
return QList<Abi>();
|
||||||
|
|
||||||
return aqv->qtAbis();
|
return aqv->qtAbis();
|
||||||
}
|
}
|
||||||
@@ -203,12 +202,10 @@ QList<ProjectExplorer::Abi> AndroidToolChain::detectSupportedAbis() const
|
|||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
AndroidToolChainConfigWidget::AndroidToolChainConfigWidget(AndroidToolChain *tc) :
|
AndroidToolChainConfigWidget::AndroidToolChainConfigWidget(AndroidToolChain *tc) :
|
||||||
ProjectExplorer::ToolChainConfigWidget(tc)
|
ToolChainConfigWidget(tc)
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||||
QLabel *label = new QLabel;
|
QLabel *label = new QLabel;
|
||||||
QtSupport::BaseQtVersion *v = QtSupport::QtVersionManager::instance()->version(tc->qtVersionId());
|
|
||||||
Q_ASSERT(v);
|
|
||||||
label->setText(tr("NDK Root: %1").arg(AndroidConfigurations::instance().config().ndkLocation.toUserOutput()));
|
label->setText(tr("NDK Root: %1").arg(AndroidConfigurations::instance().config().ndkLocation.toUserOutput()));
|
||||||
layout->addWidget(label);
|
layout->addWidget(label);
|
||||||
}
|
}
|
||||||
@@ -233,7 +230,7 @@ bool AndroidToolChainConfigWidget::isDirty() const
|
|||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
AndroidToolChainFactory::AndroidToolChainFactory() :
|
AndroidToolChainFactory::AndroidToolChainFactory() :
|
||||||
ProjectExplorer::ToolChainFactory()
|
ToolChainFactory()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
QString AndroidToolChainFactory::displayName() const
|
QString AndroidToolChainFactory::displayName() const
|
||||||
@@ -246,9 +243,9 @@ QString AndroidToolChainFactory::id() const
|
|||||||
return QLatin1String(Constants::ANDROID_TOOLCHAIN_ID);
|
return QLatin1String(Constants::ANDROID_TOOLCHAIN_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::ToolChain *> AndroidToolChainFactory::autoDetect()
|
QList<ToolChain *> AndroidToolChainFactory::autoDetect()
|
||||||
{
|
{
|
||||||
QList<ProjectExplorer::ToolChain *> result;
|
QList<ToolChain *> result;
|
||||||
|
|
||||||
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
|
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
|
||||||
connect(vm, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
connect(vm, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
||||||
@@ -266,7 +263,7 @@ bool AndroidToolChainFactory::canRestore(const QVariantMap &data)
|
|||||||
return idFromMap(data).startsWith(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID) + QLatin1Char(':'));
|
return idFromMap(data).startsWith(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID) + QLatin1Char(':'));
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *AndroidToolChainFactory::restore(const QVariantMap &data)
|
ToolChain *AndroidToolChainFactory::restore(const QVariantMap &data)
|
||||||
{
|
{
|
||||||
AndroidToolChain *tc = new AndroidToolChain(false);
|
AndroidToolChain *tc = new AndroidToolChain(false);
|
||||||
if (tc->fromMap(data))
|
if (tc->fromMap(data))
|
||||||
@@ -280,29 +277,29 @@ void AndroidToolChainFactory::handleQtVersionChanges(const QList<int> &added, co
|
|||||||
{
|
{
|
||||||
QList<int> changes;
|
QList<int> changes;
|
||||||
changes << added << removed << changed;
|
changes << added << removed << changed;
|
||||||
ProjectExplorer::ToolChainManager *tcm = ProjectExplorer::ToolChainManager::instance();
|
ToolChainManager *tcm = ToolChainManager::instance();
|
||||||
QList<ProjectExplorer::ToolChain *> tcList = createToolChainList(changes);
|
QList<ToolChain *> tcList = createToolChainList(changes);
|
||||||
foreach (ProjectExplorer::ToolChain *tc, tcList)
|
foreach (ToolChain *tc, tcList)
|
||||||
tcm->registerToolChain(tc);
|
tcm->registerToolChain(tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::ToolChain *> AndroidToolChainFactory::createToolChainList(const QList<int> &changes)
|
QList<ToolChain *> AndroidToolChainFactory::createToolChainList(const QList<int> &changes)
|
||||||
{
|
{
|
||||||
ProjectExplorer::ToolChainManager *tcm = ProjectExplorer::ToolChainManager::instance();
|
ToolChainManager *tcm = ToolChainManager::instance();
|
||||||
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
|
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
|
||||||
QList<ProjectExplorer::ToolChain *> result;
|
QList<ToolChain *> result;
|
||||||
|
|
||||||
foreach (int i, changes) {
|
foreach (int i, changes) {
|
||||||
QtSupport::BaseQtVersion *v = vm->version(i);
|
QtSupport::BaseQtVersion *v = vm->version(i);
|
||||||
QList<ProjectExplorer::ToolChain *> toRemove;
|
QList<ToolChain *> toRemove;
|
||||||
foreach (ProjectExplorer::ToolChain *tc, tcm->toolChains()) {
|
foreach (ToolChain *tc, tcm->toolChains()) {
|
||||||
if (tc->id() != QLatin1String(Constants::ANDROID_TOOLCHAIN_ID))
|
if (tc->id() != QLatin1String(Constants::ANDROID_TOOLCHAIN_ID))
|
||||||
continue;
|
continue;
|
||||||
AndroidToolChain *aTc = static_cast<AndroidToolChain *>(tc);
|
AndroidToolChain *aTc = static_cast<AndroidToolChain *>(tc);
|
||||||
if (aTc->qtVersionId() == i)
|
if (aTc->qtVersionId() == i)
|
||||||
toRemove.append(aTc);
|
toRemove.append(aTc);
|
||||||
}
|
}
|
||||||
foreach (ProjectExplorer::ToolChain *tc, toRemove)
|
foreach (ToolChain *tc, toRemove)
|
||||||
tcm->deregisterToolChain(tc);
|
tcm->deregisterToolChain(tc);
|
||||||
|
|
||||||
const AndroidQtVersion * const aqv = dynamic_cast<AndroidQtVersion *>(v);
|
const AndroidQtVersion * const aqv = dynamic_cast<AndroidQtVersion *>(v);
|
||||||
@@ -312,7 +309,7 @@ QList<ProjectExplorer::ToolChain *> AndroidToolChainFactory::createToolChainList
|
|||||||
AndroidToolChain *aTc = new AndroidToolChain(true);
|
AndroidToolChain *aTc = new AndroidToolChain(true);
|
||||||
aTc->setQtVersionId(i);
|
aTc->setQtVersionId(i);
|
||||||
aTc->setDisplayName(tr("Android GCC (%1-%2)")
|
aTc->setDisplayName(tr("Android GCC (%1-%2)")
|
||||||
.arg(ProjectExplorer::Abi::toString(aTc->targetAbi().architecture()))
|
.arg(Abi::toString(aTc->targetAbi().architecture()))
|
||||||
.arg(AndroidConfigurations::instance().config().ndkToolchainVersion));
|
.arg(AndroidConfigurations::instance().config().ndkToolchainVersion));
|
||||||
aTc->setCompilerCommand(AndroidConfigurations::instance().gccPath(aTc->targetAbi().architecture()));
|
aTc->setCompilerCommand(AndroidConfigurations::instance().gccPath(aTc->targetAbi().architecture()));
|
||||||
result.append(aTc);
|
result.append(aTc);
|
||||||
|
|||||||
@@ -35,13 +35,8 @@
|
|||||||
#include <projectexplorer/toolchainconfigwidget.h>
|
#include <projectexplorer/toolchainconfigwidget.h>
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// MaemoToolChain
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class AndroidToolChain : public ProjectExplorer::GccToolChain
|
class AndroidToolChain : public ProjectExplorer::GccToolChain
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -61,13 +56,13 @@ public:
|
|||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
bool fromMap(const QVariantMap &data);
|
bool fromMap(const QVariantMap &data);
|
||||||
QList<Utils::FileName> suggestedMkspecList() const;
|
QList<Utils::FileName> suggestedMkspecList() const;
|
||||||
virtual QString makeCommand() const;
|
QString makeCommand() const;
|
||||||
|
|
||||||
void setQtVersionId(int);
|
void setQtVersionId(int);
|
||||||
int qtVersionId() const;
|
int qtVersionId() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QList<ProjectExplorer::Abi> detectSupportedAbis() const;
|
QList<ProjectExplorer::Abi> detectSupportedAbis() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit AndroidToolChain(bool);
|
explicit AndroidToolChain(bool);
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ using namespace Android::Internal;
|
|||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
JavaParser::JavaParser() :
|
JavaParser::JavaParser() :
|
||||||
ProjectExplorer::IOutputParser()
|
m_javaRegExp(QLatin1String("^(.*\\[javac\\]\\s)(.*\\.java):(\\d+):(.*)$"))
|
||||||
, m_javaRegExp(QLatin1String("^(.*\\[javac\\]\\s)(.*\\.java):(\\d+):(.*)$"))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +64,7 @@ void JavaParser::stdError(const QString &line)
|
|||||||
m_javaRegExp.cap(4).trimmed(),
|
m_javaRegExp.cap(4).trimmed(),
|
||||||
Utils::FileName::fromString(file) /* filename */,
|
Utils::FileName::fromString(file) /* filename */,
|
||||||
lineno,
|
lineno,
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE);
|
Constants::TASK_CATEGORY_COMPILE);
|
||||||
emit addTask(task);
|
emit addTask(task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#ifndef JAVAPARSER_H
|
#ifndef JAVAPARSER_H
|
||||||
#define JAVAPARSER_H
|
#define JAVAPARSER_H
|
||||||
|
|
||||||
#include <projectexplorer/ioutputparser.h>
|
#include <projectexplorer/ioutputparser.h>
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
@@ -38,11 +39,13 @@ namespace Internal {
|
|||||||
class JavaParser : public ProjectExplorer::IOutputParser
|
class JavaParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
JavaParser();
|
JavaParser();
|
||||||
virtual void stdOutput(const QString &line);
|
void stdOutput(const QString &line);
|
||||||
virtual void stdError(const QString &line);
|
void stdError(const QString &line);
|
||||||
void setProjectFileList(const QStringList &fileList);
|
void setProjectFileList(const QStringList &fileList);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QRegExp m_javaRegExp;
|
QRegExp m_javaRegExp;
|
||||||
QStringList m_fileList;
|
QStringList m_fileList;
|
||||||
|
|||||||
Reference in New Issue
Block a user