ProjectExplorer: De-virtualize EnvironmentAspect::baseEnvironment

Will help to streamline *EnvironmentAspect constructor signature,
which in turn will help to have a generic cloning mechanism to
clone aspect data, which in turn will help to finally execute on
the idea that RunControls should be re-runnable in their original
setup and also resilient to changes in the setup while they are
running.

Change-Id: Ibdaca487c1f7ce043e675fd014fe923a70273639
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-03-07 09:08:40 +01:00
parent 2f02dcf994
commit ac1b0facc0
16 changed files with 88 additions and 262 deletions

View File

@@ -30,7 +30,6 @@
#include "androidtoolchain.h"
#include "androidmanager.h"
#include "adbcommandswidget.h"
#include "androidrunenvironmentaspect.h"
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/project.h>
@@ -108,7 +107,11 @@ void BaseStringListAspect::setLabel(const QString &label)
AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id)
{
addAspect<AndroidRunEnvironmentAspect>();
enum BaseEnvironmentBase { CleanEnvironmentBase };
auto envAspect = addAspect<EnvironmentAspect>();
envAspect->addSupportedBaseEnvironment(CleanEnvironmentBase, tr("Clean Environment"));
envAspect->setBaseEnvironmentGetter([] { return Utils::Environment(); });
addAspect<ArgumentsAspect>();
auto amStartArgsAspect = addAspect<BaseStringAspect>();