Restore 'KotlinGradleSubplugin' as marker interface.
This avoids build failure in 'buildSrc' module with 'kotlin-dsl' applied with 'ClassNotFound' exception. ^KT-51378 Fixed
This commit is contained in:
+7
@@ -116,3 +116,10 @@ interface KotlinCompilerPluginSupportPlugin : Plugin<Project> {
|
|||||||
open class SubpluginArtifact(val groupId: String, val artifactId: String, val version: String? = null)
|
open class SubpluginArtifact(val groupId: String, val artifactId: String, val version: String? = null)
|
||||||
|
|
||||||
class JetBrainsSubpluginArtifact(artifactId: String) : SubpluginArtifact(groupId = "org.jetbrains.kotlin", artifactId = artifactId)
|
class JetBrainsSubpluginArtifact(artifactId: String) : SubpluginArtifact(groupId = "org.jetbrains.kotlin", artifactId = artifactId)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marker interface left here for backward compatibility with older plugin versions.
|
||||||
|
* Remove once minimal supported Gradle version will use Kotlin 1.7+.
|
||||||
|
*/
|
||||||
|
@Deprecated(level = DeprecationLevel.HIDDEN, message = "")
|
||||||
|
interface KotlinGradleSubplugin
|
||||||
|
|||||||
+32
-1
@@ -11,7 +11,6 @@ import org.jetbrains.kotlin.gradle.testbase.*
|
|||||||
import org.jetbrains.kotlin.gradle.util.checkBytecodeContains
|
import org.jetbrains.kotlin.gradle.util.checkBytecodeContains
|
||||||
import org.jetbrains.kotlin.test.util.JUnit4Assertions.assertTrue
|
import org.jetbrains.kotlin.test.util.JUnit4Assertions.assertTrue
|
||||||
import org.junit.jupiter.api.DisplayName
|
import org.junit.jupiter.api.DisplayName
|
||||||
import kotlin.io.path.readText
|
|
||||||
|
|
||||||
@DisplayName("Other plugins tests")
|
@DisplayName("Other plugins tests")
|
||||||
@OtherGradlePluginTests
|
@OtherGradlePluginTests
|
||||||
@@ -212,4 +211,36 @@ class SubpuginsIT : KGPBaseTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DisplayName("KT-51378: Using 'kotlin-dsl' with latest plugin version in buildSrc module")
|
||||||
|
@GradleTestVersions(
|
||||||
|
minVersion = TestVersions.Gradle.G_6_8 // Gradle usage of sam-with-receivers subplugin was added in this version
|
||||||
|
)
|
||||||
|
@GradleTest
|
||||||
|
fun testBuildSrcKotlinDSL(gradleVersion: GradleVersion) {
|
||||||
|
project("buildSrcUsingKotlinCompilationAndKotlinPlugin", gradleVersion) {
|
||||||
|
subProject("buildSrc").buildGradleKts.modify {
|
||||||
|
//language=kts
|
||||||
|
"""
|
||||||
|
${it.substringBefore("}")}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
val kotlin_version: String by extra
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${'$'}kotlin_version")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
${it.substringAfter("}")}
|
||||||
|
""".trimIndent()
|
||||||
|
}
|
||||||
|
|
||||||
|
build("assemble")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user