Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
companion object {
const val PMD_FILE_NAME = "pmd-ruleset.xml"
const val CHECKSTYLE_FILE_NAME = "checkstyle.xml"
const val FINDBUGS_FILE_NAME = "findbugs-exclude.xml"
const val WRITE_PMD_CONFIG_FILE_TASK = "writePmdConfigFile"
const val WRITE_CHECK_STYLE_CONFIG_FILE_TASK = "writeCheckStyleConfigFile"
const val WRITE_FIND_BUGS_EXCLUSION_FILE_TASK = "writeFindBugsExclusionFile"
const val VERIFICATION_GROUP = "verification"
const val PLUGIN_EXTENSION_NAME = "qualityChecks"
}
@Test
fun `plugin should add tasks when applied`() {
with(project) {
pluginManager.apply(QualityChecksPlugin::class.java)
assertNotNull(tasks.findByName(WRITE_CHECK_STYLE_CONFIG_FILE_TASK))
assertNotNull(tasks.findByName(WRITE_FIND_BUGS_EXCLUSION_FILE_TASK))
assertNotNull(tasks.findByName(WRITE_PMD_CONFIG_FILE_TASK))
}
}
class QualityChecksExtension {
String pmdConfigFile = 'quality-checks/pmd-ruleset.xml'
String checkstyleConfigFile = 'quality-checks/checkstyle.xml'
String findBugsExclusionFile = 'quality-checks/findbugs-exclude.xml'
}
import info.adavis.qualitychecks.QualityChecksPlugin.Companion.CHECKSTYLE_FILE_NAME
import info.adavis.qualitychecks.QualityChecksPlugin.Companion.FINDBUGS_FILE_NAME
import info.adavis.qualitychecks.QualityChecksPlugin.Companion.PMD_FILE_NAME
open class QualityChecksExtension(var pmdConfigFile: String = "quality-checks/$PMD_FILE_NAME",
var checkstyleConfigFile: String = "quality-checks/$CHECKSTYLE_FILE_NAME",
var findBugsExclusionFile: String = "quality-checks/$FINDBUGS_FILE_NAME")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment