Skip to content

Instantly share code, notes, and snippets.

View rafaeltoledo's full-sized avatar

Rafael Toledo rafaeltoledo

View GitHub Profile
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'
<?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>
<?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>
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ‘:app:pmd’.
> 1 PMD rule violations were found. See the report at: file:///Users/rafael/Project/quality-tools/app/build/reports/findbugs/findbugs.html
* Try:
Run with — stacktrace option to get the stack trace. Run with — info or — debug option to get more log output.
BUILD FAILED