diff --git a/build.gradle b/build.gradle index 8f41e3194e..2837bac312 100644 --- a/build.gradle +++ b/build.gradle @@ -91,6 +91,9 @@ configure(javaProjects) { ext.TOMCAT_GRADLE = "$rootDir/gradle/tomcat.gradle" ext.WAR_SAMPLE_GRADLE = "$rootDir/gradle/war-sample.gradle" apply from: "$rootDir/gradle/javaprojects.gradle" + if(!project.name.contains('gae')) { + apply from: "$rootDir/gradle/checkstyle.gradle" + } apply from: "$rootDir/gradle/release-checks.gradle" apply from: "$rootDir/gradle/maven-deployment.gradle" } diff --git a/etc/checkstyle/checkstyle.xml b/etc/checkstyle/checkstyle.xml new file mode 100644 index 0000000000..fe25bb4525 --- /dev/null +++ b/etc/checkstyle/checkstyle.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/etc/checkstyle/header.txt b/etc/checkstyle/header.txt new file mode 100644 index 0000000000..61e424cc14 --- /dev/null +++ b/etc/checkstyle/header.txt @@ -0,0 +1,16 @@ +^\Q/*\E$ +^\Q * Copyright\E (\d{4}\-\d{4} the original author or authors\.|(\d{4}, )*(\d{4}) Acegi Technology Pty Limited)$ +^\Q *\E$ +^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$ +^\Q * you may not use this file except in compliance with the License.\E$ +^\Q * You may obtain a copy of the License at\E$ +^\Q *\E$ +^\Q * http://www.apache.org/licenses/LICENSE-2.0\E$ +^\Q *\E$ +^\Q * Unless required by applicable law or agreed to in writing, software\E$ +^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$ +^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$ +^\Q * See the License for the specific language governing permissions and\E$ +^\Q * limitations under the License.\E$ +^\Q */\E$ +^.*$ \ No newline at end of file diff --git a/etc/checkstyle/suppressions.xml b/etc/checkstyle/suppressions.xml new file mode 100644 index 0000000000..a7d3052a83 --- /dev/null +++ b/etc/checkstyle/suppressions.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + diff --git a/gradle/checkstyle.gradle b/gradle/checkstyle.gradle new file mode 100644 index 0000000000..0fc34720f0 --- /dev/null +++ b/gradle/checkstyle.gradle @@ -0,0 +1,12 @@ +apply plugin: 'checkstyle' + +checkstyle { + configFile = rootProject.file('etc/checkstyle/checkstyle.xml') + configProperties.configDir = configFile.parentFile + toolVersion = '6.16.1' +} +task checkstyle { + dependsOn project.tasks.findAll { task -> task.name.matches('checkstyle\\w+') } +} + +check.dependsOn tasks.checkstyle \ No newline at end of file