sergei-lapin / napt

Alternative to KAPT that skips Java stub generation and therefore is as efficient as Java APT but with Kotlin
MIT License
88 stars 6 forks source link

Is there any way to support DataBinding? #10

Closed Goooler closed 2 years ago

Goooler commented 2 years ago

We are migrating from DataBinding to Compose in a large codebase, but still need Kapt to generate stubs for bindings, is there any way to replace Kapt with Napt?

sergei-lapin commented 2 years ago

Hi, @Goooler I've updated sample so that to check whether napt works with data binding or not, and, as per my experience — it does.

Goooler commented 2 years ago

Thanks for your help, I'll try it and give feedback.

Goooler commented 2 years ago

Seems no BR generated, see https://github.com/Goooler/DemoApp/pull/225#issuecomment-1255978440

sergei-lapin commented 2 years ago

BR is generated.
But, it can be referenced only from Java code, since there's no kapt.
See MainActivityComponentBridge for reference.
I'm closing this one.

Goooler commented 2 years ago

I've rechecked, in my case, BR classes were generated in all modules but Main where the BR actually be used.

sergei-lapin commented 2 years ago

BR is generated if you do it right. Снимок экрана 2022-09-23 в 17 58 17 Снимок экрана 2022-09-23 в 17 58 50 Снимок экрана 2022-09-23 в 17 59 05

Снимок экрана 2022-09-23 в 17 59 14
Goooler commented 2 years ago

You are right, I should declare BRBridge first, thanks for your patience!