polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [3/3] polygene-java git commit: build: refine AggregatedJacocoReportTask
Date Sun, 23 Apr 2017 18:12:58 GMT
build: refine AggregatedJacocoReportTask


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/d7bddde3
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/d7bddde3
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/d7bddde3

Branch: refs/heads/develop
Commit: d7bddde35188f32b2a27129ba1aa241a2716a9dd
Parents: 965749d
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun Apr 23 20:12:43 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun Apr 23 20:12:43 2017 +0200

----------------------------------------------------------------------
 .../reports/AggregatedJacocoReportTask.groovy   | 56 ++++++++++++++------
 1 file changed, 40 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d7bddde3/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/AggregatedJacocoReportTask.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/AggregatedJacocoReportTask.groovy
b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/AggregatedJacocoReportTask.groovy
index 050271d..5bb3513 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/AggregatedJacocoReportTask.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/AggregatedJacocoReportTask.groovy
@@ -66,28 +66,52 @@ class AggregatedJacocoReportTask extends DefaultTask
         }
         structure( name: 'Apache Polygeneâ„¢ (Java Edition) SDK' ) {
           group( name: 'Core' ) {
-            classfiles { coreProjects.collect { p -> fileset dir: "${ p.buildDir.path
}/classes/main" } }
-            sourcefiles { samplesProjects.collect { p -> sourceRootsOf( p ).each { sourceRoot
-> fileset dir: sourceRoot.absolutePath } } }
+            classfiles { coreProjects.collect { p -> fileset( dir: "${ p.buildDir.path
}/classes/main" ) } }
+            sourcefiles {
+              coreProjects.collect { p ->
+                AggregatedJacocoReportTask.sourceRootsOf( p ).each { sourceRoot -> fileset(
dir: "${ sourceRoot }" ) }
+              }
+            }
           }
           group( name: 'Libraries' ) {
-            classfiles { libProjects.collect { p -> fileset dir: "${ p.buildDir.path }/classes/main"
} }
-            sourcefiles { samplesProjects.collect { p -> sourceRootsOf( p ).each { sourceRoot
-> fileset dir: sourceRoot.absolutePath } } }
+            classfiles { libProjects.collect { p -> fileset( dir: "${ p.buildDir.path
}/classes/main" ) } }
+            sourcefiles {
+              libProjects.collect { p ->
+                AggregatedJacocoReportTask.sourceRootsOf( p ).each { sourceRoot -> fileset(
dir: "${ sourceRoot }" ) }
+              }
+            }
           }
           group( name: 'Extensions' ) {
-            classfiles { extProjects.collect { p -> fileset dir: "${ p.buildDir.path }/classes/main"
} }
-            sourcefiles { samplesProjects.collect { p -> sourceRootsOf( p ).each { sourceRoot
-> fileset dir: sourceRoot.absolutePath } } }
+            classfiles { extProjects.collect { p -> fileset( dir: "${ p.buildDir.path
}/classes/main" ) } }
+            sourcefiles {
+              extProjects.collect { p ->
+                AggregatedJacocoReportTask.sourceRootsOf( p ).each { sourceRoot -> fileset(
dir: "${ sourceRoot }" ) }
+              }
+            }
           }
           group( name: 'Tools' ) {
-            classfiles { toolsProjects.collect { p -> fileset dir: "${ p.buildDir.path
}/classes/main" } }
-            sourcefiles { samplesProjects.collect { p -> sourceRootsOf( p ).each { sourceRoot
-> fileset dir: sourceRoot.absolutePath } } }
+            classfiles { toolsProjects.collect { p -> fileset( dir: "${ p.buildDir.path
}/classes/main" ) } }
+            sourcefiles {
+              toolsProjects.collect { p ->
+                AggregatedJacocoReportTask.sourceRootsOf( p ).each { sourceRoot -> fileset(
dir: "${ sourceRoot }" ) }
+              }
+            }
           }
           group( name: 'Tutorials' ) {
-            classfiles { tutoProjects.collect { p -> fileset dir: "${ p.buildDir.path
}/classes/main" } }
-            sourcefiles { samplesProjects.collect { p -> sourceRootsOf( p ).each { sourceRoot
-> fileset dir: sourceRoot.absolutePath } } }
+            classfiles { tutoProjects.collect { p -> fileset( dir: "${ p.buildDir.path
}/classes/main" ) } }
+            sourcefiles {
+              tutoProjects.collect { p ->
+                AggregatedJacocoReportTask.sourceRootsOf( p ).each { sourceRoot -> fileset(
dir: "${ sourceRoot }" ) }
+              }
+            }
           }
           group( name: 'Samples' ) {
-            classfiles { samplesProjects.collect { p -> fileset dir: "${ p.buildDir.path
}/classes/main" } }
-            sourcefiles { samplesProjects.collect { p -> sourceRootsOf( p ).each { sourceRoot
-> fileset dir: sourceRoot.absolutePath } } }
+            classfiles { samplesProjects.collect { p -> fileset( dir: "${ p.buildDir.path
}/classes/main" ) } }
+            sourcefiles {
+              samplesProjects.collect { p ->
+                AggregatedJacocoReportTask.sourceRootsOf( p ).each { sourceRoot -> fileset(
dir: "${ sourceRoot }" ) }
+              }
+            }
           }
         }
         csv destfile: "${ outputDirectory }/jacoco.csv", encoding: 'UTF-8'
@@ -97,10 +121,10 @@ class AggregatedJacocoReportTask extends DefaultTask
     }
   }
 
-  private static List<File> sourceRootsOf( Project project )
+  private static List<String> sourceRootsOf( Project project )
   {
-    [ 'src/main/java', 'src/main/groovy', 'src/main/kotlin' ]
-      .collect { project.file( it ) }
-      .findAll { it.exists() }
+    [ 'src/main/java', 'src/main/groovy', 'src/main/kotlin' ].collect { project.file it }
+                                                             .findAll { it.directory }
+                                                             .collect { it.absolutePath }
   }
 }


Mime
View raw message