From ec73f40c0c616b263face714c2f23afbb68e9271 Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Fri, 3 Jun 2022 14:16:35 +0200 Subject: [PATCH] Fix Gradle plugin inputs validation issue Also add '@Internal' annotation in interface, so it propagated to all inheritors. ^KT-52448 Fixed --- .../kotlin/gradle/tasks/KotlinTaskConfigs.kt | 6 ++++++ .../kotlin/gradle/SimpleKotlinGradleIT.kt | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/KotlinTaskConfigs.kt b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/KotlinTaskConfigs.kt index 9b3e5faf31d3f..ff633d8e89210 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/KotlinTaskConfigs.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/KotlinTaskConfigs.kt @@ -43,6 +43,12 @@ interface KotlinCompileTool : PatternFilterable, Task { @get:OutputDirectory val destinationDirectory: DirectoryProperty + + @Internal + override fun getExcludes(): MutableSet + + @Internal + override fun getIncludes(): MutableSet } interface BaseKotlinCompile : KotlinCompileTool { diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SimpleKotlinGradleIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SimpleKotlinGradleIT.kt index 041f6d21a701f..b133336dbce6a 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SimpleKotlinGradleIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SimpleKotlinGradleIT.kt @@ -226,4 +226,21 @@ class SimpleKotlinGradleIT : KGPBaseTest() { } } } + + @DisplayName("Validate Gradle plugins inputs") + @GradleTestVersions(minVersion = TestVersions.Gradle.MAX_SUPPORTED) // Always should use only latest Gradle version + @GradleTest + internal fun validatePluginInputs(gradleVersion: GradleVersion) { + project("kotlinProject", gradleVersion) { + buildGradle.modify { + """ + plugins { + id "validate-external-gradle-plugin" + ${it.substringAfter("plugins {")} + """.trimIndent() + } + + build("validateExternalPlugins") + } + } }