Skip to content

Commit 473a899

Browse files
committed
Added a Spot Bugs Implementation, which does not cause tasks to fail and so is purely optional
1 parent ed3d67b commit 473a899

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

build.gradle

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ buildscript {
55
repositories {
66
google()
77
jcenter()
8+
maven {
9+
url "https://plugins.gradle.org/m2/"
10+
}
811
}
912
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.1.4'
13+
classpath 'com.android.tools.build:gradle:3.5.3'
1114
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
1215
classpath 'me.tatarka:gradle-retrolambda:3.7.1'
16+
classpath "com.github.spotbugs:spotbugs-gradle-plugin:3.0.0"
1317
}
1418
}
1519

@@ -21,6 +25,7 @@ allprojects {
2125
}
2226

2327
apply plugin: 'base'
28+
apply plugin: 'com.github.spotbugs'
2429
apply from: file('version.gradle')
2530

2631
apply plugin: 'me.tatarka.retrolambda'
@@ -35,6 +40,22 @@ subprojects {
3540
} else {
3641
apply from: rootProject.file('common-android-app.gradle')
3742
}
43+
44+
if (!project.name.endsWith("-native") && project.name != "jme3-bullet-native-android") {
45+
apply plugin: 'com.github.spotbugs'
46+
47+
// Currently we only warn about issues and try to fix them as we go, but those aren't mission critical.
48+
spotbugs {
49+
ignoreFailures = true
50+
}
51+
52+
tasks.withType(com.github.spotbugs.SpotBugsTask) {
53+
reports {
54+
html.enabled = !project.hasProperty("xml-reports")
55+
xml.enabled = project.hasProperty("xml-reports")
56+
}
57+
}
58+
}
3859
}
3960

4061
task run(dependsOn: ':jme3-examples:run') {

0 commit comments

Comments
 (0)