Commit ac3831d3 authored by BogDan Vatra's avatar BogDan Vatra Committed by Daniel Teske
Browse files

Set env vars every time.



Change-Id: I1196929031bd754dcbb7a52799dbb2d1b67df776
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent be2176f1
......@@ -260,6 +260,15 @@ void AndroidPackageCreationWidget::initGui()
m_ui->prebundledLibsListView->setModel(m_prebundledLibs);
m_ui->permissionsListView->setModel(m_permissionsModel);
m_ui->KeystoreLocationLineEdit->setText(m_step->keystorePath().toUserOutput());
// Make the buildconfiguration emit a evironmentChanged() signal
// TODO find a better way
Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
if (!bc)
return;
bool use = bc->useSystemEnvironment();
bc->setUseSystemEnvironment(!use);
bc->setUseSystemEnvironment(use);
}
void AndroidPackageCreationWidget::updateAndroidProjectInfo()
......
......@@ -29,11 +29,24 @@
#include "androidqtversion.h"
#include "androidconstants.h"
#include "qt4projectmanager/qt4projectmanagerconstants.h"
#include "androidconfigurations.h"
#include "androidmanager.h"
#include <utils/environment.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
#include <qtsupport/qtversionmanager.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/projectexplorer.h>
using namespace Android::Internal;
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
AndroidQtVersion::AndroidQtVersion()
: QtSupport::BaseQtVersion()
......@@ -80,6 +93,31 @@ QList<ProjectExplorer::Abi> AndroidQtVersion::detectQtAbis() const
32);
}
void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const
{
QString ndk_host = QLatin1String(
#if defined(Q_OS_LINUX)
"linux-x86"
#elif defined(Q_OS_WIN)
"windows"
#elif defined(Q_OS_MAC)
"darwin-x86"
#endif
);
// this env vars are used by qmake mkspecs to generate makefiles (check QTDIR/mkspecs/android-g++/qmake.conf for more info)
env.set(QLatin1String("ANDROID_NDK_HOST"), ndk_host);
env.set(QLatin1String("ANDROID_NDK_ROOT"), AndroidConfigurations::instance().config().ndkLocation.toUserOutput());
Qt4Project *qt4pro = qobject_cast<Qt4ProjectManager::Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
if (!qt4pro || !qt4pro->activeTarget()
|| QtSupport::QtKitInformation::qtVersion(k)->type() != QLatin1String(Constants::ANDROIDQT))
return;
env.set(QLatin1String("ANDROID_NDK_PLATFORM"),
AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(qt4pro->activeTarget())));
}
QString AndroidQtVersion::description() const
{
//: Qt Version is meant for Android
......
......@@ -52,6 +52,8 @@ public:
QList<ProjectExplorer::Abi> detectQtAbis() const;
void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const;
Core::FeatureSet availableFeatures() const;
QString platformName() const;
QString platformDisplayName() const;
......
......@@ -30,15 +30,16 @@
#include "androidtoolchain.h"
#include "androidconstants.h"
#include "androidconfigurations.h"
#include "androidmanager.h"
#include "androidqtversion.h"
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <qt4projectmanager/qt4project.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h>
#include <utils/environment.h>
#include <utils/hostosinfo.h>
......@@ -52,7 +53,6 @@ namespace Android {
namespace Internal {
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace Utils;
static const char ANDROID_QT_VERSION_KEY[] = "Qt4ProjectManager.Android.QtVersion";
......@@ -92,11 +92,6 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
// TODO this vars should be configurable in projects -> build tab
// TODO invalidate all .pro files !!!
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
if (!qt4pro || !qt4pro->activeTarget()
|| QtSupport::QtKitInformation::qtVersion(qt4pro->activeTarget()->kit())->type() != QLatin1String(Constants::ANDROIDQT))
return;
QString ndkHost;
switch (HostOsInfo::hostOs()) {
case HostOsInfo::HostOsLinux:
......@@ -111,15 +106,10 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
default:
break;
}
// this env vars are used by qmake mkspecs to generate makefiles (check QTDIR/mkspecs/android-g++/qmake.conf for more info)
env.set(QLatin1String("ANDROID_NDK_HOST"), ndkHost);
env.set(QLatin1String("ANDROID_NDK_ROOT"), AndroidConfigurations::instance().config().ndkLocation.toUserOutput());
env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_PREFIX"), AndroidConfigurations::toolchainPrefix(targetAbi().architecture()));
env.set(QLatin1String("ANDROID_NDK_TOOLS_PREFIX"), AndroidConfigurations::toolsPrefix(targetAbi().architecture()));
env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_VERSION"), AndroidConfigurations::instance().config().ndkToolchainVersion);
env.set(QLatin1String("ANDROID_NDK_PLATFORM"),
AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(qt4pro->activeTarget())));
}
bool AndroidToolChain::operator ==(const ToolChain &tc) const
......
......@@ -55,7 +55,7 @@ public:
QVariantMap toMap() const;
bool fromMap(const QVariantMap &data);
QList<Utils::FileName> suggestedMkspecList() const;
QString makeCommand(const Utils::Environment &env) const;
QString makeCommand(const Utils::Environment &environment) const;
void setQtVersionId(int);
int qtVersionId() const;
......
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