java - How do I specify different (PMD, Checkstyle, Findbugs) rulesets for test and production code using Gradle? -
java - How do I specify different (PMD, Checkstyle, Findbugs) rulesets for test and production code using Gradle? -
i building java project gradle. separate tasks:
i utilize strict rules (i.e. pmd, checkstyle, findbugs) production code more relaxed rules (i.e. allowing duplicate strings , magic numbers) tests .
i have done ant (quite simple), , though know phone call ant tasks gradle, rather utilize respective plugins.
how go this?
my current build script pmd follows:
apply plugin: 'pmd' pmd { ignorefailures = true rulesetfiles = files("$staticanalysiscfgdir/pmd/pmdruleset.xml") toolversion = '5.1.3' sourcesets = [sourcesets.main, sourcesets.test] }
instead of configuring rule sets on pmd
extension, configure them on pmdmain
, pmdtest
tasks (same syntax). likewise checkstyle , findbugs.
java gradle checkstyle findbugs pmd
Comments
Post a Comment