There were also a couple questions about Arrow Opt...
# arrow
s
There were also a couple questions about Arrow Optics code generation in the last months. We currently have a KSP port of the kapt version as a SNAPSHOT on the latest version of Google’s KSP. You can find an example of how it’s set up in the linked
build.gradle.kts
. If you try it, and come across anything broken please let us know 🙂 https://github.com/arrow-kt/backend-arrow-example/blob/86e3bf459a8eda06cd41a17105f807202698cea4/build.gradle.kts#L38
👍 4
🦜 1
👍🏼 1
n
Does it mean that it is finally multiplatform compatible? 🤞🏻
s
It is! Google KSP is capable of generating code for all platforms
🙏 1
🎉 2
It should, since it uses that same code to generate the Optics. It was all already abstracted away from kapt before it was moved. For what type are you trying to generate optics?
t
Copy code
@Serializable
@optics([OpticsTarget.DSL, OpticsTarget.OPTIONAL, OpticsTarget.LENS])
data class OrderReqAdmin(
    val id: Long,
    val packageOrder: PackageOrderReqAdmin? = null,
    val reservation: ReservationReqAdmin? = null,
    val upsales: List<UpsaleReqAdmin>,
    val name: String,
    val email: String?,
    val phone: String?,
    val currency: Currency,
    val notes: Map<NoteType, String>,
    val price: Double,
    val deposit: Double,
    val cancellation: OrderCancellationReq?,
    val status: OrderStatus,
    val paymentMethod: PaymentMethod,
    val paymentMethodDeposit: PaymentMethod,
    val cost: Double,
    val agencyId: Long,
    val isPaidDeposit: Boolean,
    val isPaidRest: Boolean,
    val overrideInvoicePublisher: InvoicePublisher?,
    val overrideVatRate: VatRateOverride?,
    val bons: List<Bon>,
    val language: Language,
    val voucherId: String?,
) {
    companion object
}
This fails for me. I'm gonna double check the configuration. Since it should work, it's probably just some misconfig somewhere.
s
I see, this is somehow failing over the
Iso
restriction but you disabled that target. Let me double check in the code @than_
t
🙏 thanks