Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
193cd4b2
Commit
193cd4b2
authored
Nov 04, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce checkstyle, findbugs, pmd
parent
f62c26ee
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
354 additions
and
0 deletions
+354
-0
build.gradle
app/build.gradle
+1
-0
checkstyle-config.xml
config/quality/checkstyle/checkstyle-config.xml
+218
-0
android-exclude-filter.xml
config/quality/findbugs/android-exclude-filter.xml
+17
-0
pmd-ruleset.xml
config/quality/pmd/pmd-ruleset.xml
+28
-0
quality.gradle
config/quality/quality.gradle
+90
-0
No files found.
app/build.gradle
View file @
193cd4b2
...
...
@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply
plugin:
'me.tatarka.retrolambda'
apply
plugin:
'realm-android'
apply
plugin:
'com.jakewharton.hugo'
apply
from:
'../config/quality/quality.gradle'
android
{
compileSdkVersion
25
...
...
config/quality/checkstyle/checkstyle-config.xml
0 → 100644
View file @
193cd4b2
This diff is collapsed.
Click to expand it.
config/quality/findbugs/android-exclude-filter.xml
0 → 100644
View file @
193cd4b2
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Class
name=
"~.*\.R\$.*"
/>
</Match>
<Match>
<Class
name=
"~.*\.Manifest\$.*"
/>
</Match>
<!-- All bugs in test classes, except for JUnit-specific bugs -->
<Match>
<Class
name=
"~.*\.*Test"
/>
<Not>
<Bug
code=
"IJU"
/>
</Not>
</Match>
</FindBugsFilter>
\ No newline at end of file
config/quality/pmd/pmd-ruleset.xml
0 → 100644
View file @
193cd4b2
<?xml version="1.0"?>
<ruleset
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
name=
"Android Application Rules"
xmlns=
"http://pmd.sf.net/ruleset/1.0.0"
xsi:noNamespaceSchemaLocation=
"http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:schemaLocation=
"http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
>
<description>
Custom ruleset for Rocket.Chat.Android application
</description>
<exclude-pattern>
.*/R.java
</exclude-pattern>
<exclude-pattern>
.*/gen/.*
</exclude-pattern>
<rule
ref=
"rulesets/java/android.xml"
/>
<rule
ref=
"rulesets/java/clone.xml"
/>
<rule
ref=
"rulesets/java/finalizers.xml"
/>
<rule
ref=
"rulesets/java/imports.xml"
>
<!-- Espresso is designed this way !-->
<exclude
name=
"TooManyStaticImports"
/>
</rule>
<rule
ref=
"rulesets/java/basic.xml"
/>
<rule
ref=
"rulesets/java/naming.xml"
>
<!--<exclude name="AbstractNaming" />-->
<exclude
name=
"LongVariable"
/>
<!--<exclude name="ShortMethodName" />-->
<!--<exclude name="ShortVariable" />-->
<!--<exclude name="ShortClassName" />-->
<!--<exclude name="VariableNamingConventions" />-->
</rule>
</ruleset>
\ No newline at end of file
config/quality/quality.gradle
0 → 100644
View file @
193cd4b2
/**
* Set up Checkstyle, Findbugs and PMD to perform extensive code analysis.
*
* Gradle tasks added:
* - checkstyle
* - findbugs
* - pmd
*
* The three tasks above are added as dependencies of the check task so running check will
* run all of them.
*/
apply
plugin:
'checkstyle'
apply
plugin:
'findbugs'
apply
plugin:
'pmd'
dependencies
{
checkstyle
'com.puppycrawl.tools:checkstyle:7.2'
}
def
qualityConfigDir
=
"$project.rootDir/config/quality"
;
def
reportsDir
=
"$project.buildDir/reports"
check
.
dependsOn
'checkstyle'
,
'findbugs'
,
'pmd'
task
checkstyle
(
type:
Checkstyle
,
group:
'Verification'
,
description:
'Runs code style checks'
)
{
configFile
file
(
"$qualityConfigDir/checkstyle/checkstyle-config.xml"
)
source
'src'
include
'**/*.java'
reports
{
xml
.
enabled
=
true
xml
{
destination
"$reportsDir/checkstyle/checkstyle.xml"
}
}
classpath
=
files
(
)
}
task
findbugs
(
type:
FindBugs
,
group:
'Verification'
,
description:
'Inspect java bytecode for bugs'
,
dependsOn:
[
'compileDebugSources'
,
'compileReleaseSources'
])
{
ignoreFailures
=
false
effort
=
"max"
reportLevel
=
"high"
excludeFilter
=
new
File
(
"$qualityConfigDir/findbugs/android-exclude-filter.xml"
)
classes
=
files
(
"$project.rootDir/app/build/intermediates/classes"
)
source
'src'
include
'**/*.java'
exclude
'**/gen/**'
reports
{
xml
.
enabled
=
false
html
.
enabled
=
true
xml
{
destination
"$reportsDir/findbugs/findbugs.xml"
}
html
{
destination
"$reportsDir/findbugs/findbugs.html"
}
}
classpath
=
files
()
}
task
pmd
(
type:
Pmd
,
group:
'Verification'
,
description:
'Inspect sourcecode for bugs'
)
{
ruleSetFiles
=
files
(
"$qualityConfigDir/pmd/pmd-ruleset.xml"
)
ignoreFailures
=
false
ruleSets
=
[]
source
'src'
include
'**/*.java'
exclude
'**/gen/**'
reports
{
xml
.
enabled
=
true
html
.
enabled
=
true
xml
{
destination
"$reportsDir/pmd/pmd.xml"
}
html
{
destination
"$reportsDir/pmd/pmd.html"
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment