diff options
-rw-r--r-- | src/plugins/android/androiddebugsupport.cpp | 3 | ||||
-rw-r--r-- | src/plugins/android/androiddebugsupport.h | 1 | ||||
-rw-r--r-- | src/plugins/android/androidplugin.cpp | 2 | ||||
-rw-r--r-- | src/plugins/android/androidqmltoolingsupport.cpp | 8 | ||||
-rw-r--r-- | src/plugins/android/androidqmltoolingsupport.h | 1 | ||||
-rw-r--r-- | src/plugins/android/androidrunconfiguration.cpp | 3 | ||||
-rw-r--r-- | src/plugins/android/androidruncontrol.cpp | 3 | ||||
-rw-r--r-- | src/plugins/android/androidruncontrol.h | 1 | ||||
-rw-r--r-- | src/plugins/android/androidrunner.cpp | 2 | ||||
-rw-r--r-- | src/plugins/android/androidrunner.h | 1 | ||||
-rw-r--r-- | src/plugins/android/androidrunnerworker.cpp | 16 | ||||
-rw-r--r-- | src/plugins/android/androidrunnerworker.h | 1 |
12 files changed, 19 insertions, 23 deletions
diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 369beabd54..7b0eafb668 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -100,12 +100,11 @@ static QString toNdkArch(const QString &arch) } AndroidDebugSupport::AndroidDebugSupport(RunControl *runControl, const QString &intentName, - const QString &extraAppParams, const Utils::Environment &extraEnvVars) : Debugger::DebuggerRunTool(runControl) { setDisplayName("AndroidDebugger"); - m_runner = new AndroidRunner(runControl, intentName, extraAppParams, extraEnvVars); + m_runner = new AndroidRunner(runControl, intentName, extraEnvVars); addStartDependency(m_runner); } diff --git a/src/plugins/android/androiddebugsupport.h b/src/plugins/android/androiddebugsupport.h index 81351836f7..9f6aa3981e 100644 --- a/src/plugins/android/androiddebugsupport.h +++ b/src/plugins/android/androiddebugsupport.h @@ -38,7 +38,6 @@ class AndroidDebugSupport : public Debugger::DebuggerRunTool public: AndroidDebugSupport(ProjectExplorer::RunControl *runControl, const QString &intentName = QString(), - const QString &extraAppParams = QString(), const Utils::Environment &extraEnvVars = Utils::Environment()); void start() override; diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp index 2494ae79ba..70d247476d 100644 --- a/src/plugins/android/androidplugin.cpp +++ b/src/plugins/android/androidplugin.cpp @@ -107,7 +107,7 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa RunControl::registerWorker(QML_PREVIEW_RUN_MODE, [](RunControl *runControl) -> RunWorker* { const Runnable runnable = runControl->runConfiguration()->runnable(); - return new AndroidQmlToolingSupport(runControl, runnable.executable, runnable.commandLineArguments); + return new AndroidQmlToolingSupport(runControl, runnable.executable); }, [](RunConfiguration *runConfig) { return runConfig->isEnabled() && runConfig->id().name().startsWith("QmlProjectManager.QmlRunConfiguration") diff --git a/src/plugins/android/androidqmltoolingsupport.cpp b/src/plugins/android/androidqmltoolingsupport.cpp index d46311b2a4..0dbfe82a69 100644 --- a/src/plugins/android/androidqmltoolingsupport.cpp +++ b/src/plugins/android/androidqmltoolingsupport.cpp @@ -31,14 +31,14 @@ using namespace ProjectExplorer; namespace Android { namespace Internal { -AndroidQmlToolingSupport::AndroidQmlToolingSupport( - RunControl *runControl, const QString &intentName, const QString &extraAppParams, - const Utils::Environment &extraEnvVars) +AndroidQmlToolingSupport::AndroidQmlToolingSupport(RunControl *runControl, + const QString &intentName, + const Utils::Environment &extraEnvVars) : RunWorker(runControl) { setDisplayName("AndroidQmlToolingSupport"); - auto runner = new AndroidRunner(runControl, intentName, extraAppParams, extraEnvVars); + auto runner = new AndroidRunner(runControl, intentName, extraEnvVars); addStartDependency(runner); auto profiler = runControl->createWorker(runControl->runMode()); diff --git a/src/plugins/android/androidqmltoolingsupport.h b/src/plugins/android/androidqmltoolingsupport.h index 2d71ec48b3..e8cb911a53 100644 --- a/src/plugins/android/androidqmltoolingsupport.h +++ b/src/plugins/android/androidqmltoolingsupport.h @@ -38,7 +38,6 @@ class AndroidQmlToolingSupport : public ProjectExplorer::RunWorker public: explicit AndroidQmlToolingSupport( ProjectExplorer::RunControl *runControl, const QString &intentName = QString(), - const QString &extraAppParams = QString(), const Utils::Environment &extraEnvVars = Utils::Environment()); private: diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index 65505992fa..c3d394eb56 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -110,6 +110,8 @@ void BaseStringListAspect::setLabel(const QString &label) AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id) : RunConfiguration(target, id) { + addExtraAspect(new ArgumentsAspect(this)); + auto amStartArgsAspect = new BaseStringAspect(this); amStartArgsAspect->setId(Constants::ANDROID_AMSTARTARGS); amStartArgsAspect->setSettingsKey("Android.AmStartArgsKey"); @@ -141,6 +143,7 @@ QWidget *AndroidRunConfiguration::createConfigurationWidget() auto widget = new QWidget; auto layout = new QFormLayout(widget); + extraAspect<ArgumentsAspect>()->addToConfigurationLayout(layout); extraAspect(Constants::ANDROID_AMSTARTARGS)->addToConfigurationLayout(layout); auto warningIconLabel = new QLabel; diff --git a/src/plugins/android/androidruncontrol.cpp b/src/plugins/android/androidruncontrol.cpp index 5c5f0e6a5e..d247754eeb 100644 --- a/src/plugins/android/androidruncontrol.cpp +++ b/src/plugins/android/androidruncontrol.cpp @@ -39,9 +39,8 @@ namespace Android { namespace Internal { AndroidRunSupport::AndroidRunSupport(RunControl *runControl, const QString &intentName, - const QString &extraAppParams, const Utils::Environment &extraEnvVars) - : AndroidRunner(runControl, intentName, extraAppParams, extraEnvVars) + : AndroidRunner(runControl, intentName, extraEnvVars) { runControl->setIcon(Utils::Icons::RUN_SMALL_TOOLBAR); } diff --git a/src/plugins/android/androidruncontrol.h b/src/plugins/android/androidruncontrol.h index 974367929b..ddaa07aa8a 100644 --- a/src/plugins/android/androidruncontrol.h +++ b/src/plugins/android/androidruncontrol.h @@ -41,7 +41,6 @@ class AndroidRunSupport : public AndroidRunner public: explicit AndroidRunSupport(ProjectExplorer::RunControl *runControl, const QString &intentName = QString(), - const QString &extraAppParams = QString(), const Utils::Environment &extraEnvVars = Utils::Environment()); ~AndroidRunSupport() override; diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp index c7ad648240..0c89b8a490 100644 --- a/src/plugins/android/androidrunner.cpp +++ b/src/plugins/android/androidrunner.cpp @@ -120,7 +120,6 @@ namespace Internal { AndroidRunner::AndroidRunner(RunControl *runControl, const QString &intentName, - const QString &extraAppParams, const Utils::Environment &extraEnvVars) : RunWorker(runControl), m_target(runControl->runConfiguration()->target()) { @@ -145,7 +144,6 @@ AndroidRunner::AndroidRunner(RunControl *runControl, m_worker.reset(new AndroidRunnerWorker(this, m_packageName)); m_worker->setIntentName(intent); m_worker->setIsPreNougat(apiLevel <= 23); - m_worker->setExtraAppParams(extraAppParams); m_worker->setExtraEnvVars(extraEnvVars); m_worker->moveToThread(&m_thread); diff --git a/src/plugins/android/androidrunner.h b/src/plugins/android/androidrunner.h index c1cd170c68..c4a5763cb6 100644 --- a/src/plugins/android/androidrunner.h +++ b/src/plugins/android/androidrunner.h @@ -51,7 +51,6 @@ class AndroidRunner : public ProjectExplorer::RunWorker public: explicit AndroidRunner(ProjectExplorer::RunControl *runControl, const QString &intentName = QString(), - const QString &extraAppParams = QString(), const Utils::Environment &extraEnvVars = Utils::Environment()); ~AndroidRunner() override; diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 492baf8b1e..794aead4fc 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -31,6 +31,7 @@ #include "androidrunconfiguration.h" #include <debugger/debuggerrunconfigurationaspect.h> +#include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> #include <qtsupport/baseqtversion.h> #include <qtsupport/qtkitinformation.h> @@ -38,6 +39,7 @@ #include <utils/runextensions.h> #include <utils/synchronousprocess.h> #include <utils/temporaryfile.h> +#include <utils/qtcprocess.h> #include <utils/url.h> #include <QLoggingCategory> @@ -191,6 +193,8 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa m_deviceSerialNumber = AndroidManager::deviceSerialNumber(target); m_apiLevel = AndroidManager::deviceApiLevel(target); + m_extraAppParams = runConfig->runnable().commandLineArguments; + if (auto aspect = runConfig->extraAspect(Constants::ANDROID_AMSTARTARGS)) m_amStartExtraArgs = static_cast<BaseStringAspect *>(aspect)->value().split(' '); @@ -456,9 +460,13 @@ void AndroidRunnerWorker::asyncStartHelper() .arg(m_qmlServer.port()).arg(QmlDebug::qmlDebugServices(m_qmlDebugServices)); } + if (!m_extraAppParams.isEmpty()) { + QStringList appArgs = + Utils::QtcProcess::splitArgs(m_extraAppParams, Utils::OsType::OsTypeLinux); + qCDebug(androidRunWorkerLog) << "Using application arguments: " << appArgs; args << "-e" << "extraappparams" - << QString::fromLatin1(m_extraAppParams.toUtf8().toBase64()); + << QString::fromLatin1(appArgs.join(' ').toUtf8().toBase64()); } if (m_extraEnvVars.size() > 0) { @@ -606,11 +614,5 @@ void AndroidRunnerWorker::setExtraEnvVars(const Utils::Environment &extraEnvVars << extraEnvVars.toStringList(); } -void AndroidRunnerWorker::setExtraAppParams(const QString &extraAppParams) -{ - m_extraAppParams = extraAppParams; -} - - } // namespace Internal } // namespace Android diff --git a/src/plugins/android/androidrunnerworker.h b/src/plugins/android/androidrunnerworker.h index e34207bf03..737a0963fb 100644 --- a/src/plugins/android/androidrunnerworker.h +++ b/src/plugins/android/androidrunnerworker.h @@ -56,7 +56,6 @@ public: void logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError); void setAndroidDeviceInfo(const AndroidDeviceInfo &info); void setExtraEnvVars(const Utils::Environment &extraEnvVars); - void setExtraAppParams(const QString &extraAppParams); void setIsPreNougat(bool isPreNougat) { m_isPreNougat = isPreNougat; } void setIntentName(const QString &intentName) { m_intentName = intentName; } |