forked from qt-creator/qt-creator
Android: Fix Sdk manager system environment
Android native tools fail if JAVA_HOME environment variable is not defined Task-number: QTCREATORBUG-19072 Change-Id: I3db910b34d9bdd9ebc9ba052b5300ecf5ef3ce15 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/runextensions.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDirIterator>
|
||||
@@ -1070,6 +1071,19 @@ bool AndroidConfigurations::force32bitEmulator()
|
||||
return m_instance->m_force32bit;
|
||||
}
|
||||
|
||||
QProcessEnvironment AndroidConfigurations::toolsEnvironment(const AndroidConfig &config)
|
||||
{
|
||||
Environment env = Environment::systemEnvironment();
|
||||
Utils::FileName jdkLocation = config.openJDKLocation();
|
||||
if (!jdkLocation.isEmpty()) {
|
||||
env.set("JAVA_HOME", jdkLocation.toUserOutput());
|
||||
Utils::FileName binPath = jdkLocation;
|
||||
binPath.appendPath("bin");
|
||||
env.prependOrSetPath(binPath.toUserOutput());
|
||||
}
|
||||
return env.toProcessEnvironment();
|
||||
}
|
||||
|
||||
/**
|
||||
* Workaround for '????????????' serial numbers
|
||||
* @return ("-d") for buggy devices, ("-s", <serial no>) for normal
|
||||
|
||||
Reference in New Issue
Block a user