Android Extensions: Explicitly check if the Android plugin is enabled (EA-104651)

AndroidGradleOrderEnumerationHandler is defined in gradle.xml that doesn't depend on the Android plugin.
So we need to additionally check if the Android plugin is installed/enabled.
This commit is contained in:
Yan Zhulanow
2018-06-15 17:02:49 +03:00
parent d35a92a81d
commit 4aa7a95055
2 changed files with 15 additions and 2 deletions
@@ -0,0 +1,14 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.core
import com.intellij.facet.FacetManager
import com.intellij.openapi.module.Module
fun Module.isAndroidModule(): Boolean {
val facets = FacetManager.getInstance(this).allFacets
return facets.any { it.javaClass.simpleName == "AndroidFacet" }
}