build: supports published project that are not Java projects
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/53ae77b7 Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/53ae77b7 Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/53ae77b7 Branch: refs/heads/develop Commit: 53ae77b735c9225fab234d1812ecd292985d5f4d Parents: 947ee2d Author: Paul Merlin <[email protected]> Authored: Sun Apr 23 13:07:00 2017 +0200 Committer: Paul Merlin <[email protected]> Committed: Sun Apr 23 13:07:00 2017 +0200 ---------------------------------------------------------------------- .../gradle/structure/reports/ReportsPlugin.groovy | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/53ae77b7/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/ReportsPlugin.groovy ---------------------------------------------------------------------- diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/ReportsPlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/ReportsPlugin.groovy index 346005f..7b9dd21 100644 --- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/ReportsPlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/reports/ReportsPlugin.groovy @@ -149,10 +149,12 @@ class ReportsPlugin implements Plugin<Project> } apiSources.each { Project apiProject -> apiProject.afterEvaluate { Project evaluatedApiProject -> - def mainSourceSet = evaluatedApiProject.convention.getPlugin( JavaPluginConvention ) - .sourceSets.getByName( 'main' ) - task.source mainSourceSet.allJava - task.classpath += mainSourceSet.compileClasspath + def javaConvention = evaluatedApiProject.convention.findPlugin( JavaPluginConvention ) + if(javaConvention) { + def mainSourceSet = javaConvention.sourceSets.getByName( 'main' ) + task.source mainSourceSet.allJava + task.classpath += mainSourceSet.compileClasspath + } } } }
