簡體   English   中英

什么是 Android kapt 及其用法? 添加依賴項時Gradle中的anootation處理器和kapt有什么區別?

[英]What is Android kapt and its usage? What's the difference between anootation processor and kapt in Gradle when adding dependencies?

我對 Android 中引入的最新注釋處理器有點困惑,並且與 Kotlin 相關,即“kapt”問題:

  1. 什么是kapt(kotlin標注處理工具)及其用例? 或者什么 apply plugin: 'kotlin-kapt' 在我們的 android 項目中幫助我們。

  2. Gradle中Kapt和annotationProcessor的區別

    例子:-

    //Dagger with annotationProcessor vs with kapt

    annotationProcessor 庫.daggerCompiler

    kapt "androidx.room:room-compiler:$rootProject.roomVersion"

“Kapt 是 Kotlin 注釋處理工具”你需要這個,要在編譯時生成帶注釋的代碼,你可以在這篇文章中看到更多信息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM