Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ subprojects {
}

checkstyle {
configFile = rootProject.file('build/checkstyle/checkstyle.xml')
configProperties.checkstyleConfigDir = rootProject.file('build/checkstyle/')
configFile = rootProject.file('buildtools/src/main/resources/checkstyle/checkstyle.xml')
configProperties.checkstyleConfigDir = rootProject.file('buildtools/src/main/resources/checkstyle/')
toolVersion = '8.1'
}

Expand All @@ -123,7 +123,7 @@ subprojects {

license {
include "**/*.java"
header rootProject.file('build/license/HEADER.txt')
header rootProject.file('buildtools/src/main/resources/license/HEADER.txt')
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
Expand Down Expand Up @@ -231,27 +231,6 @@ subprojects {

apply plugin: 'java'

configurations {
buildToolsConfig
}

dependencies {
buildToolsConfig 'org.trellisldp:trellis-build-tools:0.2.0'
}


task processBuildTools(type: Copy) {
from {
configurations.buildToolsConfig.collect {
zipTree(it).matching {
include 'checkstyle/*.xml'
include 'license/*.txt'
}
}
}
into 'build'
}

task apidocs(type: Javadoc, dependsOn: getTasksByName('docs', true)) {
outputs.upToDateWhen { false }
destinationDir = new File(projectDir, "docs/apidocs")
Expand Down Expand Up @@ -304,4 +283,3 @@ tasks.coveralls {
dependsOn 'jacocoRootReport'
}

check.dependsOn processBuildTools
File renamed without changes.
85 changes: 85 additions & 0 deletions buildtools/src/main/resources/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<!-- Suppress -->
<module name="SuppressionFilter">
<property name="file" value="${checkstyleConfigDir}/suppressions.xml"/>
</module>
<!-- Ignore module-info.java files when compiling with JDK 9 -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- Checks that there are no tab characters ('\t') in the source code. -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
<property name="fileExtensions" value="java,css,js,xml"/>
</module>
<!-- License Header module disabled in favor of license-maven-plugin -->
<module name="TreeWalker">
<!-- Checks for redundant import statements -->
<module name="RedundantImport"/>
<!-- Checks for unused import statements -->
<module name="UnusedImports"/>
<!-- Check that finds import statements that use the * notation. -->
<module name="AvoidStarImport"/>
<!-- Checks for long lines. -->
<module name="LineLength">
<property name="max" value="120"/>
</module>
<!-- Write Javadocs for public methods and classes. Keep it short and to the point
/**
* @author Joe Developer
* @date MMM DD, YYYY
*/
public class MyClass
-->
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="excludeScope" value="anoninner"/>
<!-- Contrary to expectation only checks for author tags without an author -->
<property name="authorFormat" value="\S"/>
<property name="allowUnknownTags" value="true"/>
<property name="allowMissingParamTags" value="false"/>
</module>
<!-- Ensure files have the Javadoc @author tag -->
<module name="Regexp">
<property name="format" value=" \* \@author "/>
<property name="message" value="Javadoc @author tag"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
</module>
<!-- K&R style braces -->
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="WhitespaceAround">
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND"
/>
</module>
<module name="Indentation">
<property name="throwsIndent" value="8"/>
</module>
<module name="SuppressWarningsHolder"/>
<module name="FinalLocalVariable"/>
<module name="FinalParameters"/>
<module name="GenericWhitespace"/>
<module name="HideUtilityClassConstructor"/>
<module name="MultipleVariableDeclarations"/>
</module>
<!-- No Trailing Whitespace, except on lines that only have an asterisk (e.g. Javadoc comments) -->
<module name="RegexpSingleline">
<property name="format" value="(?&lt;!\*)\s+$|\*\s\s+$"/>
<property name="message" value="Trailing whitespace"/>
<property name="fileExtensions" value="java,css,js,xml"/>
</module>
<module name="SuppressWarningsFilter" />
</module>

14 changes: 14 additions & 0 deletions buildtools/src/main/resources/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress checks="JavadocMethod" files="src[/\\]test[/\\]java"/>
<suppress checks="JavadocPackage" files="src[/\\]test[/\\]java"/>
<suppress checks="JavadocVariable" files="src[/\\]test[/\\]java"/>
<suppress checks="JavadocType" files="src[/\\]test[/\\]java"/>
<suppress checks="JavadocStyleCheck" files="src[/\\]test[/\\]java"/>
<suppress checks="IndentationCheck" files=".*\.java$"/>
<suppress checks="MultipleVariableDeclarations" files="src[/\\]test[/\\]java"/>
</suppressions>

11 changes: 11 additions & 0 deletions buildtools/src/main/resources/license/HEADER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.