Skip to content

Commit fd73179

Browse files
TWiStErRobsjudd
authored andcommitted
Make PMD depend on compiled .class files (#2778)
* Revert "Fix spurious PMD warnings when building with —-profile." This reverts commit cc4bb16. * Make PMD depend on compiled .class files so type resolution can do its job. * Make FindBugs depend on compiled .class files via specific task and dynamic value
1 parent cc4bb16 commit fd73179

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

library/build.gradle

+4-3
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ afterEvaluate {
6767
}
6868

6969
tasks.create('findbugs', FindBugs) {
70-
dependsOn tasks.assembleDebug
70+
dependsOn tasks.compileDebugJavaWithJavac
7171

7272
description 'Run findbugs'
7373
group 'verification'
7474

75-
classes = fileTree("${project.buildDir}/intermediates/classes/debug/")
75+
classes = fileTree(tasks.compileDebugJavaWithJavac.destinationDir)
7676
source android.sourceSets.main.java.srcDirs
7777
classpath = files()
7878
doFirst {
@@ -97,6 +97,7 @@ afterEvaluate {
9797
}
9898

9999
tasks.create('pmd', Pmd) {
100+
dependsOn tasks.compileDebugJavaWithJavac
100101
targetJdk = TargetJdk.VERSION_1_7
101102

102103
description 'Run pmd'
@@ -108,7 +109,7 @@ afterEvaluate {
108109
ruleSetFiles = files('pmd-ruleset.xml')
109110
source android.sourceSets.main.java.srcDirs
110111
classpath = files()
111-
classpath += files("${project.buildDir}/intermediates/classes/debug/")
112+
classpath += files(tasks.compileDebugJavaWithJavac.destinationDir)
112113
doFirst {
113114
classpath += classPathForQuality()
114115
}

library/src/main/java/com/bumptech/glide/load/engine/Engine.java

-6
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,10 @@ public <R> LoadStatus load(
235235
return new LoadStatus(cb, engineJob);
236236
}
237237

238-
// TODO(#2776): Remove this suppression.
239-
@SuppressWarnings("PMD.UnusedPrivateMethod")
240238
private static void logWithTimeAndKey(String log, long startTime, Key key) {
241239
Log.v(TAG, log + " in " + LogTime.getElapsedMillis(startTime) + "ms, key: " + key);
242240
}
243241

244-
// TODO(#2776): Remove this suppression.
245-
@SuppressWarnings("PMD.UnusedPrivateMethod")
246242
@Nullable
247243
private EngineResource<?> loadFromActiveResources(Key key, boolean isMemoryCacheable) {
248244
if (!isMemoryCacheable) {
@@ -256,8 +252,6 @@ private EngineResource<?> loadFromActiveResources(Key key, boolean isMemoryCache
256252
return active;
257253
}
258254

259-
// TODO(#2776): Remove this suppression.
260-
@SuppressWarnings("PMD.UnusedPrivateMethod")
261255
private EngineResource<?> loadFromCache(Key key, boolean isMemoryCacheable) {
262256
if (!isMemoryCacheable) {
263257
return null;

0 commit comments

Comments
 (0)