Skip to content

Instantly share code, notes, and snippets.

View rafaeltoledo's full-sized avatar

Rafael Toledo rafaeltoledo

View GitHub Profile
apply plugin: 'findbugs'
check.dependsOn 'checkstyle', 'findbugs'
task findbugs(type: FindBugs, dependsOn: assembleDebug) {
ignoreFailures = false
effort = 'max'
reportLevel = 'high'
excludeFilter = new File("${project.rootDir}/config/findbugs-filter.xml")
classes = files("${project.rootDir}/app/build/intermediates/classes")
source 'src'
include '**/*.java'
exclude '**/gen/**'
task findbugs(type: FindBugs, dependsOn: assembleDebug) {
ignoreFailures = false
effort = 'max'
reportLevel = 'high'
excludeFilter = new File("${project.rootDir}/config/findbugs-filter.xml")
classes = files("${project.rootDir}/app/build/intermediates/classes")
source 'src'
include '**/*.java'
exclude '**/gen/**'
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Class name="~.*\.R\$.*" />
</Match>
<Match>
<Class name="~.*\.Manifest\$.*" />
</Match>
<!-- Todas as classes de teste, exceto bugs específicos do JUnit -->
<Match>
public class Client implements Parcelable {
public static TABLE_NAME = "clients";
...
}
apply plugin: 'pmd'
check.dependsOn 'checkstyle', 'findbugs', 'pmd'
task pmd(type: Pmd) {
ignoreFailures = false
ruleSetFiles = files("${project.rootDir}/config/pmd-ruleset.xml")
ruleSets = []
source 'src'
include '**/*.java'
exclude '**/gen/**'
reports {
<?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">
<exclude-pattern>.*/R.java</exclude-pattern>
<exclude-pattern>.*/gen/.*</exclude-pattern>