Эх сурвалжийг харах

change to newer spotbugs

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 4 жил өмнө
parent
commit
f6f401aa0d

+ 1 - 1
.github/workflows/gPlayFlavor.yml

@@ -16,7 +16,7 @@ jobs:
                 with:
                     java-version: 1.8
             -   name: Install NDK
-                run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
+                run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
             -   name: Build with Gradle
                 run: |
                     mkdir -p $HOME/.gradle

+ 1 - 1
.github/workflows/genericFlavor.yml

@@ -16,7 +16,7 @@ jobs:
                 with:
                     java-version: 1.8
             -   name: Install NDK
-                run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
+                run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
             -   name: Build generic
                 run: |
                     mkdir -p $HOME/.gradle

+ 5 - 13
build.gradle

@@ -4,7 +4,6 @@
 // Due to this, the files layout is not the usual in new projects created with Android Studio / gradle. This file
 // merges declarations usually split in two separates build.gradle file, one for global settings of the project in
 // its root folder, another one for the app module in subfolder of root.
-import com.github.spotbugs.SpotBugsTask
 
 buildscript {
     ext.kotlin_version = '1.3.72'
@@ -21,10 +20,8 @@ buildscript {
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:4.0.0'
-        classpath('com.dicedmelon.gradle:jacoco-android:0.1.4') {
-            exclude group: 'org.codehaus.groovy', module: 'groovy-all'
-        }
-        classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.6'
+        classpath('com.hiya:jacoco-android:0.2')
+        classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.3.0'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
         classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.9.1"
         classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
@@ -39,7 +36,7 @@ apply plugin: 'kotlin-android-extensions'
 apply plugin: 'kotlin-kapt'
 apply plugin: 'checkstyle'
 apply plugin: 'pmd'
-apply plugin: 'jacoco-android'
+apply plugin: 'com.hiya.jacoco-android'
 apply plugin: 'com.github.spotbugs'
 apply plugin: 'io.gitlab.arturbosch.detekt'
 apply plugin: 'shot'
@@ -238,17 +235,12 @@ android {
     android.applicationVariants.all { variant ->
         String variantName = variant.name
         String capVariantName = variantName.substring(0, 1).toUpperCase() + variantName.substring(1)
-        tasks.register("spotbugs${capVariantName}", SpotBugsTask) {
+        tasks.register("spotbugs${capVariantName}Report", com.github.spotbugs.snom.SpotBugsTask) {
             ignoreFailures = true // should continue checking
             effort = "max"
             reportLevel = "medium"
             classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
             excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
-            pluginClasspath = project.configurations.spotbugsPlugins
-            source = fileTree('src/main/java')
-            classpath = files()
-            include '**/*.java'
-            exclude '**/gen/**'
 
             reports {
                 xml.enabled = false
@@ -260,7 +252,7 @@ android {
         }
     }
 
-    check.dependsOn 'checkstyle', 'spotbugsGplayDebug', 'pmd', 'lint', 'ktlint', 'detekt'
+    check.dependsOn 'checkstyle', 'spotbugsGplayDebugReport', 'pmd', 'lint', 'ktlint', 'detekt'
 
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8

+ 1 - 1
scripts/analysis/findbugs-up.rb

@@ -56,7 +56,7 @@ if result != 0
     exit 1
 end
 
-system './gradlew spotbugsGplayDebug'
+system './gradlew spotbugsGplayDebugReport'
 
 # find FindBugs report file
 findbugs_reports = Dir.glob(FINDBUGS_REPORT_FILE)

+ 1 - 1
src/main/res/layout-land/account_setup.xml

@@ -22,6 +22,7 @@
 -->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/scroll"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_alignParentTop="true"
@@ -38,7 +39,6 @@
         android:src="@drawable/logo" />
 
     <ScrollView
-        android:id="@+id/scroll"
         android:layout_width="0dp"
         android:layout_height="match_parent"
         android:layout_weight="1"