diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2012-12-10 13:09:34 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-01-04 18:59:39 +0200 |
commit | 104259291148b2cf5f0f3f7bc8795089cc1cb32c (patch) | |
tree | 99a8e2d8e5f98f8ace211fcbdde6e6121fcbb64a /common.xml | |
parent | fb68bd53035fdd9cf0448623d5f6867fe17bab64 (diff) | |
download | vaadin-framework-104259291148b2cf5f0f3f7bc8795089cc1cb32c.tar.gz vaadin-framework-104259291148b2cf5f0f3f7bc8795089cc1cb32c.zip |
Checkstyle for Vaadin #9065
* Validates that all java files contains a license file and fails the build if a license is missing
* For now runs a lot of checks with a severity less than error to avoid failing the build
* Outputs test results to TeamCity for reporting
Change-Id: I24ca9cd0646a4bc530ef3a183eef1bc4addc555d
Diffstat (limited to 'common.xml')
-rw-r--r-- | common.xml | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/common.xml b/common.xml index 8df71cc177..e96037032b 100644 --- a/common.xml +++ b/common.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<project name="common" basedir="." default="" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:antcontrib="antlib:net.sf.antcontrib"> +<project name="common" basedir="." default="" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:cs="antlib:com.puppycrawl.tools.checkstyle"> <tstamp> <format property="build.date" pattern="yyyy-MM-dd" /> @@ -350,4 +350,23 @@ <ivy:publish conf="${conf}" resolver="local-maven" overwrite="true"> </ivy:publish> </target> + + <!-- Checkstyle conf --> + <property name="cs.dir" location="${vaadin.basedir}/checkstyle" /> + <property name="cs.xml" location="${cs.dir}/vaadin-checkstyle.xml" /> + <property name="cs.header-file" location="${cs.dir}/header" /> + <taskdef resource="checkstyletask.properties" uri="antlib:com.puppycrawl.tools.checkstyle" classpathref="taskdefs.classpath" /> + + <target name="checkstyle"> + <fail unless="result.dir" message="No result.dir parameter given" /> + <fail unless="cs.src" message="No cs.src parameter given" /> + <property name="result.dir.full" location="${result.dir}"/> + <mkdir dir="${result.dir}" /> + <echo>##teamcity[importData type='checkstyle' path='${result.dir.full}/checkstyle-errors.xml']</echo> + <cs:checkstyle config="${cs.xml}" failOnViolation="true"> + <fileset dir="${cs.src}" includes="**/*.java" /> + <formatter type="xml" toFile="${result.dir}/checkstyle-errors.xml"/> + <property key="checkstyle.header.file" file="${cs.header-file}" /> + </cs:checkstyle> + </target> </project> |