Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 1 | |
| 2 | // ================================================================= |
| 3 | // Configure the Gradle code quality plugins here. |
| 4 | // |
| 5 | |
D. Can Celasun | 76fa8c9 | 2019-10-18 15:15:45 +0100 | [diff] [blame] | 6 | dependencies { |
| 7 | spotbugs configurations.spotbugsPlugins.dependencies |
Jiayu Liu | 649dcfd | 2022-02-21 23:18:50 +0800 | [diff] [blame] | 8 | spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0' |
D. Can Celasun | 76fa8c9 | 2019-10-18 15:15:45 +0100 | [diff] [blame] | 9 | } |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 10 | |
D. Can Celasun | 76fa8c9 | 2019-10-18 15:15:45 +0100 | [diff] [blame] | 11 | apply plugin: 'com.github.spotbugs' |
| 12 | |
Jiayu Liu | 649dcfd | 2022-02-21 23:18:50 +0800 | [diff] [blame] | 13 | // see https://spotbugs-gradle-plugin.netlify.app/com/github/spotbugs/snom/spotbugsextension |
| 14 | spotbugs { |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 15 | ignoreFailures = true |
Jiayu Liu | 649dcfd | 2022-02-21 23:18:50 +0800 | [diff] [blame] | 16 | toolVersion = '4.5.3' |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 17 | effort = 'max' |
| 18 | reportLevel = 'low' |
| 19 | excludeFilter = file('code_quality_tools/findbugs-filter.xml') |
| 20 | } |
| 21 | |
Jiayu Liu | 649dcfd | 2022-02-21 23:18:50 +0800 | [diff] [blame] | 22 | // see https://spotbugs-gradle-plugin.netlify.app/com/github/spotbugs/snom/spotbugstask |
| 23 | spotbugsMain { |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 24 | reports { |
| 25 | text.enabled = false |
| 26 | html.enabled = true |
| 27 | xml.enabled = false |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | apply plugin: 'pmd' |
| 32 | |
| 33 | pmd { |
| 34 | ignoreFailures = true |
| 35 | toolVersion = '6.0.0' |
| 36 | sourceSets = [ sourceSets.main ] |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 37 | ruleSets = [ 'java-basic' ] |
| 38 | } |
| 39 | |
| 40 | tasks.withType(Pmd) { |
| 41 | reports { |
| 42 | html.enabled = true |
| 43 | xml.enabled = false |
| 44 | } |
| 45 | } |
Jiayu Liu | 53ec082 | 2022-05-06 12:56:42 +0800 | [diff] [blame^] | 46 | |
| 47 | spotless { |
| 48 | java { |
| 49 | target project.fileTree(project.rootDir) { |
| 50 | include 'src/**/*.java' |
| 51 | } |
| 52 | googleJavaFormat() |
| 53 | } |
| 54 | } |