diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index c42b8432eaf..d2ba371bb06 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -220,7 +220,6 @@ setup () { against trunk revision ${SVN_REVISION}. ATTACHMENT ID: ${ATTACHMENT_ID}" - #PENDING: cp -f $SUPPORT_DIR/etc/checkstyle* ./src/test ### Copy the patch file to $PATCH_DIR else VERSION=PATCH-${defect} @@ -250,16 +249,17 @@ setup () { echo "======================================================================" echo "" echo "" - echo "$MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1" + echo "$MVN clean package checkstyle:checkstyle-aggregate -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1" export MAVEN_OPTS="${MAVEN_OPTS}" # build core and tests - $MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1 + $MVN clean package checkstyle:checkstyle-aggregate -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1 if [[ $? != 0 ]] ; then ERR=`$GREP -A 5 'Compilation failure' $PATCH_DIR/trunkJavacWarnings.txt` echo "Trunk compilation is broken? {code}$ERR{code}" cleanupAndExit 1 fi + mv target/checkstyle-result.xml $PATCH_DIR/trunkCheckstyle.xml } ############################################################################### @@ -489,6 +489,41 @@ checkJavacWarnings () { return 0 } +checkCheckstyleErrors() { + echo "" + echo "" + echo "======================================================================" + echo "======================================================================" + echo " Determining number of patched Checkstyle errors." + echo "======================================================================" + echo "======================================================================" + echo "" + echo "" + if [[ -f $PATCH_DIR/trunkCheckstyle.xml ]] ; then + $MVN package -DskipTests checkstyle:checkstyle-aggregate > /dev/null 2>&1 + mv target/checkstyle-result.xml $PATCH_DIR/patchCheckstyle.xml + mv target/site/checkstyle-aggregate.html $PATCH_DIR + mv target/site/checkstyle.css $PATCH_DIR + trunkCheckstyleErrors=`$GREP ' $PATCH_DIR/patchSiteOutput.txt 2>&1" + echo "$MVN package site -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchSiteOutput.txt 2>&1" export MAVEN_OPTS="${MAVEN_OPTS}" - $MVN compile site -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchSiteOutput.txt 2>&1 + $MVN package site -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchSiteOutput.txt 2>&1 if [[ $? != 0 ]] ; then JIRA_COMMENT="$JIRA_COMMENT @@ -907,9 +907,8 @@ checkProtocErrors (( RESULT = RESULT + $? )) checkJavadocWarnings (( RESULT = RESULT + $? )) -### Checkstyle not implemented yet -#checkStyle -#(( RESULT = RESULT + $? )) +checkCheckstyleErrors +(( RESULT = RESULT + $? )) checkFindbugsWarnings (( RESULT = RESULT + $? )) checkReleaseAuditWarnings diff --git a/hbase-checkstyle/pom.xml b/hbase-checkstyle/pom.xml new file mode 100644 index 00000000000..ce5b46c0a2a --- /dev/null +++ b/hbase-checkstyle/pom.xml @@ -0,0 +1,32 @@ + + + +4.0.0 +org.apache.hbase +hbase-checkstyle +0.99.1 +HBase - Checkstyle +Module to hold Checkstyle properties for HBase. + + + \ No newline at end of file diff --git a/hbase-checkstyle/src/main/resources/hbase/checkstyle-suppressions.xml b/hbase-checkstyle/src/main/resources/hbase/checkstyle-suppressions.xml new file mode 100644 index 00000000000..3531e2a5701 --- /dev/null +++ b/hbase-checkstyle/src/main/resources/hbase/checkstyle-suppressions.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml b/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml new file mode 100644 index 00000000000..8f58623aa9f --- /dev/null +++ b/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index ff232ea6c20..cd652446b04 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ hbase-assembly hbase-testing-util hbase-annotations + hbase-checkstyle scm:git:git://git.apache.org/hbase.git @@ -715,6 +716,22 @@ ${protoc.path} + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.13 + + + org.apache.hbase + hbase-checkstyle + ${project.version} + + + + hbase/checkstyle.xml + hbase/checkstyle-suppressions.xml + + @@ -764,6 +781,21 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + + org.apache.hbase + hbase-checkstyle + ${project.version} + + + + hbase/checkstyle.xml + hbase/checkstyle-suppressions.xml + + @@ -2156,7 +2188,15 @@ - + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.13 + + hbase/checkstyle.xml + hbase/checkstyle-suppressions.xml + +