0
나는 새로운 Android 프로젝트를 만들고 lombok 지원을 추가했습니다.Java 8을 사용하는 Android 프로젝트에 lombok 추가
Java 7에서 개발했지만 언어 수준을 8로 업데이트 한 모든 기능은 lombok 컴파일러가 작동을 멈췄습니다.
내가 자바 8 언어를 업데이트 할 Gradle을에서 변경 한 사항
은 다음과 같습니다jackOptions {
enabled true
}
및
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
내 Gradle을은 다음과 같습니다
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.instatrivia"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
buildToolsVersion '25.0.0'
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support.constraint:constraint-layout:1.0.1'
testCompile "junit:junit:$rootProject.junitVersion"
// Android support libs
compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:design:$rootProject.supportLibraryVersion"
compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:support-v4:$rootProject.supportLibraryVersion"
// dagger
compile "com.google.dagger:dagger:$rootProject.dagger_version"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger_version"
// testApt "com.google.dagger:dagger-compiler:$rootProject.dagger_version"
// rx java/android
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
compile 'io.reactivex.rxjava2:rxjava:2.0.1'
provided 'javax.annotation:jsr250-api:1.0'
compile 'javax.inject:javax.inject:1'
// misc
provided "org.projectlombok:lombok:1.16.14"
compile "com.google.guava:guava:$rootProject.guavaVersion"
compile "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
compile "com.squareup.retrofit2:converter-gson:$rootProject.retrofitVersion"
compile 'com.google.code.gson:gson:2.2.4'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.jakewharton.timber:timber:4.5.1'
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}
오류가 발생했습니다.
Warning:You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
Your processor is: com.android.jack.eclipse.jdt.internal.compiler.apt.dispatch.BatchProcessingEnvImpl
Lombok supports: sun/apple javac 1.6, ECJ