AMIT SHEKHAR’s Post

View profile for AMIT SHEKHAR

Co-Founder @ Outcome School | Coder | Teacher | Mentor | Open Source | IIT 2010-14 | Android | Machine Learning | Backend

Understanding annotationProcessor, kapt, ksp in Gradle In Gradle, annotationProcessor is a dependency configuration used for specifying dependencies that are annotation processors. Annotation processors are tools that run during the compilation process and can generate code, modify existing code, or perform other actions based on annotations in your source code. annotationProcessor "com . google . dagger:dagger-compiler:version" kapt(Kotlin Annotation Processing Tool) and ksp(Kotlin Symbol Processing) do the same things but for Kotlin projects with some improvements. As the name says, kapt is for the Kotlin project. kapt lets us use Java annotation processors with Kotlin code, even if those processors don't have specific support for Kotlin. This is done by generating Java stubs from your Kotlin files that the processors can then read. This stub generation is an expensive operation and has a significant impact on build speed. kapt "com . google . dagger:dagger-compiler:version" ksp is a Kotlin-first alternative to kapt. ksp analyzes Kotlin code directly, which is up to 2x faster. It also has a better understanding of Kotlin language constructs. ksp "com . google . dagger:dagger-compiler:version" So, now for the Kotlin project, it is recommended to use ksp. That's it for now. Follow Outcome School for knowledge-packed content. Keep Learning, Keep Sharing, and Keep Growing. Software engineers like you join Outcome School to achieve the outcome that is a high-paying tech job. Join Outcome School: https://outcomeschool.com #OutcomeSchool #SoftwareEngineer #Tech #AndroidDev #Android #Kotlin

  • diagram
Sagar Malhotra

Android dev by day, Creator by night.🥷🏻 Sharing my passion through videos, blogs and conferences.🚀

1mo

Does Ksp not support Java annotation processors? If it does, how does it work without generating Java stubs for Java annotation processors? Kudos to you and Outcome school for sharing quality content for Mid-Senior Android developers!! Keep growing!

ROHIT PRAKASH

Associate Projects at Cognizant

1mo

Great advice

Like
Reply
Sudipta Bhattacharya

Flutter | Android Developer @Codelogicx Technologies Pvt. Ltd.

1mo

Very informative

Like
Reply
John Weaver

Delivery Head | Project Management Specialist | Agile

1mo

AMIT SHEKHAR KSP sounds like a real time-saver for Kotlin projects! 🚀 #Kotlin #AndroidDev

Abhinav Kumar

Android Developer @AppX (YC S21) | Java | Kotlin | Jetpack Compose | MVVM | Firebase | Crafting Scalable Mobile Solutions

1mo

Interesting

Like
Reply
Pallavi .

Co-Founder @ Outcome School | Making tech education outcome-focused

1mo

Very informative

Well explained, and very informative! Thanks for sharing 👍

Like
Reply
See more comments

To view or add a comment, sign in

Explore topics