Browse Source

Merge pull request #3087 from nextcloud/useAssembleOnFindbugs

Fix findbugs
Andy Scherzinger 6 years ago
parent
commit
0ee0c655cf
2 changed files with 14 additions and 3 deletions
  1. 1 1
      build.gradle
  2. 13 2
      scripts/analysis/analysis-wrapper.sh

+ 1 - 1
build.gradle

@@ -183,7 +183,7 @@ android {
         ignoreFailures = false
         effort = "max"
         reportLevel = "medium"
-        classes = fileTree("$project.buildDir/intermediates/classes/gplay/debug/com/owncloud")
+        classes = fileTree("$project.buildDir/intermediates/javac/gplayDebug/compileGplayDebugJavaWithJavac/classes/")
         excludeFilter = file("${project.rootDir}/findbugs-filter.xml")
         source = fileTree('src/main/java')
         pluginClasspath = project.configurations.findbugsPlugins

+ 13 - 2
scripts/analysis/analysis-wrapper.sh

@@ -11,13 +11,13 @@
 ruby scripts/analysis/lint-up.rb $1 $2 $3
 lintValue=$?
 
-./gradlew findbugs
-
 # exit codes:
 # 0: count was reduced
 # 1: count was increased
 # 2: count stayed the same
 
+./gradlew findbugs
+
 echo "Branch: $3"
 
 if [ $3 = "master" ]; then
@@ -58,6 +58,17 @@ else
         checkLibrary=0
     fi
     
+    # lint and findbugs file must exist
+    if [ ! -s build/reports/lint/lint.html ] ; then
+        echo "lint.html file is missing!"
+        exit 1
+    fi
+    
+    if [ ! -s build/reports/findbugs/findbugs.html ] ; then
+        echo "findbugs.html file is missing!"
+        exit 1
+    fi 
+    
     # add comment with results
     lintResultNew=$(grep "Lint Report.* [0-9]* warnings" build/reports/lint/lint.html | cut -f2 -d':' |cut -f1 -d'<')
     lintErrorNew=$(echo $lintResultNew | grep  "[0-9]* error" -o | cut -f1 -d" ")