Vitali Plagov
12/09/2021, 2:39 PMbuild.gradle
has this:
plugins {
id "org.jetbrains.kotlin.kapt" version "1.6.0"
}
dependencies {
implementation "io.arrow-kt:arrow-core:1.0.1"
implementation "io.arrow-kt:arrow-optics:1.0.1"
kapt "io.arrow-kt:arrow-meta:1.0.1"
}
Then, all data classes are annotated with @optics
and have a companion object
// showing a simple data class for brevity reasons
@optics
data class Mapping(
val type: MappingType,
val values: List<String>
) {
companion object
}
Next, in my class when I’m trying to do this:
val updatedMapping = Mapping.
no fields (type
or values
) are shown after .
Am I missing something?simon.vergauwen
12/09/2021, 2:45 PMkapt
and I had to apply idea
gradle plugin.
Can you see the generated code in build/generated/kapt
?Vitali Plagov
12/09/2021, 2:49 PMkapt
under build/generated
Do I have to run any gradle command or anything else once I added dependencies and annotations? I just reloaded all gradle projects and still nothing under that dirVitali Plagov
12/09/2021, 2:58 PMcompileTestjava
gradle task and it worksVitali Plagov
12/09/2021, 2:59 PMsimon.vergauwen
12/09/2021, 3:00 PMJava annotation processing
it runs and generate actual files on-the-fly but the code is only generated after the compiler has been invoked once.Vitali Plagov
12/09/2021, 3:04 PMsimon.vergauwen
12/09/2021, 3:08 PMVitali Plagov
12/09/2021, 3:09 PMsimon.vergauwen
12/10/2021, 7:32 AMVitali Plagov
12/10/2021, 7:33 AMthanh
12/11/2021, 8:20 AMsourceSets {
debug {
java.srcDir(file("build/generated/source/kapt/main"))
}
}