diff --git a/zuul-simple-webapp/build.gradle b/zuul-simple-webapp/build.gradle index 7f21f769d5..479268254b 100644 --- a/zuul-simple-webapp/build.gradle +++ b/zuul-simple-webapp/build.gradle @@ -1,12 +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 { @@ -30,3 +44,37 @@ 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'] +} + +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' +}