Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PMD depend on compiled .class files #2778

Merged
merged 3 commits into from
Jan 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ afterEvaluate {
}

tasks.create('findbugs', FindBugs) {
dependsOn tasks.assembleDebug
dependsOn tasks.compileDebugJavaWithJavac

description 'Run findbugs'
group 'verification'

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

tasks.create('pmd', Pmd) {
dependsOn tasks.compileDebugJavaWithJavac
targetJdk = TargetJdk.VERSION_1_7

description 'Run pmd'
Expand All @@ -108,7 +109,7 @@ afterEvaluate {
ruleSetFiles = files('pmd-ruleset.xml')
source android.sourceSets.main.java.srcDirs
classpath = files()
classpath += files("${project.buildDir}/intermediates/classes/debug/")
classpath += files(tasks.compileDebugJavaWithJavac.destinationDir)
doFirst {
classpath += classPathForQuality()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,10 @@ public <R> LoadStatus load(
return new LoadStatus(cb, engineJob);
}

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

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

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