Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F183D176FB for ; Fri, 17 Oct 2014 18:14:34 +0000 (UTC) Received: (qmail 48600 invoked by uid 500); 17 Oct 2014 18:14:34 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 48564 invoked by uid 500); 17 Oct 2014 18:14:34 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 48554 invoked by uid 99); 17 Oct 2014 18:14:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Oct 2014 18:14:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7564599A535; Fri, 17 Oct 2014 18:14:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: eclark@apache.org To: commits@hbase.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: HBASE-12261 Add checkstyle to HBase build process Date: Fri, 17 Oct 2014 18:14:34 +0000 (UTC) Repository: hbase Updated Branches: refs/heads/branch-1 be820f3b9 -> 990fb0b9d HBASE-12261 Add checkstyle to HBase build process Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/990fb0b9 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/990fb0b9 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/990fb0b9 Branch: refs/heads/branch-1 Commit: 990fb0b9d60abcddf4089bce7638806670803f95 Parents: be820f3 Author: Elliott Clark Authored: Wed Oct 15 10:28:45 2014 -0700 Committer: Elliott Clark Committed: Fri Oct 17 11:09:39 2014 -0700 ---------------------------------------------------------------------- dev-support/test-patch.sh | 85 ++++++++++---------- hbase-checkstyle/pom.xml | 32 ++++++++ .../resources/hbase/checkstyle-suppressions.xml | 8 ++ .../src/main/resources/hbase/checkstyle.xml | 32 ++++++++ pom.xml | 42 +++++++++- 5 files changed, 155 insertions(+), 44 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/990fb0b9/dev-support/test-patch.sh ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index c42b843..d2ba371 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 http://git-wip-us.apache.org/repos/asf/hbase/blob/990fb0b9/hbase-checkstyle/pom.xml ---------------------------------------------------------------------- diff --git a/hbase-checkstyle/pom.xml b/hbase-checkstyle/pom.xml new file mode 100644 index 0000000..ce5b46c --- /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 http://git-wip-us.apache.org/repos/asf/hbase/blob/990fb0b9/hbase-checkstyle/src/main/resources/hbase/checkstyle-suppressions.xml ---------------------------------------------------------------------- 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 0000000..3531e2a --- /dev/null +++ b/hbase-checkstyle/src/main/resources/hbase/checkstyle-suppressions.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hbase/blob/990fb0b9/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml ---------------------------------------------------------------------- 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 0000000..8f58623 --- /dev/null +++ b/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hbase/blob/990fb0b9/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index ff232ea..cd65244 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 + +