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 | c4e96c7 | 2022-05-19 03:03:07 +0800 | [diff] [blame] | 8 | spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.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 | |
Jiayu Liu | 649dcfd | 2022-02-21 23:18:50 +0800 | [diff] [blame] | 11 | // see https://spotbugs-gradle-plugin.netlify.app/com/github/spotbugs/snom/spotbugsextension |
| 12 | spotbugs { |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 13 | ignoreFailures = true |
Jiayu Liu | 649dcfd | 2022-02-21 23:18:50 +0800 | [diff] [blame] | 14 | toolVersion = '4.5.3' |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 15 | effort = 'max' |
| 16 | reportLevel = 'low' |
| 17 | excludeFilter = file('code_quality_tools/findbugs-filter.xml') |
| 18 | } |
| 19 | |
Jiayu Liu | 649dcfd | 2022-02-21 23:18:50 +0800 | [diff] [blame] | 20 | // see https://spotbugs-gradle-plugin.netlify.app/com/github/spotbugs/snom/spotbugstask |
| 21 | spotbugsMain { |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 22 | reports { |
| 23 | text.enabled = false |
| 24 | html.enabled = true |
| 25 | xml.enabled = false |
| 26 | } |
| 27 | } |
| 28 | |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 29 | pmd { |
| 30 | ignoreFailures = true |
| 31 | toolVersion = '6.0.0' |
| 32 | sourceSets = [ sourceSets.main ] |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 33 | ruleSets = [ 'java-basic' ] |
| 34 | } |
| 35 | |
| 36 | tasks.withType(Pmd) { |
| 37 | reports { |
Jiayu Liu | 5b15838 | 2022-05-12 00:20:37 +0800 | [diff] [blame] | 38 | html.required = true |
| 39 | xml.required = false |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 40 | } |
| 41 | } |
Jiayu Liu | 53ec082 | 2022-05-06 12:56:42 +0800 | [diff] [blame] | 42 | |
| 43 | spotless { |
| 44 | java { |
Jiayu Liu | c4e96c7 | 2022-05-19 03:03:07 +0800 | [diff] [blame] | 45 | target 'src/**/*.java' |
Jiayu Liu | 53ec082 | 2022-05-06 12:56:42 +0800 | [diff] [blame] | 46 | googleJavaFormat() |
| 47 | } |
| 48 | } |