[build.gradle]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'findbugs' apply plugin: 'pmd' repositories { mavenCentral() } sourceCompatibility = 1.7 version = '1.0' jar { manifest { attributes 'Implementation-Title' : 'StudyPd3Sample' , 'Implementation-Version' : version } } group = 'pe.kr.ddakker' findbugs { toolVersion = "2.0.1" sourceSets = [sourceSets.main] ignoreFailures = true reportsDir = file( "$project.buildDir/findbugsReports" ) effort = "default" reportLevel = "medium" includeFilter = file( "$rootProject.projectDir/config/findbugs/includeFilter.xml" ) excludeFilter = file( "$rootProject.projectDir/config/findbugs/excludeFilter.xml" ) } tasks.withType(FindBugs) { reports { xml.enabled = true html.enabled = false } } pmd { ignoreFailures = true toolVersion = "2.0.1" ruleSetFiles = files( "$rootProject.projectDir/config/pmd/myRuleSet.xml" ) } dependencies { compile group: 'commons-collections' , name: 'commons-collections' , version: '3.2' //compile "com.google.code.findbugs:annotations:2.0.1" //findbugs "com.google.code.findbugs:findbugs-ant:2.0.1" pmd group: 'pmd' , name: 'pmd' , version: '4.2.5' testCompile group: 'junit' , name: 'junit' , version: '4.11' } test { systemProperties 'property' : 'value' } uploadArchives { repositories { flatDir { dirs 'repos' } } } tasks.withType(Compile) { options.encoding = 'UTF-8' } /* javadoc { options.addStringOption("locale","ko_KR"); options.addStringOption("encoding","UTF-8"); options.addStringOption("charset","UTF-8"); options.addStringOption("docencoding","UTF-8"); } */ |
[/config/pmd/myRuleSet.xml]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <!--?xml version="1.0" encoding="UTF-8"?--> < 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 < rule ref = "rulesets/logging-java.xml" > <!-- <exclude name="SystemPrintln" /> --> </ rule > < rule ref = "rulesets/basic.xml" > < rule ref = "rulesets/braces.xml" > < rule ref = "rulesets/codesize.xml" > < exclude name = "TooManyMethods" > </ exclude ></ rule > < rule ref = "rulesets/controversial.xml" > < exclude name = "UseConcurrentHashMap" > < exclude name = "AvoidLiteralsInIfCondition" > < exclude name = "DataflowAnomalyAnalysis" > < exclude name = "CallSuperInConstructor" > < exclude name = "AtLeastOneConstructor" > < exclude name = "NullAssignment" > </ exclude ></ exclude ></ exclude ></ exclude ></ exclude ></ exclude ></ rule > </ rule ></ rule ></ ruleset > |
[/config/findbugs/includeFilter.xml]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <!--?xml version="1.0" encoding="UTF-8"?--> < findbugsfilter > < match > < priority value = "1" > </ priority ></ match > < match > < priority value = "2" > </ priority ></ match > < match > < bug category = "DODGY" > </ bug ></ match > < match > < bug category = "BAD_PRACTICE" > </ bug ></ match > < match > < bug category = "CORRECTNESS" > </ bug ></ match > < match > < bug category = "PERFORMANCE" > </ bug ></ match > < match > < bug category = "MULTITHREADED_CORRECTNESS" > </ bug ></ match > </ findbugsfilter > |
[/config/findbugs/excludeFilter.xml]
1 2 3 4 5 6 | <!--?xml version="1.0" encoding="UTF-8"?--> < findbugsfilter > < match > < bug pattern = "IS2_INCONSISTENT_SYNC" > </ bug ></ match > </ findbugsfilter > |