Kapt: remove tests on old JVM backend

#KT-64680
This commit is contained in:
Alexander Udalov
2024-01-02 17:15:01 +01:00
committed by Space Team
parent eea89c7f23
commit e4a608c6e7
17 changed files with 10 additions and 978 deletions
@@ -140,10 +140,6 @@ open class Kapt3ClassLoadersCacheIT : Kapt3IT() {
override fun testRepeatableAnnotations(gradleVersion: GradleVersion) {
}
@Disabled("classloaders cache is leaking file descriptors that prevents cleaning test project")
override fun testRepeatableAnnotationsWithOldJvmBackend(gradleVersion: GradleVersion) {
}
@Disabled("classloaders cache is leaking file descriptors that prevents cleaning test project")
override fun useGeneratedKotlinSource(gradleVersion: GradleVersion) {
}
@@ -1206,17 +1202,6 @@ open class Kapt3IT : Kapt3BaseIT() {
}
}
@DisplayName("KT-53135: check that JVM IR backend is disabled if kapt.use.jvm.ir=false is specified in gradle.properties")
@GradleTest
open fun testRepeatableAnnotationsWithOldJvmBackend(gradleVersion: GradleVersion) {
project("repeatableAnnotationsWithOldJvmBackend".withPrefix, gradleVersion) {
build("build") {
assertKaptSuccessful()
assertTasksExecuted(":kaptGenerateStubsKotlin", ":kaptKotlin", ":compileKotlin")
}
}
}
@DisplayName("KT-55452: KaptGenerateStubs task compiler options are not duplicated")
@GradleTest
fun testKaptGenerateStubsCompilerOptionsDup(gradleVersion: GradleVersion) {
@@ -33,9 +33,6 @@ class Kapt4IT : Kapt3IT() {
@Disabled("Doesn't make sense in Kapt 4")
override fun useK2KaptProperty(gradleVersion: GradleVersion) {}
@Disabled("Doesn't make sense in Kapt 4")
override fun testRepeatableAnnotationsWithOldJvmBackend(gradleVersion: GradleVersion) {}
@DisplayName("KT-61879: K2 KAPT works with proguarded compiler jars and enum class")
@GradleTest
fun testEnumClass(gradleVersion: GradleVersion) {
@@ -69,9 +66,6 @@ class Kapt4ClassLoadersCacheIT : Kapt3ClassLoadersCacheIT() {
@Disabled("Doesn't make sense in Kapt 4")
override fun fallBackModeWithLanguageVersion2_0(gradleVersion: GradleVersion) {}
@Disabled("Doesn't make sense in Kapt 4")
override fun testRepeatableAnnotationsWithOldJvmBackend(gradleVersion: GradleVersion) {}
@Disabled("Doesn't work in 2.0. Neither with Kapt 3 nor with Kapt 4")
override fun testMPPKaptPresence(gradleVersion: GradleVersion) {}
@@ -1,17 +0,0 @@
plugins {
id "java"
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.kapt"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation(project(":processor"))
kapt(project(":processor"))
}
compileKotlin.kotlinOptions.allWarningsAsErrors = true
@@ -1,11 +0,0 @@
plugins {
id "java"
id "org.jetbrains.kotlin.jvm"
}
repositories {
mavenLocal()
mavenCentral()
}
compileKotlin.kotlinOptions.allWarningsAsErrors = true
@@ -1,34 +0,0 @@
package processor
import javax.annotation.processing.AbstractProcessor
import javax.annotation.processing.RoundEnvironment
import javax.lang.model.SourceVersion
import javax.lang.model.element.TypeElement
import javax.tools.Diagnostic
class CheckAnnotationIsNotRepeated : AbstractProcessor() {
override fun process(annotations: MutableSet<out TypeElement>?, roundEnv: RoundEnvironment): Boolean {
val element = processingEnv.elementUtils.getTypeElement("example.TestClass")
val containerAnnotation = element.annotationMirrors.singleOrNull {
it.annotationType.asElement().simpleName.contentEquals("Container") &&
it.annotationType.asElement().enclosingElement.simpleName.contentEquals("Anno")
}
if (containerAnnotation != null) {
processingEnv.messager.printMessage(
Diagnostic.Kind.ERROR,
"Repeatable container annotation class example.Anno.Container is found. " +
"The problem is likely in the fact that JVM IR is NOT DISABLED for kapt stub generation " +
"even though kapt.use.jvm.ir=false is specified in gradle.properties.",
element,
)
}
return true
}
override fun getSupportedSourceVersion(): SourceVersion =
SourceVersion.RELEASE_6
override fun getSupportedAnnotationTypes(): Set<String> =
setOf("example.ToBeChecked")
}
@@ -1,11 +0,0 @@
package example
annotation class ToBeChecked
@Repeatable
annotation class Anno(val value: String)
@ToBeChecked
@Anno("1")
@Anno("2")
public class TestClass