Skip to content

Commit 210f69c

Browse files
author
André Rosa
committed
3.3.1
1 parent 3a79d0a commit 210f69c

File tree

16 files changed

+27
-19
lines changed

16 files changed

+27
-19
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Android Quality Verifier
22
===============
33

44
Static code analysis plugin for Android projects.
5-
This is a fork of [the original android-check plugin][1], which implements a really useful concept, but unfortunately seems abandoned.
5+
This is a fork of [the original android-check plugin][1], which implements a really useful concept.
66

77
<!---
88
Build status
@@ -30,7 +30,7 @@ The default one.
3030

3131
```
3232
// Configuration is completely optional, defaults will be used if not present
33-
verifier {
33+
check {
3434
// Do absolutely nothing, default: false
3535
skip true/false
3636
// Fails build if a violation is found, default: true
@@ -74,7 +74,7 @@ verifier {
7474
}
7575
7676
// Lint configuration
77-
lint {
77+
alint {
7878
// Same options as Checkstyle and FindBugs, except for a couple of defaults:
7979
8080
// Configuration file for CheckStyle, default: <project_path>/config/pmd.xml, if non-existent then <project_path>/<module_path>/config/pmd.xml, if non-existent then plugin/src/main/resources/pmd/conf-default.xml

plugin/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'groovy'
33
repositories { jcenter() }
44

55
dependencies {
6-
compile gradleApi()
6+
compileOnly gradleApi()
77
// Checkstyle
88
compile('com.puppycrawl.tools:checkstyle:7.6.1') {
99
// Android Lint also depends on guava, so don't bring it in twice
@@ -12,7 +12,7 @@ dependencies {
1212
// FindBugs
1313
compile 'com.google.code.findbugs:findbugs:3.0.1'
1414
// PMD
15-
compile 'net.sourceforge.pmd:pmd-java:5.5.5'
15+
compile 'net.sourceforge.pmd:pmd-java:5.6.0'
1616
}
1717

1818
project.ext {
@@ -21,7 +21,7 @@ project.ext {
2121
description = 'Static code analysis plugin for Android projects.'
2222
groupId = 'pt.simdea.verifier'
2323
artifactId = 'verifier'
24-
version = "3.3.0"
24+
version = "3.3.1"
2525
website = 'https://github.com/simdea/android-quality-verifier'
2626
scm = 'https://github.com/simdea/android-quality-verifier'
2727
tags = ['android', 'verifier', 'check', 'checkstyle', 'findbugs', 'pmd', 'lint', 'quality']

plugin/src/main/groovy/pt/simdea/verifier/CheckExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import pt.simdea.verifier.pmd.PmdConfig
88

99
class CheckExtension {
1010

11-
static final String NAME = 'verifier'
11+
static final String NAME = 'check'
1212

1313
private final Project project
1414

plugin/src/main/groovy/pt/simdea/verifier/CheckPlugin.groovy

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ class CheckPlugin implements Plugin<Project> {
1010

1111
@Override
1212
void apply(Project target) {
13-
target.extensions.create(CheckExtension.NAME, CheckExtension, target)
13+
target.extensions.create(CheckExtension.NAME, CheckExtension)
1414
target.check.extensions.create('lint', CheckExtension.Lint)
1515

16-
new CheckstyleCheck().apply(target)
17-
new FindbugsCheck().apply(target)
18-
new PmdCheck().apply(target)
1916
target.subprojects { subProject ->
2017
afterEvaluate {
2118
def extension = target.check
2219

20+
new CheckstyleCheck().apply(subProject)
21+
new FindbugsCheck().apply(subProject)
22+
new PmdCheck().apply(subProject)
23+
2324
addLint(subProject, extension)
2425
}
2526
}

plugin/src/main/groovy/pt/simdea/verifier/CommonCheck.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ abstract class CommonCheck<Config extends CommonConfig> {
8181
if (target.tasks.find({ it.name == 'check' }) != null) {
8282
target.tasks.getByName('check').dependsOn taskName
8383
} else {
84-
target.logger.warn """task check not found in project $target.name. You may need to run
85-
the plugin tasks manually"""
84+
target.logger.warn "task check not found in" +
85+
" project $target.name. You may need to run the plugin tasks manually"
8686
}
8787
dependencies.each { target.tasks.getByName(taskName).dependsOn it }
8888
}

plugin/src/main/resources/pmd/conf-default.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Severity: HARD
3434
<rule ref="rulesets/java/comments.xml">
3535
<exclude name="CommentRequired"/>
3636
<exclude name="CommentSize"/>
37+
<exclude name="CommentDefaultAccessModifier"/>
3738
</rule>
3839

3940
<rule ref="rulesets/java/controversial.xml">
@@ -45,6 +46,8 @@ Severity: HARD
4546
<exclude name="DataflowAnomalyAnalysis"/>
4647
<exclude name="NullAssignment"/>
4748
<exclude name="OnlyOneReturn"/>
49+
<exclude name="AvoidFinalLocalVariable"/>
50+
<exclude name="UseConcurrentHashMap"/>
4851
</rule>
4952

5053
<rule ref="rulesets/java/coupling.xml">
@@ -101,7 +104,11 @@ Severity: HARD
101104
<exclude name="LooseCoupling"/>
102105
</rule>
103106

104-
<rule ref="rulesets/java/unnecessary.xml"/>
107+
<rule ref="rulesets/java/unnecessary.xml">
108+
<exclude name="UselessOverridingMethod"/>
109+
<exclude name="UselessParentheses"/>
110+
<exclude name="UnnecessaryModifier"/>
111+
</rule>
105112

106113
<rule ref="rulesets/java/unusedcode.xml"/>
107114

plugin/src/main/resources/pmd/pmd.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,4 @@
155155
</xsl:attribute>
156156
</xsl:template>
157157

158-
</xsl:stylesheet>
158+
</xsl:stylesheet>

sample/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apply plugin: 'com.android.application'
2-
apply plugin: 'org.stoyicker.android-check'
2+
apply plugin: 'pt.simdea.verifier'
33

44
android {
55
compileSdkVersion 25
@@ -29,7 +29,7 @@ dependencies {
2929
compile 'com.github.tony19:logback-android-classic:1.1.1-4'
3030
}
3131

32-
check {
32+
verifier {
3333
abortOnError true
3434

3535
checkstyle {
File renamed without changes.

0 commit comments

Comments
 (0)