Daniel TIefenauer
12/28/2023, 1:19 PMbuild.gradle.kts
(the version is 1.2.0
and provided through version catalog):
plugins {
kotlin("jvm") version "1.9.21"
id("com.google.devtools.ksp") version "1.8.21-1.0.11"
}
dependencies {
implementation(libs.arrow.optics)
implementation(libs.arrow.optics.ksp.plugin)
}
I then created some data classes annotated with `@optics`:
@optics data class InsurancePolicy(val policyNumber: String, val insurant: Insurant, val vehicle: Vehicle) {companion object}
@optics data class Insurant(val firstName: String, val lastName: String, val address: Address) {companion object}
@optics data class Vehicle(val make: String, val model: String, val horsePower: Int) {companion object}
@optics data class Address(val street: String, val streetNumber: String, val zip: String, val city: String) {companion object}
but none of the companion object's properties seem to be generated (e.g. InsurandPolicy.insurant
is not found)Gemy
12/28/2023, 1:20 PMDaniel TIefenauer
12/28/2023, 1:29 PMksp-1.8.21-1.0.11 is too old for kotlin-1.9.21. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.21.
but even after upgrading to
id("com.google.devtools.ksp") version "1.9.21-1.0.16"
no code seems to be generatedDaniel TIefenauer
12/28/2023, 1:51 PMimplementation(libs.arrow.optics.ksp.plugin)
should be
ksp(libs.arrow.optics.ksp.plugin)
after fixing this and upgrading the plugin it now worksGemy
12/28/2023, 1:55 PM