Kaynağa Gözat

Added a Spot Bugs Implementation, which does not cause tasks to fail and so is purely optional

MeFisto94 5 yıl önce
ebeveyn
işleme
473a899e95
1 değiştirilmiş dosya ile 22 ekleme ve 1 silme
  1. 22 1
      build.gradle

+ 22 - 1
build.gradle

@@ -5,11 +5,15 @@ buildscript {
     repositories {
         google()
         jcenter()
+        maven {
+            url "https://plugins.gradle.org/m2/"
+        }
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.1.4'
+        classpath 'com.android.tools.build:gradle:3.5.3'
         classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
         classpath 'me.tatarka:gradle-retrolambda:3.7.1'
+        classpath "com.github.spotbugs:spotbugs-gradle-plugin:3.0.0"
     }
 }
 
@@ -21,6 +25,7 @@ allprojects {
 }
 
 apply plugin: 'base'
+apply plugin: 'com.github.spotbugs'
 apply from: file('version.gradle')
 
 apply plugin: 'me.tatarka.retrolambda'
@@ -35,6 +40,22 @@ subprojects {
     } else {
         apply from: rootProject.file('common-android-app.gradle')
     }
+
+    if (!project.name.endsWith("-native") && project.name != "jme3-bullet-native-android") {
+        apply plugin: 'com.github.spotbugs'
+
+        // Currently we only warn about issues and try to fix them as we go, but those aren't mission critical.
+        spotbugs {
+            ignoreFailures = true
+        }
+
+        tasks.withType(com.github.spotbugs.SpotBugsTask) {
+            reports {
+                html.enabled = !project.hasProperty("xml-reports")
+                xml.enabled = project.hasProperty("xml-reports")
+            }
+        }
+    }
 }
 
 task run(dependsOn: ':jme3-examples:run') {