build: reactivate jacoco using the latest version

This version works with Java 8.
Another commit on the ‘develop’ branch (3ed4896) upgraded jacoco to the
very same version.
diff --git a/build.gradle b/build.gradle
index 2c0db13..20f215e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -175,7 +175,7 @@
   if( ext.javaDir.isDirectory() || ext.scalaDir.isDirectory() ||
       ext.testJavaDir.isDirectory() || ext.testScalaDir.isDirectory() )
   {
-//    apply plugin: 'jacoco'
+    apply plugin: 'jacoco'
     apply plugin: 'osgi'
     apply plugin: VersionClass
     apply plugin: AsciidocBuildInfo
@@ -250,7 +250,7 @@
       systemProperties = testProperties
       systemProperties['user.dir'] = workingDir // GRADLE-2859
       ignoreFailures = true
-      testReport = true
+      reports.html.enabled(true)
       afterSuite { descriptor, result ->
         if( result.resultType == TestResult.ResultType.FAILURE )
         {
@@ -258,6 +258,9 @@
         }
       }
     }
+    jacoco {
+      toolVersion = '0.7.2.201409121644'
+    }
 
 //    // Create checkstyle report
 //    task checkstyleReport( type: Xslt, dependsOn: check ) {
@@ -340,63 +343,63 @@
 
 // Jacoco
 configurations {
-//  jacoco
+  jacoco
 }
 dependencies {
-//  jacoco 'org.jacoco:org.jacoco.ant:0.7.1.201405082137'
+  jacoco 'org.jacoco:org.jacoco.ant:0.7.2.201409121644'
 }
 // Generate a global code codeverage report
-//task coverageReport {
-//  dependsOn subprojects*.test
-//  def outputPath = "build/reports/coverage"
-//  def coveredProjects = subprojects.findAll { p -> new File( "${p.buildDir.path}/jacoco" ).exists() }
-//  def coreProjects = coveredProjects.findAll { p -> p.name.startsWith('org.qi4j.core' ) }
-//  def libProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.lib' ) }
-//  def extProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.ext' ) }
-//  def toolsProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tool' ) }
-//  def tutoProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tuto' ) }
-//  def samplesProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.sample' ) }
-//  ant {
-//    taskdef name:'jacocoreport', classname: 'org.jacoco.ant.ReportTask', classpath: configurations.jacoco.asPath
-//    mkdir dir: outputPath
-//    jacocoreport {
-//      executiondata {
-//        coveredProjects.collect { p -> fileset( dir: "${p.buildDir.path}/jacoco" ) { include( name: '*.exec' ) } }
-//      }
-//      structure( name: "Qi4j SDK" ) {
-//        group( name: "Core" ) {
-//          classfiles { coreProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { coreProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Libraries" ) {
-//          classfiles { libProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { libProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Extensions" ) {
-//          classfiles { extProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { extProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Tools" ) {
-//          classfiles { toolsProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { toolsProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Tutorials" ) {
-//          classfiles { tutoProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { tutoProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Samples" ) {
-//          classfiles { samplesProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { samplesProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//      }
-//      csv  destfile: "${outputPath}/jacoco.csv", encoding: "UTF-8"
-//      xml  destfile: "${outputPath}/jacoco.xml", encoding: "UTF-8"
-//      html destdir:  outputPath, encoding: "UTF-8", locale: "en", footer: "Qi4j SDK"
-//    }
-//  }
-//  inputs.dir coveredProjects.collect { p -> "${p.buildDir.path}/jacoco" }
-//  outputs.dir outputPath
-//}
+task coverageReport {
+  dependsOn subprojects*.test
+  def outputPath = "build/reports/coverage"
+  def coveredProjects = subprojects.findAll { p -> new File( "${p.buildDir.path}/jacoco" ).exists() }
+  def coreProjects = coveredProjects.findAll { p -> p.name.startsWith('org.qi4j.core' ) }
+  def libProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.lib' ) }
+  def extProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.ext' ) }
+  def toolsProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tool' ) }
+  def tutoProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tuto' ) }
+  def samplesProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.sample' ) }
+  ant {
+    taskdef name:'jacocoreport', classname: 'org.jacoco.ant.ReportTask', classpath: configurations.jacoco.asPath
+    mkdir dir: outputPath
+    jacocoreport {
+      executiondata {
+        coveredProjects.collect { p -> fileset( dir: "${p.buildDir.path}/jacoco" ) { include( name: '*.exec' ) } }
+      }
+      structure( name: "Qi4j SDK" ) {
+        group( name: "Core" ) {
+          classfiles { coreProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { coreProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Libraries" ) {
+          classfiles { libProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { libProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Extensions" ) {
+          classfiles { extProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { extProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Tools" ) {
+          classfiles { toolsProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { toolsProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Tutorials" ) {
+          classfiles { tutoProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { tutoProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Samples" ) {
+          classfiles { samplesProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { samplesProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+      }
+      csv  destfile: "${outputPath}/jacoco.csv", encoding: "UTF-8"
+      xml  destfile: "${outputPath}/jacoco.xml", encoding: "UTF-8"
+      html destdir:  outputPath, encoding: "UTF-8", locale: "en", footer: "Qi4j SDK"
+    }
+  }
+  inputs.dir subprojects.collect { p -> "${p.buildDir.path}/jacoco" }
+  outputs.dir outputPath
+}
 
 
 // Build the whole SDK public Javadoc