AndroidCodeQualityConfig icon indicating copy to clipboard operation
AndroidCodeQualityConfig copied to clipboard

Performance issue in findbugs

Open gengjiawen opened this issue 8 years ago • 4 comments

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?

gengjiawen avatar Mar 29 '17 05:03 gengjiawen

Can we make it just depend on a single flavor's assemble task?

Piasy avatar Mar 29 '17 06:03 Piasy

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")
    }
}

gengjiawen avatar Mar 29 '17 06:03 gengjiawen

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.

gengjiawen avatar Mar 29 '17 06:03 gengjiawen

Yeah, that make sense.

Piasy avatar Mar 29 '17 06:03 Piasy