main branch updated
This commit is contained in:
parent
3d33d3fe49
commit
9a05dc1657
353 changed files with 16802 additions and 2995 deletions
|
|
@ -14,9 +14,6 @@ PR_NUMBER=$5
|
|||
stableBranch="master"
|
||||
repository="android"
|
||||
|
||||
ruby scripts/analysis/lint-up.rb
|
||||
lintValue=$?
|
||||
|
||||
curl "https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.xml" -o "/tmp/$stableBranch.xml"
|
||||
[[ ! -e "/tmp/$stableBranch.xml" ]] && exit 1
|
||||
|
||||
|
|
@ -36,18 +33,10 @@ if [ "$BRANCH" = $stableBranch ]; then
|
|||
echo "New spotbugs result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html"
|
||||
curl -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT https://nextcloud.kaminsky.me/remote.php/dav/files/${LOG_USERNAME}/$repository-findbugs/$stableBranch.html --upload-file app/build/reports/spotbugs/spotbugs.html
|
||||
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/dav/files/${LOG_USERNAME}/$repository-findbugs/$stableBranch.xml" --upload-file app/build/reports/spotbugs/gplayDebug.xml
|
||||
|
||||
if [ $lintValue -ne 1 ]; then
|
||||
echo "New lint result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-lint/$stableBranch.html"
|
||||
curl -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT https://nextcloud.kaminsky.me/remote.php/dav/files/${LOG_USERNAME}/$repository-lint/$stableBranch.html --upload-file app/build/reports/lint/lint.html
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
if [ -e "${BUILD_NUMBER}" ]; then
|
||||
6=$stableBranch"-"$(date +%F)
|
||||
fi
|
||||
echo "New lint results at https://www.kaminsky.me/nc-dev/$repository-lint/${BUILD_NUMBER}.html"
|
||||
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/dav/files/${LOG_USERNAME}/$repository-lint/${BUILD_NUMBER}.html" --upload-file app/build/reports/lint/lint.html
|
||||
|
||||
echo "New spotbugs results at https://www.kaminsky.me/nc-dev/$repository-findbugs/${BUILD_NUMBER}.html"
|
||||
curl 2>/dev/null -u "${LOG_USERNAME}:${LOG_PASSWORD}" -X PUT "https://nextcloud.kaminsky.me/remote.php/dav/files/${LOG_USERNAME}/$repository-findbugs/${BUILD_NUMBER}.html" --upload-file app/build/reports/spotbugs/spotbugs.html
|
||||
|
|
@ -59,41 +48,13 @@ else
|
|||
curl_gh -X DELETE "https://api.github.com/repos/nextcloud/$repository/issues/comments/$comment"
|
||||
done
|
||||
|
||||
# lint and spotbugs file must exist
|
||||
if [ ! -s app/build/reports/lint/lint.html ] ; then
|
||||
echo "lint.html file is missing!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# spotbugs file must exist
|
||||
if [ ! -s app/build/reports/spotbugs/spotbugs.html ] ; then
|
||||
echo "spotbugs.html file is missing!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# add comment with results
|
||||
lintResultNew=$(grep "Lint Report.* [0-9]* warning" app/build/reports/lint/lint.html | cut -f2 -d':' |cut -f1 -d'<')
|
||||
|
||||
lintErrorNew=$(echo $lintResultNew | grep "[0-9]* error" -o | cut -f1 -d" ")
|
||||
if ( [ -z $lintErrorNew ] ); then
|
||||
lintErrorNew=0
|
||||
fi
|
||||
|
||||
lintWarningNew=$(echo $lintResultNew | grep "[0-9]* warning" -o | cut -f1 -d" ")
|
||||
if ( [ -z $lintWarningNew ] ); then
|
||||
lintWarningNew=0
|
||||
fi
|
||||
|
||||
lintResultOld=$(curl 2>/dev/null "https://raw.githubusercontent.com/nextcloud/$repository/$stableBranch/scripts/analysis/lint-results.txt")
|
||||
lintErrorOld=$(echo $lintResultOld | grep "[0-9]* error" -o | cut -f1 -d" ")
|
||||
if ( [ -z $lintErrorOld ] ); then
|
||||
lintErrorOld=0
|
||||
fi
|
||||
|
||||
lintWarningOld=$(echo $lintResultOld | grep "[0-9]* warning" -o | cut -f1 -d" ")
|
||||
if ( [ -z $lintWarningOld ] ); then
|
||||
lintWarningOld=0
|
||||
fi
|
||||
|
||||
if [ $stableBranch = "master" ] ; then
|
||||
codacyValue=$(curl 2>/dev/null https://app.codacy.com/dashboards/breakdown\?projectId\=44248 | grep "total issues" | cut -d">" -f3 | cut -d"<" -f1)
|
||||
codacyResult="<h1>Codacy</h1>$codacyValue"
|
||||
|
|
@ -101,14 +62,8 @@ else
|
|||
codacyResult=""
|
||||
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/${BUILD_NUMBER}.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>"
|
||||
|
||||
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/${BUILD_NUMBER}.html" --link-base "https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html")"
|
||||
|
||||
if ( [ $lintValue -eq 1 ] ) ; then
|
||||
lintMessage="<h1>Lint increased!</h1>"
|
||||
fi
|
||||
|
||||
if ( [ $spotbugsValue -eq 1 ] ) ; then
|
||||
spotbugsMessage="<h1>SpotBugs increased!</h1>"
|
||||
fi
|
||||
|
|
@ -125,7 +80,7 @@ else
|
|||
notNull="org.jetbrains.annotations.* is used. Please use androidx.annotation.* instead.<br><br>"
|
||||
fi
|
||||
|
||||
bodyContent="$codacyResult $lintResult $spotbugsResult $lintMessage $spotbugsMessage $gplayLimitation $notNull"
|
||||
bodyContent="$codacyResult $spotbugsResult $spotbugsMessage $gplayLimitation $notNull"
|
||||
echo "$bodyContent" >> "$GITHUB_STEP_SUMMARY"
|
||||
payload="{ \"body\" : \"$bodyContent\" }"
|
||||
curl_gh -X POST "https://api.github.com/repos/nextcloud/$repository/issues/${PR_NUMBER}/comments" -d "$payload"
|
||||
|
|
@ -134,10 +89,6 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! $lintValue -eq 2 ]; then
|
||||
exit $lintValue
|
||||
fi
|
||||
|
||||
if [ -n "$notNull" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -6,12 +6,20 @@
|
|||
|
||||
snapshotCount=$(./gradlew dependencies | grep SNAPSHOT -c)
|
||||
betaCount=$(grep "<bool name=\"is_beta\">true</bool>" app/src/main/res/values/setup.xml -c)
|
||||
libraryHash=$(grep androidLibraryVersion build.gradle | cut -d= -f2 | tr -d \")
|
||||
|
||||
# Read androidLibraryVersion from TOML
|
||||
libraryHash=$(grep 'androidLibraryVersion' gradle/libs.versions.toml \
|
||||
| cut -d '=' -f2 \
|
||||
| tr -d ' "' )
|
||||
|
||||
baseBranch="master"
|
||||
lastHashes=$(curl "https://api.github.com/repos/nextcloud/android-library/commits?sha=$baseBranch" | jq ".[] .sha" | head -n 20)
|
||||
|
||||
if [[ $(echo "$lastHashes" | grep -c $libraryHash) -ne 1 ]]; then
|
||||
# Fetch last 10 commit SHAs from GitHub, without quotes
|
||||
lastHashes=$(curl -s "https://api.github.com/repos/nextcloud/android-library/commits?sha=$baseBranch" \
|
||||
| jq -r '.[].sha' | head -n 10)
|
||||
|
||||
# Check if libraryHash is in lastHashes
|
||||
if ! echo "$lastHashes" | grep -q "^$libraryHash$"; then
|
||||
echo "Library commit not within last 10 hashes, please rebase!"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -20,10 +28,10 @@ if [[ $snapshotCount -gt 0 ]] ; then
|
|||
echo "Snapshot found in dependencies"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $betaCount -gt 0 ]] ; then
|
||||
echo "Beta is set in setup.xml"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
DO NOT TOUCH; GENERATED BY DRONE
|
||||
<span class="mdl-layout-title">Lint Report: 11 errors and 47 warnings</span>
|
||||
<span class="mdl-layout-title">Lint Report: 11 errors and 41 warnings</span>
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
||||
#
|
||||
date=$(date +%Y%m%d)
|
||||
oldLibraryCommit=$(grep "androidLibraryVersion\ =" build.gradle)
|
||||
oldLibraryCommit=$(grep "androidLibraryVersion\ =" gradle/libs.versions.toml)
|
||||
libraryCommit=$(curl https://api.github.com/repos/nextcloud/android-library/commits/master | jq .sha | sed s'/\"//g')
|
||||
|
||||
# use current date for version code/name
|
||||
sed -i "/versionDev/,/\}/ s/versionCode .*/versionCode $date/" app/build.gradle
|
||||
sed -i "/versionDev/,/\}/ s/versionName .*/versionName \"$date\"/" app/build.gradle
|
||||
sed -i "/versionDev/,/\}/ s/versionCode .*/versionCode = $date/" app/build.gradle.kts
|
||||
sed -i "/versionDev/,/\}/ s/versionName .*/versionName = \"$date\"/" app/build.gradle.kts
|
||||
|
||||
# change library
|
||||
sed -i s"#androidLibraryVersion\ =.*#androidLibraryVersion =\"$libraryCommit\"#" build.gradle
|
||||
sed -i s"#androidLibraryVersion\ =.*#androidLibraryVersion = \"$libraryCommit\"#" gradle/libs.versions.toml
|
||||
./gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256,pgp help
|
||||
|
||||
# build signed apk
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ if [ -z "$PR_NUMBER" ] ; then
|
|||
fi
|
||||
|
||||
export BRANCH=$(scripts/analysis/getBranchBase.sh "$PR_NUMBER" | sed 's/"//g')
|
||||
if [ "$(git diff --name-only "origin/$BRANCH" | grep -cE "^app/src|screenshots|build.gradle|.drone.yml|gradle")" -eq 0 ] ; then
|
||||
if [ "$(git diff --name-only "origin/$BRANCH" | grep -cE "^app/src|screenshots|build.gradle.kts|.drone.yml|gradle")" -eq 0 ] ; then
|
||||
echo "No source files changed"
|
||||
exit 1
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue