Skip to content

Commit

Permalink
Merge pull request GradleUp#316 from mark-vieira/master
Browse files Browse the repository at this point in the history
Make build scan integration work with multi-project builds
  • Loading branch information
johnrengelman authored Jul 31, 2017
2 parents 690b9cb + 3ebf59e commit 5e89b3d
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ class ShadowPlugin implements Plugin<Project> {
project.plugins.apply(ShadowApplicationPlugin)
}

project.plugins.withId('com.gradle.build-scan') {
project.buildScan.buildFinished {
def rootProject = project.rootProject
rootProject.plugins.withId('com.gradle.build-scan') {
rootProject.buildScan.buildFinished {
def shadowTasks = project.tasks.withType(ShadowJar)
shadowTasks.each { task ->
if (task.didWork) {
task.stats.buildScanData.each { k, v ->
project.buildScan.value "shadow.${task.name}.${k}", v.toString()
rootProject.buildScan.value "shadow.${task.path}.${k}", v.toString()
}
project.buildScan.value "shadow.${task.name}.configurations", task.configurations*.name.join(", ")
rootProject.buildScan.value "shadow.${task.path}.configurations", task.configurations*.name.join(", ")
}
}
}
Expand Down

0 comments on commit 5e89b3d

Please sign in to comment.