Commit 674ec5ef authored by BogDan Vatra's avatar BogDan Vatra Committed by Daniel Teske

Send static_init_classes paratemer to Android application

Change-Id: I3eba3413464bd0e503f24817769bd3062be0eeb2
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 2112e1e5
......@@ -570,6 +570,11 @@ QString AndroidManager::loadLocalJars(ProjectExplorer::Target *target, int apiLe
return loadLocal(target, apiLevel, Jar);
}
QString AndroidManager::loadLocalJarsInitClasses(ProjectExplorer::Target *target, int apiLevel)
{
return loadLocal(target, apiLevel, Jar, QLatin1String("initClass"));
}
QStringList AndroidManager::availableQtLibs(ProjectExplorer::Target *target)
{
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
......@@ -686,7 +691,7 @@ void AndroidManager::raiseError(const QString &reason)
QMessageBox::critical(0, tr("Error creating Android templates"), reason);
}
QString AndroidManager::loadLocal(ProjectExplorer::Target *target, int apiLevel, ItemType item)
QString AndroidManager::loadLocal(ProjectExplorer::Target *target, int apiLevel, ItemType item, const QString &attribute)
{
QString itemType;
if (item == Lib)
......@@ -717,13 +722,15 @@ QString AndroidManager::loadLocal(ProjectExplorer::Target *target, int apiLevel,
if (libs.contains(element.attribute(QLatin1String("name")))) {
QDomElement libElement = element.firstChildElement(QLatin1String("depends")).firstChildElement(itemType);
while (!libElement.isNull()) {
localLibs += libElement.attribute(QLatin1String("file")).arg(apiLevel) + QLatin1Char(':');
if (libElement.hasAttribute(attribute))
localLibs += libElement.attribute(attribute).arg(apiLevel) + QLatin1Char(':');
libElement = libElement.nextSiblingElement(itemType);
}
libElement = element.firstChildElement(QLatin1String("replaces")).firstChildElement(itemType);
while (!libElement.isNull()) {
localLibs.replace(libElement.attribute(QLatin1String("file")).arg(apiLevel) + QLatin1Char(':'), QString());
if (libElement.hasAttribute(attribute))
localLibs.replace(libElement.attribute(attribute).arg(apiLevel) + QLatin1Char(':'), QString());
libElement = libElement.nextSiblingElement(itemType);
}
}
......
......@@ -102,6 +102,7 @@ public:
static Utils::FileName localLibsRulesFilePath(ProjectExplorer::Target *target);
static QString loadLocalLibs(ProjectExplorer::Target *target, int apiLevel);
static QString loadLocalJars(ProjectExplorer::Target *target, int apiLevel);
static QString loadLocalJarsInitClasses(ProjectExplorer::Target *target, int apiLevel);
static QStringList availableQtLibs(ProjectExplorer::Target *target);
static QStringList qtLibs(ProjectExplorer::Target *target);
......@@ -127,7 +128,7 @@ private:
Lib,
Jar
};
static QString loadLocal(ProjectExplorer::Target *target, int apiLevel, ItemType item);
static QString loadLocal(ProjectExplorer::Target *target, int apiLevel, ItemType item, const QString &attribute=QLatin1String("file"));
class Library
{
......
......@@ -55,6 +55,7 @@ AndroidRunner::AndroidRunner(QObject *parent, AndroidRunConfiguration *runConfig
if ((m_useLocalQtLibs = ds->useLocalQtLibs())) {
m_localLibs = AndroidManager::loadLocalLibs(target, ds->deviceAPILevel());
m_localJars = AndroidManager::loadLocalJars(target, ds->deviceAPILevel());
m_localJarsInitClasses = AndroidManager::loadLocalJarsInitClasses(target, ds->deviceAPILevel());
}
m_intentName = AndroidManager::intentName(target);
m_packageName = m_intentName.left(m_intentName.indexOf(QLatin1Char('/')));
......@@ -198,6 +199,8 @@ void AndroidRunner::asyncStart()
extraParams += QLatin1String(" -e libs_prefix /data/local/qt/");
extraParams += QLatin1String(" -e load_local_libs ") + m_localLibs;
extraParams += QLatin1String(" -e load_local_jars ") + m_localJars;
if (!m_localJarsInitClasses.isEmpty())
extraParams += QLatin1String(" -e static_init_classes ") + m_localJarsInitClasses;
}
extraParams = extraParams.trimmed();
......
......@@ -92,6 +92,7 @@ private:
bool m_useLocalQtLibs;
QString m_localLibs;
QString m_localJars;
QString m_localJarsInitClasses;
QMutex m_mutex;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment