Dagger2
gradle配置
全局application,build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.7'//远程apt工具地址
classpath 'me.tatarka:gradle-retrolambda:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
应用配置apk,build.gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
apply plugin: 'com.neenbedankt.android-apt' //gradle android apt插件,必须配置,在build自动根据dagger的配置