Skip to content

Commit

Permalink
phonegap: check ANDROID_HOME before show warning WEB-13950
Browse files Browse the repository at this point in the history
  • Loading branch information
anstarovoyt committed May 13, 2015
1 parent 28e3b3b commit 69d46c5
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -19,6 +19,7 @@
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.EnvironmentUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -66,6 +67,7 @@ public class PhoneGapRunConfiguration extends LocatableConfigurationBase {
private static final Set<String> REMOTE_BUILD_PLATFORMS = ContainerUtil.immutableSet(PLATFORM_IOS,
PLATFORM_ANDROID,
PLATFORM_WP_8);
public static final String ANDROID_HOME_VARIABLE = "ANDROID_HOME";

//public for serializer
@Nullable
Expand Down Expand Up @@ -247,7 +249,7 @@ public void checkConfiguration() throws RuntimeConfigurationException {
throwUnsupportedCommandWarning();
}

if (myPlatform.equals(PLATFORM_ANDROID)) {
if (myPlatform.equals(PLATFORM_ANDROID) && StringUtil.isEmpty(EnvironmentUtil.getValue(ANDROID_HOME_VARIABLE))) {
checkExistsSdkWithWarning(PhoneGapAndroidTargets.getAndroidName(), "Cannot detect android SDK in path");
}
if (myPlatform.equals(PLATFORM_IOS)) {
Expand Down

0 comments on commit 69d46c5

Please sign in to comment.