[KAPT] Suppress resolve error in annotation procssing

#KT-33223
This commit is contained in:
Andrey Zinovyev
2021-02-10 10:59:46 +03:00
committed by GitHub
parent d64f7dd8c7
commit 48ec227aaf
7 changed files with 75 additions and 13 deletions
@@ -49,6 +49,11 @@ public class KaptToolIntegrationTestGenerated extends AbstractKaptToolIntegratio
runTest("plugins/kapt3/kapt3-cli/testData/integration/kotlinFileGeneration/");
}
@TestMetadata("kotlinFileGenerationCorrectErrorTypes")
public void testKotlinFileGenerationCorrectErrorTypes() throws Exception {
runTest("plugins/kapt3/kapt3-cli/testData/integration/kotlinFileGenerationCorrectErrorTypes/");
}
@TestMetadata("kotlinFileGenerationDefaultOutput")
public void testKotlinFileGenerationDefaultOutput() throws Exception {
runTest("plugins/kapt3/kapt3-cli/testData/integration/kotlinFileGenerationDefaultOutput/");
@@ -0,0 +1,28 @@
package test
import apt.Anno
import generated.Test as TestGenerated
import generated.Property
@Anno
class Test {
@field:Anno
val property: String = ""
@Anno
fun function() {
}
}
interface Usage {
fun test(): TestGenerated
fun test1(): generated.Function
fun test2(): Property
}
fun main() {
println("Generated class: " + TestGenerated::class.java.name)
}
@@ -0,0 +1,37 @@
# copy
../kotlinFileGeneration/ap
ap
# mkdir
output/ap
output/stubs
output/classes
output/sources
output/kotlin-sources
# kotlinc
-cp %KOTLIN_STDLIB%
-d output/ap
ap/Processor.kt
# copy
../kotlinFileGeneration/ap/META-INF/services/javax.annotation.processing.Processor
output/ap/META-INF/services/javax.annotation.processing.Processor
# kapt
-Kapt-stubs=output/stubs
-Kapt-classes=output/classes
-Kapt-sources=output/sources
-Kapt-classpath=output/ap
-Kapt-option:kapt.kotlin.generated=output/kotlin-sources
-Kapt-correct-error-types=true
-d output/classes
-cp output/ap:%KOTLIN_STDLIB%
Test.kt
# java
-cp output/classes:output/ap:%KOTLIN_STDLIB%
test.TestKt
# after
Generated class: generated.Test