Sloaix/ZhihuDailyFluxRRD

新手看不懂gradle里头dependencies 里面用apt和provided关键字

Closed this issue · 1 comments

新手看不懂gradle里头dependencies 里面apt libs.daggerCompiler的用途,请问能指教下么?或者材料。
为什么是apt, 在project structure ->dependencies ->scope中没见过这个

android apt(一个编译时注解处理插件)

  • https://bitbucket.org/hvisser/android-apt
  • Allow to configure a compile time only annotation processor as a dependency, not including the artifact in the final APK or library
  • Set up the source paths so that code that is generated from the annotation processor is correctly picked up by Android Studio.(让生成的代码能够被AndroidStudio正确的获取)

povided (gradle 关键字)

  • provided - compile-time only dependency(dagger2的注入是编译时生成的,apt也是编译时的,不过这里用了apt获得一些上述的功能)
  • package - package-time only dependency
  • compile - compile-time and package-time dependency(大多时候我们用的compile)