build: Add sonarqube and cobertura plugins to gradle
To use it, add the following configuration in ~/.gradle/gradle.properties
systemProp.sonar.host.url=<SONARQUBE-URL>
systemProp.sonar.login=<SONARQUBE-USER>
systemProp.sonar.password=<SONARQUBE-PASSWORD>
You can also specify these settings in the command line:
./gradlew cobertura sonarqube -Dsonar.host.url=<> -Dsonar.login=<> -Dsonar.password=<>
Change-Id: Ic759b7b18f737717f8bb0c468cf5a1d10cd23b87
diff --git a/build.gradle b/build.gradle
index 95bdd2d..f17f9be 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,6 +5,11 @@
}
}
+plugins {
+ id "org.sonarqube" version "1.2"
+ id 'net.saliman.cobertura' version '2.3.0'
+}
+
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
@@ -25,6 +30,7 @@
dependencies {
compile 'net.named-data:jndn:0.10'
testCompile 'junit:junit:4.12'
+ testRuntime 'org.slf4j:slf4j-api:1.7.16'
}
task javadocJar(type: Jar) {
@@ -120,3 +126,7 @@
}
}
}
+
+cobertura {
+ coverageFormats = ['html', 'xml']
+}