Changeset View
Changeset View
Standalone View
Standalone View
plugins/android/androidruntime.cpp
Show All 16 Lines | |||||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "androidruntime.h" | 19 | #include "androidruntime.h" | ||
20 | #include "androidpreferencessettings.h" | 20 | #include "androidpreferencessettings.h" | ||
21 | #include "debug_android.h" | 21 | #include "debug_android.h" | ||
22 | 22 | | |||
23 | #include <KProcess> | 23 | #include <KProcess> | ||
24 | #include <QProcess> | 24 | #include <QProcess> | ||
25 | #include <QUrl> | ||||
25 | 26 | | |||
26 | using namespace KDevelop; | 27 | using namespace KDevelop; | ||
27 | 28 | | |||
28 | AndroidPreferencesSettings* AndroidRuntime::s_settings = nullptr; | 29 | AndroidPreferencesSettings* AndroidRuntime::s_settings = nullptr; | ||
29 | 30 | | |||
30 | AndroidRuntime::AndroidRuntime() | 31 | AndroidRuntime::AndroidRuntime() | ||
31 | : KDevelop::IRuntime() | 32 | : KDevelop::IRuntime() | ||
32 | { | 33 | { | ||
33 | } | 34 | } | ||
34 | 35 | | |||
35 | AndroidRuntime::~AndroidRuntime() | 36 | AndroidRuntime::~AndroidRuntime() | ||
36 | { | 37 | { | ||
37 | } | 38 | } | ||
38 | 39 | | |||
39 | void AndroidRuntime::setEnabled(bool /*enable*/) | 40 | void AndroidRuntime::setEnabled(bool /*enable*/) | ||
40 | { | 41 | { | ||
41 | } | 42 | } | ||
42 | 43 | | |||
43 | static void setEnvironmentVariables(QProcess* process) | 44 | static void setEnvironmentVariables(QProcess* process) | ||
44 | { | 45 | { | ||
45 | auto env = process->processEnvironment(); | 46 | auto env = process->processEnvironment(); | ||
46 | env.insert(QStringLiteral("ANDROID_NDK"), AndroidRuntime::s_settings->ndk()); | 47 | env.insert(QStringLiteral("ANDROID_NDK"), QUrl(AndroidRuntime::s_settings->ndk()).toLocalFile()); | ||
47 | env.insert(QStringLiteral("ANDROID_SDK_ROOT"), AndroidRuntime::s_settings->sdk()); | 48 | env.insert(QStringLiteral("ANDROID_SDK_ROOT"), QUrl(AndroidRuntime::s_settings->sdk()).toLocalFile()); | ||
48 | process->setProcessEnvironment(env); | 49 | process->setProcessEnvironment(env); | ||
49 | } | 50 | } | ||
50 | 51 | | |||
51 | //integrates with ECM | 52 | //integrates with ECM | ||
52 | static QStringList args() | 53 | static QStringList args() | ||
53 | { | 54 | { | ||
54 | return { | 55 | return { | ||
55 | QLatin1String("-DCMAKE_TOOLCHAIN_FILE=") + AndroidRuntime::s_settings->cmakeToolchain(), | 56 | QLatin1String("-DCMAKE_TOOLCHAIN_FILE=") + QUrl(AndroidRuntime::s_settings->cmakeToolchain()).toLocalFile(), | ||
56 | | ||||
57 | QLatin1String("-DANDROID_ABI=") + AndroidRuntime::s_settings->abi(), | 57 | QLatin1String("-DANDROID_ABI=") + AndroidRuntime::s_settings->abi(), | ||
58 | QLatin1String("-DANDROID_NDK=") + AndroidRuntime::s_settings->ndk(), | 58 | QLatin1String("-DANDROID_NDK=") + QUrl(AndroidRuntime::s_settings->ndk()).toLocalFile(), | ||
59 | QLatin1String("-DANDROID_TOOLCHAIN=") + AndroidRuntime::s_settings->toolchain(), | 59 | QLatin1String("-DANDROID_TOOLCHAIN=") + AndroidRuntime::s_settings->toolchain(), | ||
60 | QLatin1String("-DANDROID_API_LEVEL=") + AndroidRuntime::s_settings->api(), | 60 | QLatin1String("-DANDROID_API_LEVEL=") + AndroidRuntime::s_settings->api(), | ||
61 | QLatin1String("-DANDROID_ARCHITECTURE=") + AndroidRuntime::s_settings->arch(), | 61 | QLatin1String("-DANDROID_ARCHITECTURE=") + AndroidRuntime::s_settings->arch(), | ||
62 | QLatin1String("-DANDROID_SDK_BUILD_TOOLS_REVISION=") + AndroidRuntime::s_settings->buildtools() | 62 | QLatin1String("-DANDROID_SDK_BUILD_TOOLS_REVISION=") + AndroidRuntime::s_settings->buildtools() | ||
63 | }; | 63 | }; | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | void AndroidRuntime::startProcess(QProcess* process) const | 66 | void AndroidRuntime::startProcess(QProcess* process) const | ||
Show All 38 Lines |