|
@@ -14,8 +14,9 @@ repository="android"
|
|
ruby scripts/analysis/lint-up.rb $1 $2 $3
|
|
ruby scripts/analysis/lint-up.rb $1 $2 $3
|
|
lintValue=$?
|
|
lintValue=$?
|
|
|
|
|
|
-ruby scripts/analysis/findbugs-up.rb $1 $2 $3
|
|
|
|
-findbugsValue=$?
|
|
|
|
|
|
+curl 2>/dev/null "https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.xml" -o "/tmp/$stableBranch.xml"
|
|
|
|
+ruby scripts/analysis/spotbugs-up.rb "$3"
|
|
|
|
+spotbugsValue=$?
|
|
|
|
|
|
# exit codes:
|
|
# exit codes:
|
|
# 0: count was reduced
|
|
# 0: count was reduced
|
|
@@ -25,11 +26,9 @@ findbugsValue=$?
|
|
echo "Branch: $3"
|
|
echo "Branch: $3"
|
|
|
|
|
|
if [ $3 = $stableBranch ]; then
|
|
if [ $3 = $stableBranch ]; then
|
|
- echo "New findbugs result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html"
|
|
|
|
|
|
+ echo "New spotbugs result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html"
|
|
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.html --upload-file app/build/reports/spotbugs/spotbugs.html
|
|
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.html --upload-file app/build/reports/spotbugs/spotbugs.html
|
|
-
|
|
|
|
- summary=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" app/build/reports/spotbugs/spotbugs.html | head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s"/Summary/SpotBugs ($stableBranch)/" | tr "\"" "\'" | tr -d "\r\n")
|
|
|
|
- curl -u $4:$5 -X PUT -d "$summary" https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/findbugs-summary-$stableBranch.html
|
|
|
|
|
|
+ curl 2>/dev/null -u "$4:$5" -X PUT "https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.xml" --upload-file app/build/reports/spotbugs/gplayDebug.xml
|
|
|
|
|
|
if [ $lintValue -ne 1 ]; then
|
|
if [ $lintValue -ne 1 ]; then
|
|
echo "New lint result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-lint/$stableBranch.html"
|
|
echo "New lint result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-lint/$stableBranch.html"
|
|
@@ -43,7 +42,7 @@ else
|
|
echo "New lint results at https://www.kaminsky.me/nc-dev/$repository-lint/$6.html"
|
|
echo "New lint results at https://www.kaminsky.me/nc-dev/$repository-lint/$6.html"
|
|
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-lint/$6.html --upload-file app/build/reports/lint/lint.html
|
|
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-lint/$6.html --upload-file app/build/reports/lint/lint.html
|
|
|
|
|
|
- echo "New findbugs results at https://www.kaminsky.me/nc-dev/$repository-findbugs/$6.html"
|
|
|
|
|
|
+ echo "New spotbugs results at https://www.kaminsky.me/nc-dev/$repository-findbugs/$6.html"
|
|
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$6.html --upload-file app/build/reports/spotbugs/spotbugs.html
|
|
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$6.html --upload-file app/build/reports/spotbugs/spotbugs.html
|
|
|
|
|
|
# delete all old comments, starting with Codacy
|
|
# delete all old comments, starting with Codacy
|
|
@@ -65,7 +64,7 @@ else
|
|
checkLibrary=0
|
|
checkLibrary=0
|
|
fi
|
|
fi
|
|
|
|
|
|
- # lint and findbugs file must exist
|
|
|
|
|
|
+ # lint and spotbugs file must exist
|
|
if [ ! -s app/build/reports/lint/lint.html ] ; then
|
|
if [ ! -s app/build/reports/lint/lint.html ] ; then
|
|
echo "lint.html file is missing!"
|
|
echo "lint.html file is missing!"
|
|
exit 1
|
|
exit 1
|
|
@@ -108,16 +107,15 @@ else
|
|
fi
|
|
fi
|
|
|
|
|
|
lintResult="<h1>Lint</h1><table width='500' cellpadding='5' cellspacing='2'><tr class='tablerow0'><td>Type</td><td><a href='https://www.kaminsky.me/nc-dev/"$repository"-lint/"$stableBranch".html'>$stableBranch</a></td><td><a href='https://www.kaminsky.me/nc-dev/"$repository"-lint/"$6".html'>PR</a></td></tr><tr class='tablerow1'><td>Warnings</td><td>"$lintWarningOld"</td><td>"$lintWarningNew"</td></tr><tr class='tablerow0'><td>Errors</td><td>"$lintErrorOld"</td><td>"$lintErrorNew"</td></tr></table>"
|
|
lintResult="<h1>Lint</h1><table width='500' cellpadding='5' cellspacing='2'><tr class='tablerow0'><td>Type</td><td><a href='https://www.kaminsky.me/nc-dev/"$repository"-lint/"$stableBranch".html'>$stableBranch</a></td><td><a href='https://www.kaminsky.me/nc-dev/"$repository"-lint/"$6".html'>PR</a></td></tr><tr class='tablerow1'><td>Warnings</td><td>"$lintWarningOld"</td><td>"$lintWarningNew"</td></tr><tr class='tablerow0'><td>Errors</td><td>"$lintErrorOld"</td><td>"$lintErrorNew"</td></tr></table>"
|
|
- findbugsResultNew=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" app/build/reports/spotbugs/spotbugs.html |head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s"#Summary#<a href=\"https://www.kaminsky.me/nc-dev/$repository-findbugs/$6.html\">SpotBugs</a> (new)#" | tr "\"" "\'" | tr -d "\n")
|
|
|
|
- findbugsResultOld=$(curl 2>/dev/null https://www.kaminsky.me/nc-dev/$repository-findbugs/findbugs-summary-$stableBranch.html | tr "\"" "\'" | tr -d "\r\n" | sed s"#SpotBugs#<a href=\"https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html\">SpotBugs</a>#" | tr "\"" "\'" | tr -d "\n")
|
|
|
|
|
|
|
|
|
|
+ spotbugsResult="<h1>SpotBugs</h1>$(scripts/analysis/spotbugsComparison.py "/tmp/$stableBranch.xml" app/build/reports/spotbugs/gplayDebug.xml --link-new "https://www.kaminsky.me/nc-dev/$repository-findbugs/$6.html" --link-base "https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html")"
|
|
|
|
|
|
if ( [ $lintValue -eq 1 ] ) ; then
|
|
if ( [ $lintValue -eq 1 ] ) ; then
|
|
lintMessage="<h1>Lint increased!</h1>"
|
|
lintMessage="<h1>Lint increased!</h1>"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if ( [ $findbugsValue -eq 1 ] ) ; then
|
|
|
|
- findbugsMessage="<h1>SpotBugs increased!</h1>"
|
|
|
|
|
|
+ if ( [ $spotbugsValue -eq 1 ] ) ; then
|
|
|
|
+ spotbugsMessage="<h1>SpotBugs increased!</h1>"
|
|
fi
|
|
fi
|
|
|
|
|
|
# check gplay limitation: all changelog files must only have 500 chars
|
|
# check gplay limitation: all changelog files must only have 500 chars
|
|
@@ -132,7 +130,8 @@ else
|
|
notNull="org.jetbrains.annotations.NotNull is used. Please use androidx.annotation.NonNull instead.<br><br>"
|
|
notNull="org.jetbrains.annotations.NotNull is used. Please use androidx.annotation.NonNull instead.<br><br>"
|
|
fi
|
|
fi
|
|
|
|
|
|
- curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/android/issues/$7/comments -d "{ \"body\" : \"$codacyResult $lintResult $findbugsResultNew $findbugsResultOld $checkLibraryMessage $lintMessage $findbugsMessage $gplayLimitation $notNull\" }"
|
|
|
|
|
|
+ payload="{ \"body\" : \"$codacyResult $lintResult $spotbugsResult $checkLibraryMessage $lintMessage $spotbugsMessage $gplayLimitation $notNull\" }"
|
|
|
|
+ curl -u "$1:$2" -X POST "https://api.github.com/repos/nextcloud/android/issues/$7/comments" -d "$payload"
|
|
|
|
|
|
if [ ! -z "$gplayLimitation" ]; then
|
|
if [ ! -z "$gplayLimitation" ]; then
|
|
exit 1
|
|
exit 1
|
|
@@ -150,9 +149,9 @@ else
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [ $findbugsValue -eq 2 ]; then
|
|
|
|
|
|
+ if [ $spotbugsValue -eq 2 ]; then
|
|
exit 0
|
|
exit 0
|
|
else
|
|
else
|
|
- exit $findbugsValue
|
|
|
|
|
|
+ exit $spotbugsValue
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|