|
@@ -300,6 +300,17 @@ prebuildWithoutPatch () {
|
|
|
{color:red}-1 patch{color}. Trunk compilation may be broken."
|
|
|
return 1
|
|
|
fi
|
|
|
+
|
|
|
+ echo "$MVN clean test javadoc:javadoc -DskipTests -Pdocs -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavadocWarnings.txt 2>&1"
|
|
|
+ $MVN clean test javadoc:javadoc -DskipTests -Pdocs -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavadocWarnings.txt 2>&1
|
|
|
+ if [[ $? != 0 ]] ; then
|
|
|
+ echo "Trunk javadoc compilation is broken?"
|
|
|
+ JIRA_COMMENT="$JIRA_COMMENT
|
|
|
+
|
|
|
+ {color:red}-1 patch{color}. Trunk compilation may be broken."
|
|
|
+ return 1
|
|
|
+ fi
|
|
|
+
|
|
|
return 0
|
|
|
}
|
|
|
|
|
@@ -401,6 +412,11 @@ applyPatch () {
|
|
|
}
|
|
|
|
|
|
###############################################################################
|
|
|
+calculateJavadocWarnings() {
|
|
|
+ WARNING_FILE="$1"
|
|
|
+ RET=$(egrep "^[0-9]+ warnings$" "$WARNING_FILE" | awk '{sum+=$1} END {print sum}')
|
|
|
+}
|
|
|
+
|
|
|
### Check there are no javadoc warnings
|
|
|
checkJavadocWarnings () {
|
|
|
echo ""
|
|
@@ -420,24 +436,29 @@ checkJavadocWarnings () {
|
|
|
(cd hadoop-common-project/hadoop-annotations; $MVN install > /dev/null 2>&1)
|
|
|
fi
|
|
|
$MVN clean test javadoc:javadoc -DskipTests -Pdocs -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/patchJavadocWarnings.txt 2>&1
|
|
|
- javadocWarnings=`$GREP '\[WARNING\]' $PATCH_DIR/patchJavadocWarnings.txt | $AWK '/Javadoc Warnings/,EOF' | $GREP warning | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'`
|
|
|
- echo ""
|
|
|
- echo ""
|
|
|
- echo "There appear to be $javadocWarnings javadoc warnings generated by the patched build."
|
|
|
-
|
|
|
- #There are 12 warnings that are caused by things that are caused by using sun internal APIs.
|
|
|
- #There are 2 warnings that are caused by the Apache DS Dn class used in MiniKdc.
|
|
|
- OK_JAVADOC_WARNINGS=14;
|
|
|
- ### if current warnings greater than OK_JAVADOC_WARNINGS
|
|
|
- if [[ $javadocWarnings -ne $OK_JAVADOC_WARNINGS ]] ; then
|
|
|
- JIRA_COMMENT="$JIRA_COMMENT
|
|
|
+ calculateJavadocWarnings "$PATCH_DIR/trunkJavadocWarnings.txt"
|
|
|
+ numTrunkJavadocWarnings=$RET
|
|
|
+ calculateJavadocWarnings "$PATCH_DIR/patchJavadocWarnings.txt"
|
|
|
+ numPatchJavadocWarnings=$RET
|
|
|
+ grep -i warning "$PATCH_DIR/trunkJavadocWarnings.txt" > "$PATCH_DIR/trunkJavadocWarningsFiltered.txt"
|
|
|
+ grep -i warning "$PATCH_DIR/patchJavadocWarnings.txt" > "$PATCH_DIR/patchJavadocWarningsFiltered.txt"
|
|
|
+ diff -u "$PATCH_DIR/trunkJavadocWarningsFiltered.txt" \
|
|
|
+ "$PATCH_DIR/patchJavadocWarningsFiltered.txt" > \
|
|
|
+ "$PATCH_DIR/diffJavadocWarnings.txt"
|
|
|
+ rm -f "$PATCH_DIR/trunkJavadocWarningsFiltered.txt" "$PATCH_DIR/patchJavadocWarningsFiltered.txt"
|
|
|
+ echo "There appear to be $numTrunkJavadocWarnings javadoc warnings before the patch and $numPatchJavadocWarnings javadoc warnings after applying the patch."
|
|
|
+ if [[ $numTrunkJavadocWarnings != "" && $numPatchJavadocWarnings != "" ]] ; then
|
|
|
+ if [[ $numPatchJavadocWarnings -gt $numTrunkJavadocWarnings ]] ; then
|
|
|
+ JIRA_COMMENT="$JIRA_COMMENT
|
|
|
|
|
|
- {color:red}-1 javadoc{color}. The javadoc tool appears to have generated `expr $(($javadocWarnings-$OK_JAVADOC_WARNINGS))` warning messages."
|
|
|
- return 1
|
|
|
+ {color:red}-1 javadoc{color}. The javadoc tool appears to have generated `expr $(($numPatchJavadocWarnings-$numTrunkJavadocWarnings))` warning messages.
|
|
|
+ See $BUILD_URL/artifact/trunk/patchprocess/diffJavadocWarnings.txt for details."
|
|
|
+ return 1
|
|
|
+ fi
|
|
|
fi
|
|
|
JIRA_COMMENT="$JIRA_COMMENT
|
|
|
|
|
|
- {color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages."
|
|
|
+ {color:green}+1 javadoc{color}. There were no new javadoc warning messages."
|
|
|
return 0
|
|
|
}
|
|
|
|