AndroidCodeQualityConfig
AndroidCodeQualityConfig copied to clipboard
Performance issue in findbugs
From the code we can see findbugs depends on assemble, but assemble execute both debug and release build.And if we have multi product flavors, this will go even worse. Especially in china, we have such a thing called "multi channel package". So for now, I change the depend to "assembleDebug", but it still need a lots of time, since I have lots of product flavors. Any suggestion I can make findbugs faster?
Can we make it just depend on a single flavor's assemble task?
yes, I find a way (commonLibrary is a library project, so it has no product flavor).Sample code :
task findbugs(type: FindBugs, group: 'verification') {
println("findbugs for ${project.getName()}")
if (project.getName().equals("commonLibrary")){
dependsOn("assembleDebug")
} else {
dependsOn("assembleDevArmeabiDebug")
}
}
But in android project, I think default dependsOn "assembleDebug" is a better idea.Because assemble execute both debug and release (proguard will consume a lots of time from my experience) task and other product flavor if there has, this will be very slow.
Yeah, that make sense.