(minor) Improve exception message in case no Android plugin was found
This commit is contained in:
+6
-3
@@ -424,11 +424,14 @@ abstract class AbstractAndroidProjectHandler<V>(private val kotlinConfigurationT
|
|||||||
|
|
||||||
project.afterEvaluate { project ->
|
project.afterEvaluate { project ->
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
val plugin = sequenceOf("android", "android-library", "com.android.test", "com.android.feature")
|
val androidPluginIds = listOf("android", "com.android.application", "android-library", "com.android.library",
|
||||||
|
"com.android.test", "com.android.feature")
|
||||||
|
val plugin = androidPluginIds.asSequence()
|
||||||
.mapNotNull { project.plugins.findPlugin(it) as? BasePlugin }
|
.mapNotNull { project.plugins.findPlugin(it) as? BasePlugin }
|
||||||
.firstOrNull()
|
.firstOrNull()
|
||||||
?: throw InvalidPluginException("The Kotlin Android plugin cannot be used without " +
|
?: throw InvalidPluginException("'kotlin-android' expects one of the Android Gradle " +
|
||||||
"the Android Gradle plugin applied to the project.")
|
"plugins to be applied to the project:\n\t" +
|
||||||
|
androidPluginIds.joinToString("\n\t") { "* $it" })
|
||||||
|
|
||||||
val subpluginEnvironment = loadSubplugins(project)
|
val subpluginEnvironment = loadSubplugins(project)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user