KT-65684: KAPT: (Re)enable fallback to K1 KAPT and make it default
[KAPT] KT-65684 Set languageVersion=1.9 in KaptToolIntegrationTestGenerated
[KAPT] KT-65684 Re-enable a few now-passing tests in Kapt4IT
[KAPT] KT-65684 Fix the logic setting -Xuse-kapt4 flag in Kapt4IT.forceKapt4()
The change is needed to make sure that all the tests have the flag set,
otherwise some of them would silently switch to the fallback node.
Also disables a few now failing tests.
[KAPT] KT-65684 Revert "KT-64385 Enable K2 KAPT by default"
This reverts commit 7e9d6e60
Merge-request: KT-MR-14291
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
e532220305
commit
7ab9e03347
+1
@@ -0,0 +1 @@
|
||||
apt.SampleApt
|
||||
@@ -0,0 +1,34 @@
|
||||
package apt
|
||||
|
||||
import javax.annotation.processing.*
|
||||
import javax.lang.model.SourceVersion
|
||||
import javax.lang.model.element.TypeElement
|
||||
import javax.tools.Diagnostic.Kind.*
|
||||
import javax.tools.StandardLocation
|
||||
|
||||
annotation class Anno
|
||||
|
||||
class SampleApt : AbstractProcessor() {
|
||||
override fun process(annotations: Set<TypeElement>, roundEnv: RoundEnvironment): Boolean {
|
||||
val writeKotlinFiles = processingEnv.options["kapt.test.writeKotlinFiles"] == "true"
|
||||
|
||||
for (element in roundEnv.getElementsAnnotatedWith(Anno::class.java)) {
|
||||
val generatedSimpleName = element.simpleName.toString().capitalize()
|
||||
|
||||
val file = when (writeKotlinFiles) {
|
||||
true -> processingEnv.filer.createResource(StandardLocation.SOURCE_OUTPUT, "generated", "$generatedSimpleName.kt")
|
||||
false -> processingEnv.filer.createSourceFile("generated.$generatedSimpleName")
|
||||
}
|
||||
|
||||
file.openWriter().use {
|
||||
it.write("package generated;\npublic class $generatedSimpleName {}")
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun getSupportedOptions() = setOf("kapt.test.writeKotlinFiles")
|
||||
override fun getSupportedSourceVersion() = SourceVersion.RELEASE_8
|
||||
override fun getSupportedAnnotationTypes() = setOf("apt.Anno")
|
||||
}
|
||||
Reference in New Issue
Block a user