Reputation: 10441
I'm using Lombok in a pure-java module inside an Android Studio project. This is the build.gradle for the module:
apply plugin: 'java'
apply plugin: 'war'
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
providedCompile "org.projectlombok:lombok:1.12.6"
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.0'
compile 'com.google.code.gson:gson:2.7'
}
However when I build my android module the resulting APK has these method counts from lombok, when it should have none.
lombok: 4099
bytecode: 85
core: 308
debug: 18
handlers: 8
runtimeDependencies: 15
delombok: 253
ant: 22
eclipse: 820
agent: 223
handlers: 387
experimental: 16
extern: 6
apachecommons: 1
java: 1
log4j: 2
slf4j: 2
installer: 286
eclipse: 109
javac: 970
apt: 132
handlers: 317
java6: 24
java7: 24
java8: 26
libs: 996
com: 61
zwitserloot: 61
cmdreader: 61
org: 935
objectweb: 935
asm: 935
commons: 405
signature: 41
tree: 199
patcher: 316
equinox: 18
inject: 7
scripts: 150
Is this something wrong w/ lombok, how I'm using providedCompile
or something with the Android/Gradle build system?
Upvotes: 1
Views: 233
Reputation: 34542
You should use compileOnly instead.
Disclosure: I am a lombok developer and not a gradle expert.
Upvotes: 2