From 4cd4e947bad22f2561162afd7dca9ae9fd38384f Mon Sep 17 00:00:00 2001 From: mcorrea Date: Fri, 25 Sep 2015 11:35:40 -0400 Subject: [PATCH 1/2] cobetura integration --- zuul-simple-webapp/build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zuul-simple-webapp/build.gradle b/zuul-simple-webapp/build.gradle index 7f21f769d5..318d0ff30a 100644 --- a/zuul-simple-webapp/build.gradle +++ b/zuul-simple-webapp/build.gradle @@ -1,5 +1,10 @@ +plugins { + id 'net.saliman.cobertura' version '2.2.7' +} apply plugin: 'war' apply plugin: 'jetty' +apply plugin: 'cobertura' +apply plugin: 'groovy' dependencies { @@ -30,3 +35,8 @@ jettyRun.contextPath = '/' jettyRun.doFirst { System.setProperty("zuul.filter.root", "src/main/groovy/filters") } + +cobertura { + coverageSourceDirs = [sourceSets.main.groovy.srcDirs, sourceSets.main.java.srcDirs] + coverageFormats = ['xml', 'html'] +} \ No newline at end of file From 10d0f0a6133ead306881744a23d94a5b17df59ab Mon Sep 17 00:00:00 2001 From: mcorrea Date: Fri, 25 Sep 2015 12:46:40 -0400 Subject: [PATCH 2/2] tomcat, checkstyle, codenarc, and findbugs --- zuul-simple-webapp/build.gradle | 42 +++- .../config/checkstyle/checkstyle.xml | 188 ++++++++++++++++++ .../config/codenarc/rules.groovy | 8 + 3 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 zuul-simple-webapp/config/checkstyle/checkstyle.xml create mode 100644 zuul-simple-webapp/config/codenarc/rules.groovy diff --git a/zuul-simple-webapp/build.gradle b/zuul-simple-webapp/build.gradle index 318d0ff30a..479268254b 100644 --- a/zuul-simple-webapp/build.gradle +++ b/zuul-simple-webapp/build.gradle @@ -1,17 +1,26 @@ plugins { id 'net.saliman.cobertura' version '2.2.7' + id "com.bmuschko.tomcat" version "2.2.2" + id 'codenarc' + id 'findbugs' + id 'checkstyle' } apply plugin: 'war' apply plugin: 'jetty' apply plugin: 'cobertura' apply plugin: 'groovy' - dependencies { compile project(":zuul-core") compile 'org.apache.httpcomponents:httpclient:4.5' providedCompile 'javax.servlet:servlet-api:2.5' + + def tomcatVersion = '8.0.23' + tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", + "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}", + "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}" + } eclipse { @@ -39,4 +48,33 @@ jettyRun.doFirst { cobertura { coverageSourceDirs = [sourceSets.main.groovy.srcDirs, sourceSets.main.java.srcDirs] coverageFormats = ['xml', 'html'] -} \ No newline at end of file +} + +checkstyle { + toolVersion = '6.7' + ignoreFailures = true + showViolations = false + sourceSets = [sourceSets.main] + reportsDir = rootProject.file('zuul-simple-webapp/build/reports/checkstyle') +} + +codenarc { + configFile = rootProject.file('zuul-simple-webapp/config/codenarc/rules.groovy') + ignoreFailures = true + sourceSets = [sourceSets.main] + reportFormat = 'xml' +} + +findbugs { + effort = 'min' + ignoreFailures = true + sourceSets = [sourceSets.main] +} + +tomcat { + contextPath = '/' +} + +[tomcatRun, tomcatRunWar]*.doFirst { + System.setProperty("zuul.filter.root", "src/main/groovy/filters") +} diff --git a/zuul-simple-webapp/config/checkstyle/checkstyle.xml b/zuul-simple-webapp/config/checkstyle/checkstyle.xml new file mode 100644 index 0000000000..2d17204330 --- /dev/null +++ b/zuul-simple-webapp/config/checkstyle/checkstyle.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/zuul-simple-webapp/config/codenarc/rules.groovy b/zuul-simple-webapp/config/codenarc/rules.groovy new file mode 100644 index 0000000000..80feba2611 --- /dev/null +++ b/zuul-simple-webapp/config/codenarc/rules.groovy @@ -0,0 +1,8 @@ +ruleset { + ruleset 'rulesets/basic.xml' + ruleset 'rulesets/braces.xml' + ruleset('rulesets/dry.xml') { + DuplicateNumberLiteral(enabled:false) + } + ruleset 'rulesets/groovyism.xml' +}