Fix and refactor scripting subplugin application logic

so warning is not shown when discovery configuration is not populated
fix #KT-31124
refactor code for clarity on the way
also apply scripting subplugin after main plugin to ensure that
configurations are created before scripting is initialized
This commit is contained in:
Ilya Chernikov
2019-04-23 13:58:44 +02:00
parent 917fc56f36
commit c3a439a829
3 changed files with 24 additions and 11 deletions
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.gradle
import org.gradle.api.logging.LogLevel
import org.jetbrains.kotlin.gradle.plugin.MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING
import org.jetbrains.kotlin.gradle.plugin.MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_WARNING
import org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin
import org.jetbrains.kotlin.gradle.tasks.USING_JVM_INCREMENTAL_COMPILATION_MESSAGE
import org.jetbrains.kotlin.gradle.util.*
import org.junit.Test
@@ -995,4 +996,12 @@ class KotlinGradleIT : BaseGradleIT() {
assertSuccessful()
}
}
@Test
fun testNoScriptingWarning() = with(Project("simpleProject")) {
// KT-31124
build {
assertNotContains(ScriptingGradleSubplugin.MISCONFIGURATION_MESSAGE_SUFFIX)
}
}
}