1 引入包
在app下的build.gradle配置如下:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'org.projectlombok:lombok:1.18.10'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
然后继续在该文件中加入:
defaultConfig {
applicationId "com.wuk.runtimepermissiontest"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true }}
}
然后在项目的根目录加入:
lombok.config内容如下:
lombok.anyConstructor.suppressConstructorProperties=true
config.stopBubbling=true
lombok.equalsAndHashCode.callSuper=call