[Gradle] Fixup testDetectingDifferentClassLoaders in respect of ^KT-50592 and KT-50598
This commit is contained in:
committed by
Space
parent
b1bb68c10f
commit
56fa2655b7
+9
-1
@@ -1035,6 +1035,14 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
}
|
||||
|
||||
build("publish", "-PmppProjectDependency=true") {
|
||||
assertFailed()
|
||||
assertContains(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
||||
}
|
||||
|
||||
//https://youtrack.jetbrains.com/issue/KT-50598
|
||||
val withoutDaemon= defaultBuildOptions().copy(withDaemon = false)
|
||||
|
||||
build("-PmppProjectDependency=true", options = withoutDaemon) {
|
||||
assertSuccessful()
|
||||
assertContains(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
||||
|
||||
@@ -1045,7 +1053,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
}
|
||||
|
||||
// Test the flag that turns off the warnings
|
||||
build("publish", "-PmppProjectDependency=true", "-Pkotlin.pluginLoadedInMultipleProjects.ignore=true") {
|
||||
build("-PmppProjectDependency=true", "-Pkotlin.pluginLoadedInMultipleProjects.ignore=true", options = withoutDaemon) {
|
||||
assertSuccessful()
|
||||
assertNotContains(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
|
||||
assertNotContains(MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_WARNING)
|
||||
|
||||
+1
@@ -273,6 +273,7 @@ internal open class GradleCompilerRunner(
|
||||
|
||||
gradle.taskGraph.allTasks.forEach { task ->
|
||||
val project = task.project
|
||||
// TODO REVIEW: Should this fail or be lenient on isolated classpaths (and therefore failing cast)?
|
||||
if (project.multiplatformExtensionOrNull != null) {
|
||||
// Just record this, we'll process them later
|
||||
val tasksInProject = multiplatformProjectTasks[project] ?: mutableSetOf()
|
||||
|
||||
+4
-1
@@ -11,6 +11,9 @@ import org.gradle.api.plugins.ExtraPropertiesExtension
|
||||
internal class KotlinPluginInMultipleProjectsHolder(
|
||||
private val trackPluginVersionsSeparately: Boolean
|
||||
) {
|
||||
// Storing this property here might be considered the reason
|
||||
// why the corresponding warning message is just shown in the first build
|
||||
// https://youtrack.jetbrains.com/issue/KT-50598
|
||||
private var loadedInProjectPath: String? = null
|
||||
|
||||
fun addProject(
|
||||
@@ -97,4 +100,4 @@ const val MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING: String =
|
||||
const val MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_WARNING: String =
|
||||
"The Kotlin plugin was loaded in the following projects: "
|
||||
|
||||
const val MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_INFO: String = "The full list of projects that loaded the Kotlin plugin is: "
|
||||
const val MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_INFO: String = "The full list of projects that loaded the Kotlin plugin is: "
|
||||
|
||||
Reference in New Issue
Block a user