Search in sources :

Example 1 with DeployTargetProvider

use of com.android.tools.idea.run.editor.DeployTargetProvider in project intellij by bazelbuild.

the class BlazeAndroidRunConfigurationDeployTargetManager method getDeployTarget.

@Nullable
DeployTarget getDeployTarget(Executor executor, ExecutionEnvironment env, AndroidFacet facet, int runConfigId) throws ExecutionException {
    DeployTargetProvider currentTargetProvider = getCurrentDeployTargetProvider();
    DeployTarget deployTarget;
    if (currentTargetProvider.requiresRuntimePrompt()) {
        deployTarget = currentTargetProvider.showPrompt(executor, env, facet, getDeviceCount(), isAndroidTest, deployTargetStates, runConfigId, (device) -> LaunchCompatibility.YES);
        if (deployTarget == null) {
            return null;
        }
    } else {
        deployTarget = currentTargetProvider.getDeployTarget();
    }
    return deployTarget;
}
Also used : JDOMExternalizable(com.intellij.openapi.util.JDOMExternalizable) ImmutableMap(com.google.common.collect.ImmutableMap) DeployTarget(com.android.tools.idea.run.editor.DeployTarget) ExecutionException(com.intellij.execution.ExecutionException) AndroidFacet(org.jetbrains.android.facet.AndroidFacet) TargetSelectionMode(com.android.tools.idea.run.TargetSelectionMode) DeployTargetState(com.android.tools.idea.run.editor.DeployTargetState) Executor(com.intellij.execution.Executor) InvalidDataException(com.intellij.openapi.util.InvalidDataException) DefaultJDOMExternalizer(com.intellij.openapi.util.DefaultJDOMExternalizer) ValidationError(com.android.tools.idea.run.ValidationError) List(java.util.List) ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) LaunchCompatibility(com.android.tools.idea.run.LaunchCompatibility) Map(java.util.Map) DeployTargetProvider(com.android.tools.idea.run.editor.DeployTargetProvider) WriteExternalException(com.intellij.openapi.util.WriteExternalException) DeviceCount(com.android.tools.idea.run.DeviceCount) Element(org.jdom.Element) Nullable(javax.annotation.Nullable) DeployTargetProvider(com.android.tools.idea.run.editor.DeployTargetProvider) DeployTarget(com.android.tools.idea.run.editor.DeployTarget) Nullable(javax.annotation.Nullable)

Aggregations

DeviceCount (com.android.tools.idea.run.DeviceCount)1 LaunchCompatibility (com.android.tools.idea.run.LaunchCompatibility)1 TargetSelectionMode (com.android.tools.idea.run.TargetSelectionMode)1 ValidationError (com.android.tools.idea.run.ValidationError)1 DeployTarget (com.android.tools.idea.run.editor.DeployTarget)1 DeployTargetProvider (com.android.tools.idea.run.editor.DeployTargetProvider)1 DeployTargetState (com.android.tools.idea.run.editor.DeployTargetState)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ExecutionException (com.intellij.execution.ExecutionException)1 Executor (com.intellij.execution.Executor)1 ExecutionEnvironment (com.intellij.execution.runners.ExecutionEnvironment)1 DefaultJDOMExternalizer (com.intellij.openapi.util.DefaultJDOMExternalizer)1 InvalidDataException (com.intellij.openapi.util.InvalidDataException)1 JDOMExternalizable (com.intellij.openapi.util.JDOMExternalizable)1 WriteExternalException (com.intellij.openapi.util.WriteExternalException)1 List (java.util.List)1 Map (java.util.Map)1 Nullable (javax.annotation.Nullable)1 Element (org.jdom.Element)1 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)1