Confusion around kapt's generated option
See original GitHub issueTrying to use Moshi’s new Kotlin code gen feature, it seems that while the processor runs, the code it generates is going into a black hole somewhere.
It uses kapt’s generated
option to know where to generate code. In gradle, this ends up roughly in $buildDir/generated/source/kaptKotlin/main
. For kotlin, this seems to go nowhere. Not sure if the option just isn’t being set or what.
Option is normally accessed via processingEnv.options["kapt.kotlin.generated"]
See: https://kotlinlang.org/docs/reference/kapt.html#generating-kotlin-sources
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
User Clip: McCain: Travel Ban, Think It Through | C-SPAN.org
How about the next time you do a travel ban, how about thinking it through.
Read more >Urban Redevelopment around Diridon Station
Urban Redevelopment around Diridon Station. Case Study on Gentrification and Displacement Pressures around. Diridon Station of San Jose, CA.
Read more >Austronesian Etymologies: IV - jstor
'leaf covering wrapped around fruits to protect them from bats', 12. Ifugao ... sons proposed here are "counterfeit cognates" produced by the fortuitous....
Read more >The organizational evolution of the international drug trade
This restructuring has produced a move away from formerly hierarchical and tightly controlled organizations, to more loosely coupled and ...
Read more >Mar 22, 2022 Commissioners Court - Harris County, TX
... FLAG THAT THERE HAS BEEN A LOT OF DISCUSSION AND A LOT OF CONFUSION AROUND THE ROLL OVER POLICY. ... WE ARE...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @hzsweers , Kapt can pottentially generate stuff in three different directories:
kapt.kotlin.generated
option path, which kotlin APs should point out to.sources
, which is normally where java APs output appearsclasses
, if you’re generating class or resources files Check more out here.What happens on buck is that kapt has four steps for running (decribed in the link). But you can not know for sure, while on buck, if it will, or will not generate anything.
./buck-out/annotation/libraries/foundation/modelgen/thrifty-utilities/__src_main_kapt_generated__
./buck-out/bin/libraries/foundation/modelgen/thrifty-utilities/__src_main_gen_sources__
./buck-out/gen/libraries/foundation/modelgen/thrifty-utilities/lib__src_main____working_directory
We should probably delete both files at
annotation
andbin
directories at the and of the step, would be cleaner. To make IDE see the files generated by buck kapt, you could add a config for gradle that src files containbuck-out/path/to/your/project/gen/kapt
. The other two paths where they appear are gradle outputs.Hopefully that cleared how the flow works, but anything else please ask. Answering the final question, that doesn’t mean the processor is being called multiple times. But it does indicate you’re running kapt both with buck and with gradle.
Hey - it would be great if someone from the buck team could acknowledge this. It’s a major blocker for kotlin-first annotation processors