forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.7' into 2.8
This commit is contained in:
@@ -81,6 +81,7 @@ namespace {
|
||||
const QLatin1String OpenJDKLocationKey("OpenJDKLocation");
|
||||
const QLatin1String KeystoreLocationKey("KeystoreLocation");
|
||||
const QLatin1String AutomaticKitCreationKey("AutomatiKitCreation");
|
||||
const QLatin1String MakeExtraSearchDirectory("MakeExtraSearchDirectory");
|
||||
const QLatin1String PartitionSizeKey("PartitionSize");
|
||||
const QLatin1String ToolchainHostKey("ToolchainHost");
|
||||
const QLatin1String ArmToolchainPrefix("arm-linux-androideabi");
|
||||
@@ -156,6 +157,11 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
|
||||
keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString());
|
||||
toolchainHost = settings.value(ToolchainHostKey).toString();
|
||||
automaticKitCreation = settings.value(AutomaticKitCreationKey, true).toBool();
|
||||
QString extraDirectory = settings.value(MakeExtraSearchDirectory).toString();
|
||||
if (extraDirectory.isEmpty())
|
||||
makeExtraSearchDirectories = QStringList();
|
||||
else
|
||||
makeExtraSearchDirectories << extraDirectory;
|
||||
|
||||
PersistentSettingsReader reader;
|
||||
if (reader.load(FileName::fromString(sdkSettingsFileName()))
|
||||
@@ -170,6 +176,11 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
|
||||
QVariant v = reader.restoreValue(AutomaticKitCreationKey);
|
||||
if (v.isValid())
|
||||
automaticKitCreation = v.toBool();
|
||||
QString extraDirectory = reader.restoreValue(MakeExtraSearchDirectory).toString();
|
||||
if (extraDirectory.isEmpty())
|
||||
makeExtraSearchDirectories = QStringList();
|
||||
else
|
||||
makeExtraSearchDirectories << extraDirectory;
|
||||
// persistent settings
|
||||
}
|
||||
|
||||
@@ -628,6 +639,11 @@ QString AndroidConfigurations::bestMatch(const QString &targetAPI) const
|
||||
return QLatin1String("android-8");
|
||||
}
|
||||
|
||||
QStringList AndroidConfigurations::makeExtraSearchDirectories() const
|
||||
{
|
||||
return m_config.makeExtraSearchDirectories;
|
||||
}
|
||||
|
||||
bool equalKits(Kit *a, Kit *b)
|
||||
{
|
||||
return ToolChainKitInformation::toolChain(a) == ToolChainKitInformation::toolChain(b)
|
||||
|
||||
@@ -57,6 +57,7 @@ public:
|
||||
Utils::FileName openJDKLocation;
|
||||
Utils::FileName keystoreLocation;
|
||||
QString toolchainHost;
|
||||
QStringList makeExtraSearchDirectories;
|
||||
unsigned partitionSize;
|
||||
bool automaticKitCreation;
|
||||
};
|
||||
@@ -99,6 +100,8 @@ public:
|
||||
QString startAVD(int *apiLevel, const QString &name = QString()) const;
|
||||
QString bestMatch(const QString &targetAPI) const;
|
||||
|
||||
QStringList makeExtraSearchDirectories() const;
|
||||
|
||||
static ProjectExplorer::Abi::Architecture architectureForToolChainPrefix(const QString &toolchainprefix);
|
||||
static QLatin1String toolchainPrefix(ProjectExplorer::Abi::Architecture architecture);
|
||||
static QLatin1String toolsPrefix(ProjectExplorer::Abi::Architecture architecture);
|
||||
|
||||
@@ -838,8 +838,14 @@ QString AndroidManager::loadLocal(ProjectExplorer::Target *target, int apiLevel,
|
||||
if (libElement.attribute(QLatin1String("bundling")).toInt() == (item == BundledJar ? 1 : 0)) {
|
||||
if (libElement.hasAttribute(attribute)) {
|
||||
QString dependencyLib = libElement.attribute(attribute).arg(apiLevel);
|
||||
if (!dependencyLibs.contains(dependencyLib))
|
||||
if (libElement.hasAttribute(QLatin1String("extends"))) {
|
||||
const QString extends = libElement.attribute(QLatin1String("extends"));
|
||||
if (libs.contains(extends)) {
|
||||
dependencyLibs << dependencyLib;
|
||||
}
|
||||
} else if (!dependencyLibs.contains(dependencyLib)) {
|
||||
dependencyLibs << dependencyLib;
|
||||
}
|
||||
}
|
||||
|
||||
if (libElement.hasAttribute(QLatin1String("replaces"))) {
|
||||
|
||||
@@ -520,12 +520,20 @@ void AndroidPackageCreationStep::collectFiles(QList<DeployItem> *deployList,
|
||||
|
||||
QSet<QString> alreadyListed;
|
||||
foreach (QString bundledFile, m_otherBundledFiles) {
|
||||
if (!bundledFile.endsWith(QLatin1Char('/')))
|
||||
bundledFile.append(QLatin1Char('/'));
|
||||
QStringList allFiles;
|
||||
if (QFileInfo(qtVersionSourcePath + QLatin1Char('/') + bundledFile).isDir()) {
|
||||
if (!bundledFile.endsWith(QLatin1Char('/')))
|
||||
bundledFile.append(QLatin1Char('/'));
|
||||
|
||||
allFiles = collectRelativeFilePaths(qtVersionSourcePath + QLatin1Char('/') + bundledFile);
|
||||
} else {
|
||||
// If we need to bundle a specific file, we just add an empty string and the file
|
||||
// names and data will be prepared correctly in the loop below.
|
||||
allFiles = QStringList(QString());
|
||||
}
|
||||
|
||||
QStringList allFiles = collectRelativeFilePaths(qtVersionSourcePath + QLatin1Char('/') + bundledFile);
|
||||
foreach (QString file, allFiles) {
|
||||
QString fullPath = qtVersionSourcePath + QLatin1Char('/') + bundledFile + QLatin1Char('/') + file;
|
||||
QString fullPath = qtVersionSourcePath + QLatin1Char('/') + bundledFile + file;
|
||||
if (alreadyListed.contains(fullPath))
|
||||
continue;
|
||||
|
||||
@@ -534,22 +542,31 @@ void AndroidPackageCreationStep::collectFiles(QList<DeployItem> *deployList,
|
||||
QString garbledFileName;
|
||||
QString destinationPath;
|
||||
bool shouldStrip = false;
|
||||
if (file.endsWith(QLatin1String(".so"))) {
|
||||
garbledFileName = QLatin1String("lib")
|
||||
+ AndroidManager::libraryPrefix()
|
||||
+ QString(bundledFile).replace(QLatin1Char('/'), QLatin1Char('_'))
|
||||
+ QString(file).replace(QLatin1Char('/'), QLatin1Char('_'));
|
||||
|
||||
QString fullFileName = bundledFile + file;
|
||||
if (fullFileName.endsWith(QLatin1String(".so"))) {
|
||||
if (fullFileName.startsWith(QLatin1String("lib/"))) {
|
||||
// Special case when the destination folder is lib/
|
||||
// Since this is also the source folder, there is no need to garble the file
|
||||
// name and copy it. We also won't have write access to this folder, so we
|
||||
// couldn't if we wanted to.
|
||||
garbledFileName = fullFileName.mid(sizeof("lib/") - 1);
|
||||
} else {
|
||||
garbledFileName = QLatin1String("lib")
|
||||
+ AndroidManager::libraryPrefix()
|
||||
+ QString(fullFileName).replace(QLatin1Char('/'), QLatin1Char('_'));
|
||||
}
|
||||
destinationPath = androidLibPath + QLatin1Char('/') + garbledFileName;
|
||||
shouldStrip = true;
|
||||
} else {
|
||||
garbledFileName = AndroidManager::libraryPrefix() + bundledFile + file;
|
||||
garbledFileName = AndroidManager::libraryPrefix() + QLatin1Char('/') + fullFileName;
|
||||
destinationPath = androidAssetsPath + garbledFileName;
|
||||
}
|
||||
|
||||
deployList->append(DeployItem(fullPath, 0, destinationPath, shouldStrip));
|
||||
pluginsAndImportsList->append(DeployItem(garbledFileName,
|
||||
0,
|
||||
bundledFile + file,
|
||||
fullFileName,
|
||||
shouldStrip));
|
||||
}
|
||||
}
|
||||
@@ -574,6 +591,8 @@ void AndroidPackageCreationStep::removeManagedFilesFromPackage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
removeDirectory(m_androidDir.toString() + QLatin1String("/assets/") + AndroidManager::libraryPrefix());
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::copyFilesIntoPackage(const QList<DeployItem> &deployList)
|
||||
|
||||
@@ -200,9 +200,17 @@ QList<FileName> AndroidToolChain::suggestedMkspecList() const
|
||||
|
||||
QString AndroidToolChain::makeCommand(const Utils::Environment &env) const
|
||||
{
|
||||
QString make = HostOsInfo::isWindowsHost()
|
||||
? QLatin1String("ma-make.exe") : QLatin1String("make");
|
||||
QString tmp = env.searchInPath(make);
|
||||
QStringList extraDirectories = AndroidConfigurations::instance().makeExtraSearchDirectories();
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
QString tmp = env.searchInPath(QLatin1String("ma-make.exe"), extraDirectories);
|
||||
if (!tmp.isEmpty())
|
||||
return tmp;
|
||||
tmp = env.searchInPath(QLatin1String("mingw32-make"), extraDirectories);
|
||||
return tmp.isEmpty() ? QLatin1String("mingw32-make") : tmp;
|
||||
}
|
||||
|
||||
QString make = QLatin1String("make");
|
||||
QString tmp = env.searchInPath(make, extraDirectories);
|
||||
return tmp.isEmpty() ? make : tmp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user